diff options
Diffstat (limited to 'scripts/dpdk_nic_bind.py')
-rwxr-xr-x | scripts/dpdk_nic_bind.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/dpdk_nic_bind.py b/scripts/dpdk_nic_bind.py index 44d4e82d..a85ecb71 100755 --- a/scripts/dpdk_nic_bind.py +++ b/scripts/dpdk_nic_bind.py @@ -45,6 +45,10 @@ import getpass # The PCI device class for ETHERNET devices ETHERNET_CLASS = "0200" +PATH = os.getenv('PATH', '') +needed_path = '.:/bin:/usr/bin:/usr/sbin' +if needed_path not in PATH: + os.environ['PATH'] = '%s:%s' % (PATH, needed_path) # global dict ethernet devices present. Dictionary indexed by PCI address. # Each device within this is itself a dictionary of device properties @@ -629,6 +633,13 @@ def show_table(): table.add_row([id, d['NUMA'], d['Slot_str'], d.get('MAC', ''), d['Device_str'], d.get('Driver_str', ''), d['Interface'], d['Active']]) print(table.draw()) +# dumps pci address and description (user friendly device name) +def dump_pci_description(): + if not devices: + get_nic_details() + for d in devices.values(): + print('%s - %s' % (d['Slot'], d['Device_str'])) + def parse_args(): '''Parses the command-line arguments given by the user and takes the appropriate action for each''' |