DEVLINK(8)

okay so welcome to devlink(8), the Linux manual page for the devlink utility. Yes the title is all shouty up there but it's just devlink โ€” lowercase, chill, your new bestie for talking to the kernel's devlink subsystem. Sit down, grab a boba, let's get into it. ๐Ÿง‹โœจ


๐ŸŒธ NAME ๐ŸŒธ

devlink โ€” the Devlink tool. That's it, that's the name. Short, iconic, does exactly what it says. ๐Ÿ’…


โœจ SYNOPSIS โœจ

Here's the whole vibe in two lines:

devlink [ OPTIONS ] {
        dev|port|monitor|sb|resource|region|health|trap|rate|lc|dpipe }
        { COMMAND | help }
devlink [ -force ] -batch filename

So like โ€” you pick an object from that big curly-brace menu, then you give it a command (or just help if you're feeling lost, no shame bestie). OR you go the batch route with a file. Either way, devlink's got you. ๐Ÿซถ


๐Ÿ’… OPTIONS ๐Ÿ’…

These are your little knobs and switches, okay? Every single one, no skips:

  • -V, --Version โ€” prints the version of the devlink utility and then dips out. Bye! ๐Ÿ‘‹
  • -b, -batch <FILENAME> โ€” reads commands from the file you hand it (or from standard input) and runs them. Heads up: the first failure will cause termination of devlink. It does not play around. ๐Ÿ’€
  • -force โ€” don't terminate devlink on errors in batch mode. So it keeps going even when things go sideways. But note this: if there were any errors during execution of the commands, the application return code will be non zero. It remembers. It always remembers. ๐Ÿ™ˆ
  • -n, --no-nice-names โ€” turns off printing out nice names. Like instead of the pretty devlink port identification, you get raw netdevice ifnames. Unglamorous but honest. โœจ
  • -j, --json โ€” generates JSON output. For when you want your data machine-readable and slightly mysterious. ๐Ÿค–
  • -p, --pretty โ€” when combined with -j, generates a pretty JSON output. Aesthetic JSON. We love to see it. ๐ŸŽ€
  • -v, --verbose โ€” turns on verbose output. It's giving "tell me everything". ๐Ÿ‘‘
  • -s, --statistics โ€” outputs statistics. Numbers, numbers, numbers. ๐Ÿ“Š
  • -N, -Netns <NETNSNAME> โ€” switches to the specified network namespace. Portal travel, but for network stacks. ๐ŸŒ€
  • -i, --iec โ€” prints human readable rates in IEC units (e.g. 1Ki = 1024). Yes bestie, 1024, not 1000, don't @ me. ๐Ÿ”ข
  • -x, --hex โ€” prints dump numbers in hexadecimal format. 0x girlies rise up. ๐Ÿ”ฅ

๐ŸŒˆ OBJECT ๐ŸŒˆ

Pick your fighter. Each of these is a thing devlink can operate on:

  • dev โ€” devlink device.
  • port โ€” devlink port.
  • monitor โ€” watch for netlink messages.
  • sb โ€” devlink shared buffer configuration.
  • resource โ€” devlink device resource configuration.
  • region โ€” devlink address region access.
  • health โ€” devlink reporting and recovery.
  • trap โ€” devlink trap configuration.
  • rate โ€” devlink rate object configuration.
  • lc โ€” devlink line card configuration.
  • dpipe โ€” devlink datapath pipeline visualization.

โญ COMMAND โญ

So this is the part where you say what to do to the object you picked. The set of possible actions depends on the object type โ€” different objects, different energy.

As a rule, it is possible to show (or list) objects, but some objects do not allow all of these operations or have some additional commands. Not everyone gets the same menu, it's fine, we don't compare. ๐Ÿ™…

The help command is available for all objects. It prints out a list of available commands and argument syntax conventions. Use it, bestie, it's literally free. ๐Ÿซถ

If no command is given, some default command is assumed. Usually it is list or, if the objects of this class cannot be listed, help. The tool is smart like that. โœจ


๐Ÿฆ‹ EXIT STATUS ๐Ÿฆ‹

Exit status is 0 if command was successful, or a positive integer upon failure. Zero = slay. Anything else = something went wrong. ๐ŸŒธ


๐ŸŽ€ SEE ALSO ๐ŸŽ€

Go read these next, they're the whole friend group:

devlink-dev(8), devlink-port(8), devlink-monitor(8), devlink-sb(8), devlink-resource(8), devlink-region(8), devlink-health(8), devlink-trap(8), devlink-rate(8), devlink-lc(8), devlink-dpipe(8)


๐Ÿ’€ REPORTING BUGS ๐Ÿ’€

Found a bug? Report any bugs to the Network Developers mailing list <netdev@vger.kernel.org> โ€” that's where the development and maintenance is primarily done.

Good news: you do not have to be subscribed to the list to send a message there. Just slide in. ๐Ÿ“ฌ

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Jiri Pirko <jiri@mellanox.com> โ€” the actual author, we stan. ๐Ÿ’œ


and that's the whole page!! This one came from the iproute2 crew, dated 14 Mar 2016, and it's the DEVLINK(8) manual. Go forth, run devlink help, be the main character of your own network stack. periodt. ๐Ÿ’…โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from