DEVLINK-PORT(8)
๐ DEVLINK-PORT ๐
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 ๐ฆ
๐ devlink port set โ change devlink port attributes
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โ Ethernetibโ Infinibandautoโ autoselect
๐ devlink port split โ split devlink port into more
DEV/PORT_INDEXโ says which devlink port we're operating on.count COUNTโ the number of ports to split into.
โจ devlink port unsplit โ unsplit previously split devlink port
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.
๐ devlink port show โ display devlink port attributes
DEV/PORT_INDEXโ says which devlink port to show. if you skip this argument, all ports get listed. surprise, it's everyone ๐ซถ
๐ฉบ devlink port health โ devlink health reporting and recovery
This one is an alias for devlink-health(8). iykyk.
๐ devlink port add โ add a devlink port
DEVโ says which devlink device to operate on, orDEV/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 portpcisfโ 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.
๐ง devlink port function set โ Set the port function attribute(s).
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.
๐ devlink port del โ delete a devlink port
DEV/PORT_INDEXโ says which devlink port to delete. bye bestie ๐
๐ธ devlink port param set โ set new value to devlink port configuration parameter
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 thedevlink reloadcommand 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 ๐
๐ devlink port param show โ display devlink port supported configuration parameters attributes
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.
๐ฅ devlink port function rate โ manage devlink rate objects
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
- alpine 3.24: iproute2-doc 7.0.0-r0 ยท GPL-2.0-or-later
- arch rolling: iproute2 7.2.0-1
- arch rolling: iproute2 7.3.0-1 ยท GPL-2.0-or-later
- centos-stream 10: iproute 7.0.0-2.el10 ยท GPL-2.0-or-later AND NIST-PD
- nixos 26.05: iproute2 7.0.0
- nixpkgs unstable: iproute2 7.2.0
- ubuntu stonking: iproute2 7.2.0-1ubuntu1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms