summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/functions.py4
-rw-r--r--tools/pkt_fwd/testpmd.py34
-rw-r--r--tools/pkt_gen/moongen/moongen.py3
3 files changed, 36 insertions, 5 deletions
diff --git a/tools/functions.py b/tools/functions.py
index da43edca..e8bc31da 100644
--- a/tools/functions.py
+++ b/tools/functions.py
@@ -146,10 +146,6 @@ def check_traffic(traffic):
"""Check traffic definition and correct it if possible.
"""
# check if requested networking layers make sense
- if traffic['vlan']['enabled']:
- if not (traffic['l3']['enabled'] and traffic['l4']['enabled']):
- raise RuntimeError('TRAFFIC misconfiguration: both l3 and l4 must '
- 'be enabled if vlan is enabled.')
if traffic['l4']['enabled']:
if not traffic['l3']['enabled']:
raise RuntimeError('TRAFFIC misconfiguration: l3 must be enabled '
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 []
diff --git a/tools/pkt_gen/moongen/moongen.py b/tools/pkt_gen/moongen/moongen.py
index 9d604db2..570720e8 100644
--- a/tools/pkt_gen/moongen/moongen.py
+++ b/tools/pkt_gen/moongen/moongen.py
@@ -114,6 +114,9 @@ class Moongen(ITrafficGenerator):
out_file.write("testType = \"throughput\",\n")
+ out_file.write("nrFlows = " + \
+ str(traffic['multistream']) + ",\n")
+
out_file.write("runBidirec = " + \
traffic['bidir'].lower() + ",\n")