DEVLINK-PORT(8)

okay bestie, so this is the devlink-port page, section 8 of the Linux manual, and it's literally all about making devlink ports do your bidding. splitting them, unsplitting them, naming them, activating functions, the whole thing. buckle up ๐ŸŽ€


๐ŸŒธ NAME ๐ŸŒธ

devlink-port โ€” devlink port configuration


โœจ SYNOPSIS โœจ

devlink [ OPTIONS ] port  { COMMAND | help }

OPTIONS := { -V[ersion] | -n[no-nice-names] }

devlink port set DEV/PORT_INDEX [ type { eth | ib | auto } ]

devlink port split DEV/PORT_INDEX count COUNT

devlink port unsplit DEV/PORT_INDEX

devlink port show [ DEV/PORT_INDEX ]

devlink port health { show | recover | diagnose | dump | set }

devlink port add { DEV | DEV/PORT_INDEX } [ flavour FLAVOUR ] [ pfnum
        PFNUMBER ] [ sfnum SFNUMBER ] [ controller CNUM ]

devlink port del DEV/PORT_INDEX

devlink port function set DEV/PORT_INDEX [ hw_addr ADDR ] [ state {
        active | inactive } ] [ roce { enable | disable } ] [ migratable
        { enable | disable } ] [ ipsec_crypto { enable | disable } ] [
        ipsec_packet { enable | disable } ] [ max_io_eqs EQS ]

devlink port function rate { show | set | add | del | help }

devlink dev param set DEV/PORT_INDEX name PARAMETER value VALUE cmode {
        runtime | driverinit | permanent }

devlink dev param show [ DEV/PORT_INDEX name PARAMETER ]

devlink port help

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

DEV/PORT_INDEX โ€” says which devlink port we're messing with. lowkey important.

The format is:

BUS_NAME/BUS_ADDRESS/PORT_INDEX
  • type { eth | ib | auto } โ€” sets the port type, periodt.
    • eth โ€” Ethernet
    • ib โ€” Infiniband
    • auto โ€” autoselect
  • DEV/PORT_INDEX โ€” says which devlink port we're operating on.
  • count COUNT โ€” the number of ports to split into.

You can run this on any split port of the same split group. no cap.

  • DEV/PORT_INDEX โ€” says which devlink port we're operating on.
  • DEV/PORT_INDEX โ€” says which devlink port to show. if you skip this argument, all ports get listed. surprise, it's everyone ๐Ÿซถ

This one is an alias for devlink-health(8). iykyk.

  • DEV โ€” says which devlink device to operate on, or
  • DEV/PORT_INDEX โ€” says which devlink port index to use for the requested new port. this part is optional! when you leave it out, the driver allocates a unique port index all by itself. main character energy โœจ
  • flavour { pcipf | pcisf } โ€” sets the port flavour.
    • pcipf โ€” PCI PF port
    • pcisf โ€” PCI SF port
  • pfnum PFNUMBER โ€” specifies the PCI PF number on which to create an SF device.
  • sfnum SFNUMBER โ€” specifies the sfnumber to assign to the device of the SF. this field is optional for those devices that support auto assignment of the SF number.
  • controller CNUM โ€” specifies the controller number for which the SF port is created. this field is optional too. it's only used when the SF port is created for the external controller.
  • DEV/PORT_INDEX โ€” says which devlink port we're operating on.
  • hw_addr ADDR โ€” the hardware address of the function to set. when the port type is Ethernet, this is an Ethernet MAC address.
  • state { active | inactive } โ€” the new state of the function to change to.
    • active โ€” once configuration of the function is done, activate the function.
    • inactive โ€” to inactivate the function and its device(s), set to inactive.
  • roce { enable | disable } โ€” sets the RoCE capability of the function.
  • migratable { enable | disable } โ€” sets the migratable capability of the function.
  • ipsec_crypto { enable | disable } โ€” sets the IPsec crypto offload capability of the function. this controls XFRM state crypto operation (Encrypt/Decrypt) offload.
  • ipsec_packet { enable | disable } โ€” sets the IPsec packet offload capability of the function. this controls XFRM state and policy offload (Encrypt/Decrypt operation and IPsec encapsulation).
  • max_io_eqs EQS โ€” sets the maximum number of IO event queues of the function.
  • DEV/PORT_INDEX โ€” says which devlink port to delete. bye bestie ๐Ÿ‘‹
  • DEV/PORT_INDEX โ€” says which devlink port we're operating on.
  • name PARAMETER โ€” specify the parameter name to set.
  • value VALUE โ€” the new value to set.
  • cmode { runtime | driverinit | permanent } โ€” the configuration mode in which the new value is set.
    • runtime โ€” set the new value while the driver is running. this configuration mode doesn't require any reset to apply the new value. slay, instant gratification.
    • driverinit โ€” set the new value which will be applied during driver initialization. this configuration mode requires restarting the driver by the devlink reload command to apply the new value.
    • permanent โ€” the new value is written to the device's non-volatile memory. this configuration mode requires a hard reset to apply the new value. it's giving commitment ๐Ÿ’€
  • DEV/PORT_INDEX โ€” says which devlink port we're operating on.
  • name PARAMETER โ€” specify the parameter name to show. if this argument, as well as the port index, are omitted โ€” all parameters supported by devlink device ports are listed.

An alias for devlink-rate(8). iconic.


โญ EXAMPLES โญ

devlink port show

Shows the state of all devlink ports on the system. the full roster โœจ

devlink port show pci/0000:01:00.0/1

Shows the state of the specified devlink port.

devlink port set pci/0000:01:00.0/1 type eth

Set the type of the specified devlink port to Ethernet.

devlink port split pci/0000:01:00.0/1 count 4

Split the specified devlink port into four ports. one becomes four, ate ๐Ÿ’…

devlink port unsplit pci/0000:01:00.0/1

Unsplit the specified previously split devlink port. back to one ๐Ÿซถ

devlink port health show

Shows status and configuration of all supported reporters registered on all devlink ports.

devlink port health show pci/0000:01:00.0/1 reporter tx

Shows status and configuration of the tx reporter registered on the pci/0000:01:00.0/1 devlink port.

devlink port add pci/0000:06:00.0 flavour pcisf pfnum 0 sfnum 88

Add a devlink port of flavour PCI SF on a PCI PF having number 0 with SF number 88. to make use of the function, an example sequence is to add a port, configure the function attribute and activate the function. once function usage is completed, inactivate the function and finally delete the port. when there's a desire to reuse the port without deletion, it can be reconfigured and activated again when the function is in inactive state and the function's operational state is detached.

devlink port del pci/0000:06:00.0/1

Delete a previously created devlink port. it is recommended to first deactivate the function if the function supports state management. (read: please be polite and turn it off first ๐Ÿ™ˆ)

devlink port function set pci/0000:01:00.0/1 hw_addr 00:00:00:11:22:33

Configure the hardware address of the PCI function represented by the devlink port. if the port supports change in function state, the hardware address must be configured before activating the function. no skipping steps bestie.

devlink port function set pci/0000:01:00.0/1 state active

Activate the function. this will initiate the function enumeration and driver loading.

devlink port function set pci/0000:01:00.0/1 state inactive

Deactivate the function. this will initiate the function teardown which results in driver unload and device removal. it's giving goodbye ๐Ÿ˜ญ

devlink port function set pci/0000:01:00.0/1 roce enable

This will enable the RoCE functionality of the function.

devlink port function set pci/0000:01:00.0/1 migratable enable

This will enable the migratable functionality of the function.

devlink port function set pci/0000:01:00.0/1 ipsec_crypto enable

This will enable the IPsec crypto offload functionality of the function.

devlink port function set pci/0000:01:00.0/1 ipsec_packet enable

This will enable the IPsec packet offload functionality of the function.

devlink port function set pci/0000:01:00.0/1 max_io_eqs 4

This will set the maximum number of IO event queues of the function to 4.

devlink port function set pci/0000:01:00.0/1 hw_addr 00:00:00:11:22:33
state active

Configure the hardware address and also activate the function. when a function is activated together with other configuration in a single command, all the configuration is applied first, before changing the state to active.

devlink dev param show

Shows (dumps) all the port parameters across all the devices registered in the devlink.

devlink dev param set pci/0000:01:00.0/1 name internal_error_reset value
true cmode runtime

Sets the parameter internal_error_reset of the specified devlink port (#1) to true.

devlink port add pci/0000:06:00.0 flavour pcisf pfnum 0 sfnum 88
controller 1

Add a devlink port of flavour PCI SF on controller 1 which has a PCI PF of number 0 with SF number 88. to make use of the function, an example sequence is to add a port, configure the function attribute and activate the function. once the function usage is completed, deactivate the function and finally delete the port. when there's a desire to reuse the port without deletion, it can be reconfigured and activated again when the function is in inactive state and the function's operational state is detached.


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

devlink(8), devlink-dev(8), devlink-sb(8), devlink-monitor(8), devlink-health(8),


๐Ÿ’œ AUTHOR ๐Ÿ’œ

Jiri Pirko <jiri@mellanox.com>


and that's the whole page bestie, no notes ๐Ÿ’… this one shipped as part of iproute2, dated 14 Mar 2016. go forth and configure your ports, you absolute icon ๐Ÿ‘‘๐Ÿ’–
๐Ÿ“ฆ where this page comes from