summaryrefslogtreecommitdiffstats
path: root/tools/pkt_fwd/testpmd.py
diff options
context:
space:
mode:
authorChristian Trautman <ctrautma@redhat.com>2017-03-29 13:28:38 -0400
committerChristian Trautman <ctrautma@redhat.com>2017-03-30 07:36:53 -0400
commitc071fadc49859b4cb6bd0c37a85746287612c42b (patch)
treed4d377ef8173366c400b6e7fa4a61ade779343f9 /tools/pkt_fwd/testpmd.py
parent881bf91ed8014ba48c55d3a8fc5b4980913f9b95 (diff)
jumbo_frame: Add jumbo frame support
Add jumbo frame support for all packet forwarding applications inside guest for pxp testing. Enable jumbo frame support for OvsVanilla, OvsDpdkVhostUser, and Packet forwarding. Add minor fix for missing method issue when running packet forwarding tests. The get_version method was missing in the packet_forwaring core module. JIRA: VSPERF-501 Change-Id: Ia99975f47c64259ed2566bde3c85b2779c309e80 Signed-off-by: Christian Trautman <ctrautma@redhat.com>
Diffstat (limited to 'tools/pkt_fwd/testpmd.py')
-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 []