summaryrefslogtreecommitdiffstats
path: root/scripts/dpdk_setup_ports.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-09-27 09:08:57 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-09-27 09:08:57 +0300
commit1e6b2bf6001275bdd2ab0691f335bbb7966bf619 (patch)
treecd601fa51b2645f9a21ed1cbad5c76da13e01cc3 /scripts/dpdk_setup_ports.py
parent9ff1f808edcc9289d297b3a6cf34b1e5590ecf85 (diff)
/etc/trex_cfg.yaml allow MAC as string "12:34:56:78:9a:bc" etc.
dpdk_setup_ports: fix create config in case of VM & passthrough
Diffstat (limited to 'scripts/dpdk_setup_ports.py')
-rwxr-xr-xscripts/dpdk_setup_ports.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/dpdk_setup_ports.py b/scripts/dpdk_setup_ports.py
index 4abb2e53..5e3e9a3f 100755
--- a/scripts/dpdk_setup_ports.py
+++ b/scripts/dpdk_setup_ports.py
@@ -135,10 +135,12 @@ class ConfigCreator(object):
lcores_pool = sorted([lcore for lcores in self.lcores_per_numa.values() for lcore in lcores])
config_str += ' '*6 + 'master_thread_id: %s\n' % (0 if self.has_zero_lcore else lcores_pool.pop())
config_str += ' '*6 + 'latency_thread_id: %s\n' % lcores_pool.pop(0)
+ lcores_per_dual_if = int(len(lcores_pool) / len(self.interfaces))
config_str += ' '*6 + 'dual_if:\n'
for i in range(0, len(self.interfaces), 2):
+ lcores_for_this_dual_if = [str(lcores_pool.pop(0)) for _ in range(lcores_per_dual_if)]
config_str += ' '*8 + '- socket: 0\n'
- config_str += ' '*10 + 'threads: [%s]\n\n' % lcores_pool.pop(0)
+ config_str += ' '*10 + 'threads: [%s]\n\n' % ','.join(lcores_for_this_dual_if)
else:
# we will take common minimum among all NUMAs, to satisfy all
lcores_per_dual_if = 99