summaryrefslogtreecommitdiffstats
path: root/tools/pkt_fwd
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2017-04-12 05:47:00 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-04-12 05:47:00 +0000
commit0c4ab9b84ea256d22176ba6c9e89cefe9c212b7e (patch)
treeb20aafe2050ff9bef684e80600f9714da90236f4 /tools/pkt_fwd
parentbd4859904037d5259d36d7689d464864bad5c395 (diff)
parentc071fadc49859b4cb6bd0c37a85746287612c42b (diff)
Merge "jumbo_frame: Add jumbo frame support"
Diffstat (limited to 'tools/pkt_fwd')
-rw-r--r--tools/pkt_fwd/testpmd.py34
1 files changed, 33 insertions, 1 deletions
diff --git a/tools/pkt_fwd/testpmd.py b/tools/pkt_fwd/testpmd.py
index 970259dc..3b100c14 100644
--- a/tools/pkt_fwd/testpmd.py
+++ b/tools/pkt_fwd/testpmd.py
@@ -54,6 +54,11 @@ class TestPMD(IPktFwd):
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')
@@ -74,6 +79,12 @@ class TestPMD(IPktFwd):
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)
@@ -91,7 +102,18 @@ class TestPMD(IPktFwd):
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)
@@ -108,3 +130,13 @@ class TestPMD(IPktFwd):
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 []