# default vswitch implementation
VSWITCH = "OvsDpdkVhost"
+VSWITCH_JUMBO_FRAMES_ENABLED = False
+VSWITCH_JUMBO_FRAMES_SIZE = 9000
+
#########################
## VPP
#########################
self._pktfwd.stop()
raise
+ def get_vswitch(self):
+ """See IVswitchController for description
+ """
+ return self._pktfwd
+
def setup_for_guest(self):
"""Sets up the packet forwarder for pvp.
"""
on the same numa as the NIC in use if possible/applicable. Testpmd should be
assigned at least (nb_cores +1) total cores with the cpu mask.
+Jumbo Frame Testing
+^^^^^^^^^^^^^^^^^^^
+
+VSPERF provides options to support jumbo frame testing with a jumbo frame supported
+NIC and traffic generator for the following vswitches:
+
+1. OVSVanilla
+
+2. OvsDpdkVhostUser
+
+3. TestPMD loopback with or without a guest
+
+**NOTE:** There is currently no support for SR-IOV or VPP at this time with jumbo
+frames.
+
+All packet forwarding applications for pxp testing is supported.
+
+To enable jumbo frame testing simply enable the option in the conf files and set the
+maximum size that will be used.
+
+.. code-block:: python
+
+ VSWITCH_JUMBO_FRAMES_ENABLED = True
+ VSWITCH_JUMBO_FRAMES_SIZE = 9000
+
+To enable jumbo frame testing with OVSVanilla the NIC in test on the host must have
+its mtu size changed manually using ifconfig or applicable tools:
+
+.. code-block:: console
+
+ ifconfig eth1 mtu 9000 up
+
+**NOTE:** To make the setting consistent across reboots you should reference the OS
+documents as it differs from distribution to distribution.
+
+To start a test for jumbo frames modify the conf file packet sizes or pass the option
+through the VSPERF command line.
+
+.. code-block:: python
+
+ TEST_PARAMS = {'TRAFFICGEN_PKT_SIZES':(2000,9000)}
+
+.. code-block:: python
+
+ ./vsperf --test-params "TRAFFICGEN_PKT_SIZES=2000,9000"
+
+It is recommended to increase the memory size for OvsDpdkVhostUser testing from the default
+1024. Your size required may vary depending on the number of guests in your testing. 4096
+appears to work well for most typical testing scenarios.
+
+.. code-block:: python
+
+ DPDK_SOCKET_MEM = ['4096', '0']
+
+**NOTE:** For Jumbo frames to work with DpdkVhostUser, mergable buffers will be enabled by
+default. If testing with mergable buffers in QEMU is desired, disable Jumbo Frames and only
+test non jumbo frame sizes. Test Jumbo Frames sizes separately to avoid this collision.
+
+
Executing Packet Forwarding tests
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
vswitchd_args += _VSWITCHD_CONST_ARGS
vswitchd_args += settings.getValue('TESTPMD_ARGS')
+ # need to give mbufs a larger size for jumbo frames based on the setting
+ if settings.getValue('VSWITCH_JUMBO_FRAMES_ENABLED'):
+ vswitchd_args += ['--mbuf-size={}'.format(int(
+ settings.getValue('VSWITCH_JUMBO_FRAMES_SIZE')) + 500)]
+
self._nports = len(settings.getValue('NICS'))
self._fwdmode = settings.getValue('TESTPMD_FWD_MODE')
self._csum_layer = settings.getValue('TESTPMD_CSUM_LAYER')
self._testpmd.send('set fwd {}'.format(self._fwdmode), 1)
+ if settings.getValue('VSWITCH_JUMBO_FRAMES_ENABLED'):
+ self._testpmd.send('port stop all', 1) # ports must be stopped to set mtu
+ self._testpmd.send('port config all max-pkt-len {}'.format(
+ settings.getValue('VSWITCH_JUMBO_FRAMES_SIZE')), 1)
+ self._testpmd.send('port start all', 1)
+
for port in range(self._nports):
self._testpmd.send('csum set {} {} {}'.format(
self._csum_layer, self._csum_calc, port), 1)
dpdk.init()
self._testpmd.start()
self._logger.info("TestPMD...Started.")
- self._testpmd.send('set portlist 0,2,1,3')
+
+ if settings.getValue('VSWITCH_JUMBO_FRAMES_ENABLED'):
+ self._testpmd.send('port stop all', 1) # ports must be stopped to set mtu
+ self._testpmd.send('port config all max-pkt-len {}'.format(
+ settings.getValue('VSWITCH_JUMBO_FRAMES_SIZE')), 1)
+ # conflicting info if scatter needs to be enabled or not
+ self._testpmd.send('port config all scatter on', 1)
+ self._testpmd.send('port start all', 1)
+ self._testpmd.wait(timeout=60) # port startup can take a few seconds
+
+ self._testpmd.send('set portlist 0,2,1,3', 1)
+ self._testpmd.send('set fwd {}'.format(self._fwdmode), 1)
self._testpmd.send('start', 1)
except pexpect.EOF:
pass
dpdk.cleanup()
+
+ # Method could be a function
+ # pylint: disable=no-self-use
+ def get_version(self):
+ """
+ Get product version
+ :return: None
+ """
+ # No way to read TestPMD version
+ return []
# get testpmd settings from CLI
testpmd_params = S.getValue('GUEST_TESTPMD_PARAMS')[self._number]
+ if S.getValue('VSWITCH_JUMBO_FRAMES_ENABLED'):
+ testpmd_params += ' --max-pkt-len={}'.format(S.getValue(
+ 'VSWITCH_JUMBO_FRAMES_SIZE'))
self.execute_and_wait('./testpmd {}'.format(testpmd_params), 60, "Done")
self.execute('set fwd ' + self._testpmd_fwd_mode, 1)
for nic in self._nics:
self.execute('ip addr add ' +
nic['ip'] + ' dev ' + nic['device'])
+ if S.getValue('VSWITCH_JUMBO_FRAMES_ENABLED'):
+ self.execute('ifconfig {} mtu {}'.format(
+ nic['device'], S.getValue('VSWITCH_JUMBO_FRAMES_SIZE')))
self.execute('ip link set dev ' + nic['device'] + ' up')
# build and configure system for l2fwd
for nic in self._nics:
self.execute('ip addr add ' +
nic['ip'] + ' dev ' + nic['device'])
+ if S.getValue('VSWITCH_JUMBO_FRAMES_ENABLED'):
+ self.execute('ifconfig {} mtu {}'.format(
+ nic['device'], S.getValue('VSWITCH_JUMBO_FRAMES_SIZE')))
self.execute('ip link set dev ' + nic['device'] + ' up')
self.execute('brctl addif br0 ' + nic['device'])
# Guest merge buffer setting
if S.getValue('GUEST_NIC_MERGE_BUFFERS_DISABLE')[self._number]:
- merge_buff = 'mrg_rxbuf=off,'
+ if S.getValue('VSWITCH_JUMBO_FRAMES_ENABLED'):
+ self._logger.warning(
+ 'Mergable buffers must be enabled for jumbo frames. Overriding.')
+ merge_buff = ''
+ else:
+ merge_buff = 'mrg_rxbuf=off,'
else:
merge_buff = ''
not S.getValue('OVS_OLD_STYLE_MQ'):
params += ['options:n_rxq={}'.format(
S.getValue('VSWITCH_DPDK_MULTI_QUEUES'))]
+ if S.getValue('VSWITCH_JUMBO_FRAMES_ENABLED'):
+ params += ['mtu_request={}'.format(
+ S.getValue('VSWITCH_JUMBO_FRAMES_SIZE'))]
of_port = bridge.add_port(port_name, params)
return (port_name, of_port)
vhost_count = self._get_port_count('type=dpdkvhostuser')
port_name = 'dpdkvhostuser' + str(vhost_count)
params = ['--', 'set', 'Interface', port_name, 'type=dpdkvhostuser']
+ if S.getValue('VSWITCH_JUMBO_FRAMES_ENABLED'):
+ params += ['mtu_request={}'.format(
+ S.getValue('VSWITCH_JUMBO_FRAMES_SIZE'))]
of_port = bridge.add_port(port_name, params)
return (port_name, of_port)
tap_cmd_list += ['multi_queue']
tasks.run_task(tap_cmd_list, self._logger,
'Creating tap device...', False)
+ if settings.getValue('VSWITCH_JUMBO_FRAMES_ENABLED'):
+ tasks.run_task(['ifconfig', tap_name, 'mtu',
+ str(settings.getValue('VSWITCH_JUMBO_FRAMES_SIZE'))],
+ self._logger, 'Setting mtu size', False)
tasks.run_task(['sudo', 'ip', 'addr', 'flush', 'dev', tap_name],
self._logger, 'Remove IP', False)