DEVLINK-SB(8)
๐ NAME โจ
devlink-sb is the devlink shared buffer configuration tool, and it's giving main character energy ๐. Manual name: devlink-sb - devlink shared buffer configuration.
๐ธ SYNOPSIS ๐ธ
devlink [ OPTIONS ] sb { COMMAND | help }
OPTIONS := { -V[ersion] | -n[no-nice-names] }
devlink sb show [ DEV [ sb SB_INDEX ] ]
devlink sb pool show [ DEV [ sb SB_INDEX ]
pool POOL_INDEX ]
devlink sb pool set DEV [ sb SB_INDEX ]
pool POOL_INDEX
size POOL_SIZE
thtype { static | dynamic }
devlink sb port pool show [ DEV/PORT_INDEX [ sb SB_INDEX ]
pool POOL_INDEX ]
devlink sb port pool set DEV/PORT_INDEX [ sb SB_INDEX ]
pool POOL_INDEX
th THRESHOLD
devlink sb tc bind show [ DEV/PORT_INDEX [ sb SB_INDEX ]
tc TC_INDEX
type { ingress | egress } ]
devlink sb tc bind set DEV/PORT_INDEX [ sb SB_INDEX ]
tc TC_INDEX
type { ingress | egress }
pool POOL_INDEX
th THRESHOLD
devlink sb occupancy show { DEV | DEV/PORT_INDEX } [ sb SB_INDEX ]
devlink sb occupancy snapshot DEV [ sb SB_INDEX ]
devlink sb occupancy clearmax DEV [ sb SB_INDEX ]
devlink sb help
๐ง DESCRIPTION ๐ง
๐ devlink sb show - display available shared buffers and their attributes
DEV ๐
picks the devlink device whose shared buffers you want to see. If you leave it out, you get every shared buffer on every device, so no one gets left out ๐ซถ.
SB_INDEX ๐ picks the shared buffer. If you skip it, you get the one with index 0. This works the same way for every command, so you only have to learn it once ๐ง .
๐ devlink sb pool show - display available pools and their attributes
DEV ๐ picks the devlink device whose pools you're checking. Skip it and you'll see the pools for every device.
Pools are listed with their type, size, thtype and cell_size. โจ cell_size is the allocation granularity of memory inside the shared buffer. Heads up: drivers may round a size up, round it down, or reject it entirely in the set command if it isn't a multiple of cell_size. ๐
๐ ๏ธ devlink sb pool set - set attributes of pool
DEV ๐ is the devlink device whose pool you're changing.
size POOL_SIZE ๐ sets the pool size in Bytes.
thtype { static | dynamic } ๐ง sets the pool threshold type.
staticโ threshold values for the pool are passed in Bytes. ๐dynamicโ threshold values (to_alpha) for the pool are used to work out the alpha parameter with this formula ๐งฎ:
alpha = 2 ^ (to_alpha - 10)
The value you pass has to be between 0 and 20. The computed alpha then decides the maximum usage of the flow ๐:
max_usage = alpha / (1 + alpha) * Free_Buffer
๐ devlink sb port pool show - display port-pool combinations and threshold for each
DEV/PORT_INDEX ๐ฆ picks the devlink port.
pool POOL_INDEX ๐ท๏ธ is the pool index.
๐ฏ devlink sb port pool set - set port-pool threshold
DEV/PORT_INDEX ๐ฆ picks the devlink port.
pool POOL_INDEX ๐ท๏ธ is the pool index.
th THRESHOLD ๐ is the threshold value. Its type is either Bytes or "to_alpha", and that depends on the thtype you set for the pool ๐ค.
๐งต devlink sb tc bind show - display port-TC to pool bindings and threshold for each
DEV/PORT_INDEX ๐ฆ picks the devlink port.
tc TC_INDEX ๐ฆ is the index of either the ingress or egress TC. It's usually in the range 0 to 8, but it depends on the device ๐คทโโ๏ธ.
type { ingress | egress } ๐ is the TC type.
๐ devlink sb tc bind set - set port-TC to pool binding with specified threshold
DEV/PORT_INDEX ๐ฆ picks the devlink port.
tc TC_INDEX ๐ฆ is the index of either the ingress or egress TC. It's usually in the range 0 to 8, but it depends on the device ๐คทโโ๏ธ.
type { ingress | egress } ๐ is the TC type.
pool POOL_INDEX ๐ท๏ธ is the index of the pool you want to bind this to.
th THRESHOLD ๐ is the threshold value. Its type is either Bytes or "to_alpha", and that depends on the thtype you set for the pool ๐ค.
๐ธ devlink sb occupancy show - display shared buffer occupancy values for device or port
This is how you browse the shared buffer occupancy values ๐. You get values for every port-pool combination, plus every port-TC combination (along with the pool that port-TC is bound to). Each value looks like this:
current_value/max_value
Quick reminder: before you can show anything, you have to run occupancy snapshot first ๐ท. No snapshot, no tea โ.
DEV ๐ป picks the devlink device whose occupancy values you want.
DEV/PORT_INDEX ๐ฆ picks the devlink port whose occupancy values you want.
๐๏ธ devlink sb occupancy snapshot - take occupancy snapshot of shared buffer for device
This command takes a snapshot of the shared buffer occupancy values ๐ธ. After that, you can look at them with occupancy show ๐.
DEV ๐ป picks the devlink device to take the occupancy snapshot on.
๐งน devlink sb occupancy clearmax - clear occupancy watermarks of shared buffer for device
This resets the maximal occupancy values reached across the whole device ๐งฝ. Before you check the reset values, you have to run occupancy snapshot first ๐ท.
DEV ๐ป picks the devlink device to clear the occupancy watermarks on.
๐ EXAMPLES ๐
List available shared buffers ๐:
devlink sb show
List available pools and their config ๐:
devlink sb pool show
Show the port-pool setup for a specified port and pool ๐:
devlink sb port pool show pci/0000:03:00.0/1 pool 0
Change the threshold for a specified port and pool ๐ง:
sudo devlink sb port pool set pci/0000:03:00.0/1 pool 0 th 15
Show the pool binding and threshold for a specified port and TC ๐งต:
devlink sb tc bind show pci/0000:03:00.0/1 tc 0 type ingress
Set the pool binding and threshold for a specified port and TC ๐:
sudo devlink sb tc bind set pci/0000:03:00.0/1 tc 0 type ingress pool 0
th 9
Take a snapshot of occupancy for a specified devlink device ๐ธ:
sudo devlink sb occupancy snapshot pci/0000:03:00.0
Show occupancy for a specified port from the snapshot ๐:
devlink sb occupancy show pci/0000:03:00.0/1
Clear the watermarks for a specified devlink device's shared buffer ๐งน:
sudo devlink sb occupancy clearmax pci/0000:03:00.0
๐ฆ SEE ALSO ๐ฆ
devlink(8), devlink-dev(8), devlink-port(8), devlink-monitor(8),
๐ AUTHOR ๐
Jiri Pirko <jiri@mellanox.com> ๐
๐ซถ Bestie, that's the whole thing! It's from the iproute2 suite, DEVLINK-SB(8) manual page, dated 14 Apr 2016 ๐ . Go slay your shared buffers ๐ โจ
๐ฆ where this page comes from
- alpine 3.22: iproute2-doc 6.15.0-r0 ยท GPL-2.0-or-later
- alpine 3.23: iproute2-doc 6.17.0-r0 ยท GPL-2.0-or-later
- 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
- centos-stream 9: iproute 6.17.0-3.el9 ยท GPL-2.0-or-later AND NIST-PD
- debian bookworm: iproute2 6.1.0-3 ยท GPL-2.0-only
- debian trixie: iproute2 6.15.0-1 ยท GPL-2.0-only
- fedora 43: iproute 6.14.0-2.fc43 ยท GPL-2.0-or-later AND NIST-PD
- fedora 44: iproute 6.17.0-2.fc44 ยท GPL-2.0-or-later AND NIST-PD
- nixos 26.05: iproute2 7.0.0
- nixpkgs unstable: iproute2 7.2.0
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- ubuntu jammy: iproute2 5.15.0-1ubuntu2 ยท GPL-2.0-only
- ubuntu jammy: iproute2 5.15.0-1ubuntu2.2 ยท GPL-2.0-only
- ubuntu noble: iproute2 6.1.0-1ubuntu6 ยท GPL-2.0-only
- ubuntu noble: iproute2 6.1.0-1ubuntu6.4 ยท GPL-2.0-only
- ubuntu questing: iproute2 6.16.0-1ubuntu2
- ubuntu questing: iproute2 6.16.0-1ubuntu2.1 ยท GPL-2.0-only
- ubuntu questing: iproute2 6.16.0-1ubuntu2.2
- ubuntu resolute: iproute2 6.19.0-1ubuntu1 ยท GPL-2.0-only
- ubuntu resolute: iproute2 6.19.0-1ubuntu1.1 ยท GPL-2.0-only
- ubuntu stonking: iproute2 7.2.0-1ubuntu1 ยท GPL-2.0-only
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms