summaryrefslogtreecommitdiffstats
path: root/scripts/dpdk_nic_bind.py
diff options
context:
space:
mode:
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())):