summaryrefslogtreecommitdiffstats
path: root/scripts/dpdk_nic_bind.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-11-03 15:17:49 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-11-03 15:18:00 +0200
commit9dba32c9a8c026a98993c32bdbc01f6454a79720 (patch)
tree2e9bea25aba098a050e9cfa3a33930ba3c52aede /scripts/dpdk_nic_bind.py
parent5d52395c51c8638a8c328f13cea6f0a5ddbc3642 (diff)
dpdk_setup_ports.py: config creation - don't run TRex if IP config is wanted
Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'scripts/dpdk_nic_bind.py')
-rwxr-xr-xscripts/dpdk_nic_bind.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/dpdk_nic_bind.py b/scripts/dpdk_nic_bind.py
index a85ecb71..36d123f1 100755
--- a/scripts/dpdk_nic_bind.py
+++ b/scripts/dpdk_nic_bind.py
@@ -609,7 +609,7 @@ def get_info_from_trex(pci_addr_list):
pci_info_dict[pci]['TRex_Driver'] = match.group(3)
return pci_info_dict
-def show_table():
+def show_table(get_macs = True):
'''Function called when the script is passed the "--table" option.
Similar to show_status() function, but shows more info: NUMA etc.'''
global dpdk_drivers
@@ -620,12 +620,13 @@ def show_table():
if devices[d].get("Driver_str") in dpdk_drivers:
dpdk_drv.append(d)
- for pci, info in get_info_from_trex(dpdk_drv).items():
- if pci not in dpdk_drv: # sanity check, should not happen
- print('Internal error while getting MACs of DPDK bound interfaces, unknown PCI: %s' % pci)
- return
- devices[pci].update(info)
-
+ if get_macs:
+ for pci, info in get_info_from_trex(dpdk_drv).items():
+ if pci not in dpdk_drv: # sanity check, should not happen
+ print('Internal error while getting MACs of DPDK bound interfaces, unknown PCI: %s' % pci)
+ return
+ devices[pci].update(info)
+
table = texttable.Texttable(max_width=-1)
table.header(['ID', 'NUMA', 'PCI', 'MAC', 'Name', 'Driver', 'Linux IF', 'Active'])
for id, pci in enumerate(sorted(devices.keys())):