DEVLINK-DEV(8)
๐ NAME ๐
devlink-dev โ devlink device configuration, bestie. This is the page in the DEVLINK-DEV(8) family that handles all the device-level stuff: showing your devlink devices, flipping the eswitch around, poking parameters, hot reloading drivers, flashing firmware, and running selftests. Buckle up. ๐ฆ
โจ SYNOPSIS โจ
devlink [ OPTIONS ] dev { COMMAND | help }
OPTIONS := { -V[ersion] | -n[no-nice-names] }
devlink dev show [ DEV ]
devlink dev help
devlink dev eswitch set DEV [ mode { legacy | switchdev } ] [ inline-mode { none | link | network | transport } ] [ encap-mode { none | basic } ]
devlink dev eswitch show DEV
devlink dev param set DEV name PARAMETER [ value VALUE | default ] cmode { runtime | driverinit | permanent }
devlink dev param show [ DEV name PARAMETER ]
devlink dev reload DEV [ netns { PID | NAME | ID } ] [ action { driver_reinit | fw_activate } ] [ limit no_reset ]
devlink dev info [ DEV ]
devlink dev flash DEV file PATH [ target ID ]
devlink dev selftests show [ DEV ]
devlink dev selftests run DEV [ id ID... ]
๐ DESCRIPTION ๐
๐ธ devlink dev show - display devlink device attributes ๐ธ
DEV โ tells you which devlink device to show off. If you don't pass this argument, literally every device gets listed. No cap. ๐
Format is, and I need you to memorize this:
BUS_NAME/BUS_ADDRESS
๐ฆ devlink dev eswitch show - display devlink device eswitch attributes ๐ฆ
๐ฆ devlink dev eswitch set - sets devlink device eswitch attributes ๐ฆ
mode { legacy | switchdev }โ sets the eswitch mode, periodt.legacyโ Legacy SRIOV.switchdevโ SRIOV switchdev offloads. the upgrade arc. โจ
inline-mode { none | link | network | transport }โ some hardware devices need the VF driver to put part of the packet headers on the TX descriptor, so the e-switch can do proper matching and steering. it's giving teamwork fr.noneโ None.linkโ L2 mode.networkโ L3 mode.transportโ L4 mode.
encap-mode { none | basic }โ sets eswitch encapsulation support.noneโ Disable encapsulation support.basicโ Enable encapsulation support. ๐
๐ซถ devlink dev param set - set new value to devlink device configuration parameter ๐ซถ
name PARAMETERโ specify the parameter name you want to set. icon behavior.value VALUEโ the new value to set. Mutually exclusive withdefault. pick a lane bestie, you can't have both. ๐defaultโ restores the parameter to its default value. Mutually exclusive withvalue.cmode { runtime | driverinit | permanent }โ the configuration mode the new value gets set in.runtimeโ set the new value while the driver is running. This configuration mode doesn't require any reset to apply the new value. effortless, lowkey.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 serious.
๐ devlink dev param show - display devlink device supported configuration parameters attributes ๐
name PARAMETERโ specify the parameter name to show. If this argument is omitted, all parameters supported by devlink devices are listed. And here's the cute part: when the kernel provides a default value for a parameter, it will be automatically displayed in the output alongside the current value. two-for-one. ๐
๐ฅ devlink dev reload - perform hot reload of the driver. ๐ฅ
DEVโ specifies the devlink device to reload.netns { PID | NAME | ID }โ specifies the network namespace to reload into, either by pid, name or id.action { driver_reinit | fw_activate }โ specifies the reload action required. If this argument is omitted, thedriver_reinitaction will be used. Heads up though: even though the user asks for a specific action, the driver implementation might require performing another action alongside it. For example, some drivers do not support driver reinitialization being performed without fw activation. Therefore, thedevlink reloadcommand returns the list of actions which were actually performed. it tells on itself, respectfully.driver_reinitโ Driver entities re-initialization, applyingdevlink-paramanddevlink-resourcevalues.fw_activateโ Activates new firmware if such an image is stored and pending activation. If no limitation is specified, this action may involve firmware reset. If no new image is pending, this action will reload the current firmware image.
limit no_resetโ specifies a limitation on the reload action. If this argument is omitted, the limit is unspecified and the reload action is not limited. In such a case, the driver implementation may include reset or downtime as needed to perform the actions.no_resetโ No reset allowed, no down time allowed, no link flap and no configuration is lost. the dream tbh. ๐
โญ devlink dev info - display device information. โญ
Displays device information provided by the driver. You can use this command to query versions of the hardware components or device components which can't be updated (fixed), as well as device firmware which can be updated. For firmware components, running displays the versions of firmware currently loaded into the device, while stored reports the versions in the device's flash. Running and stored versions may differ after flash has been updated, but before reboot. yes bestie they can disagree, it's a whole thing. ๐ญ
DEVโ specifies the devlink device to show. If this argument is omitted, all devices are listed.
๐ devlink dev flash - write device's non-volatile memory. ๐
This one writes to non-volatile memory. Read the arguments, then read them again.
DEVโ specifies the devlink device to write to.file PATHโ Path to the file which will be written into the device's flash. The path needs to be relative to one of the directories searched by the kernel firmware loader, such as/lib/firmware.component NAMEโ if the device stores multiple firmware images in non-volatile memory, this parameter may be used to indicate which firmware image should be written. The value ofNAMEshould match the component names fromdevlink dev infoand may be driver-dependent.
(Also, the synopsis up top shows an optional [ target ID ] for this command. just so you know it's there.)
๐ devlink dev selftests show - shows supported selftests on devlink device. ๐
DEVโ specifies the devlink device. If this argument is omitted, all selftests for devlink devices are listed.
๐ง devlink dev selftests run - runs selftests on devlink device. ๐ง
DEVโ specifies the devlink device to execute selftests.id ID...โ the value ofID(s) should match the selftests shown indevlink dev selftests showto execute selftests on the devlink device. If this argument is omitted, all selftests supported by devlink devices are executed. go big or go home.
๐ EXAMPLES ๐
devlink dev show
Shows the state of all devlink devices on the system.
devlink dev show pci/0000:01:00.0
Shows the state of specified devlink device.
devlink dev eswitch show pci/0000:01:00.0
Shows the eswitch mode of specified devlink device.
devlink dev eswitch set pci/0000:01:00.0 mode switchdev
Sets the eswitch mode of specified devlink device to switchdev.
devlink dev param show pci/0000:01:00.0 name max_macs
Shows the parameter max_macs attributes. If a default value exists,
it will be displayed alongside the current value.
devlink dev param set pci/0000:01:00.0 name internal_error_reset value true cmode runtime
Sets the parameter internal_error_reset of specified devlink device
to true.
devlink dev param set pci/0000:01:00.0 name internal_error_reset default cmode runtime
Restores the parameter internal_error_reset of specified devlink
device to its default value.
devlink dev reload pci/0000:01:00.0
Performs hot reload of specified devlink device.
devlink dev flash pci/0000:01:00.0 file firmware.bin
Flashes the specified devlink device with provided firmware file
name. If the driver supports it, user gets updates about the flash
status. For example:
Preparing to flash
Flashing 100%
Flashing done
devlink dev selftests show pci/0000:01:00.0
Shows the supported selftests by the devlink device.
devlink dev selftests run pci/0000:01:00.0 id flash
Perform a flash test on the devlink device.
๐ SEE ALSO ๐
devlink(8), devlink-port(8), devlink-sb(8), devlink-monitor(8),
๐ธ AUTHOR ๐ธ
Jiri Pirko <jiri@mellanox.com>
okay that's the whole page bestie, you ate. this was iproute2, dated 14 Mar 2016, and the page is DEVLINK-DEV(8). go forth and configure responsibly ๐
โจ๐ซถ
๐ฆ 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