Print usage information for the program
()
| 71 | |
| 72 | |
| 73 | def usage(): |
| 74 | '''Print usage information for the program''' |
| 75 | argv0 = basename(sys.argv[0]) |
| 76 | print(""" |
| 77 | Usage: |
| 78 | ------ |
| 79 | |
| 80 | %(argv0)s [options] DEVICE1 DEVICE2 .... |
| 81 | |
| 82 | where DEVICE1, DEVICE2 etc, are specified via PCI "domain:bus:slot.func" syntax |
| 83 | or "bus:slot.func" syntax. For devices bound to Linux kernel drivers, they may |
| 84 | also be referred to by Linux interface name e.g. eth0, eth1, em0, em1, etc. |
| 85 | |
| 86 | Options: |
| 87 | --help, --usage: |
| 88 | Display usage information and quit |
| 89 | |
| 90 | -s, --status: |
| 91 | Print the current status of all known network, crypto, event |
| 92 | and mempool devices. |
| 93 | For each device, it displays the PCI domain, bus, slot and function, |
| 94 | along with a text description of the device. Depending upon whether the |
| 95 | device is being used by a kernel driver, the igb_uio driver, or no |
| 96 | driver, other relevant information will be displayed: |
| 97 | * the Linux interface name e.g. if=eth0 |
| 98 | * the driver being used e.g. drv=igb_uio |
| 99 | * any suitable drivers not currently using that device |
| 100 | e.g. unused=igb_uio |
| 101 | NOTE: if this flag is passed along with a bind/unbind option, the |
| 102 | status display will always occur after the other operations have taken |
| 103 | place. |
| 104 | |
| 105 | --status-dev: |
| 106 | Print the status of given device group. Supported device groups are: |
| 107 | "net", "crypto", "event" and "mempool" |
| 108 | |
| 109 | -b driver, --bind=driver: |
| 110 | Select the driver to use or \"none\" to unbind the device |
| 111 | |
| 112 | -u, --unbind: |
| 113 | Unbind a device (Equivalent to \"-b none\") |
| 114 | |
| 115 | --force: |
| 116 | By default, network devices which are used by Linux - as indicated by |
| 117 | having routes in the routing table - cannot be modified. Using the |
| 118 | --force flag overrides this behavior, allowing active links to be |
| 119 | forcibly unbound. |
| 120 | WARNING: This can lead to loss of network connection and should be used |
| 121 | with caution. |
| 122 | |
| 123 | Examples: |
| 124 | --------- |
| 125 | |
| 126 | To display current device status: |
| 127 | %(argv0)s --status |
| 128 | |
| 129 | To display current network device status: |
| 130 | %(argv0)s --status-dev net |