DEVLINK-TRAP(8)
๐ DEVLINK-TRAP(8) ๐
โจ NAME โจ
okay so devlink-trap is the manual page for devlink trap configuration ๐ it's how you poke at packet traps on your devices, bestie ๐ง
๐ SYNOPSIS ๐
devlink [ OPTIONS ] trap { COMMAND | help }
OPTIONS := { -v[erbose] | -s[tatistics] }
devlink trap show [ DEV trap TRAP ]
devlink trap set DEV trap TRAP [ action { trap | drop | mirror } ]
devlink trap group show [ DEV group GROUP ]
devlink trap group set DEV group GROUP [ action { trap | drop | mirror } ] [ policer POLICER ] [ nopolicer ]
devlink trap policer set DEV policer POLICER [ rate RATE ] [ burst BURST ]
devlink trap help
๐ฆ DESCRIPTION ๐ฆ
๐ธ devlink trap show - display available packet traps and their attributes
DEV - tells it which devlink device to show packet traps from. Leave this out and you get every packet trap on every device, periodt ๐
trap TRAP - picks out one specific packet trap. This only works if you also name a devlink device ๐ซถ
๐ฅ devlink trap set - set attributes of a packet trap
DEV - the devlink device that owns the packet trap ๐
trap TRAP - the packet trap you want to change โจ
action { trap | drop | mirror } - the packet trap action ๐
trap- the one and only copy of the packet goes up to the CPU ๐ซถdrop- the underlying device drops the packet and nothing gets sent to the CPU ๐ญmirror- the underlying device forwards the packet and a copy also gets sent to the CPU ๐ฆ
๐ devlink trap group show - display available packet trap groups and their attributes
DEV - the devlink device to show packet trap groups from. Skip it and you get all packet trap groups from all devices ๐ง
group GROUP - picks out one specific packet trap group. Only works if you also name a devlink device ๐
๐ devlink trap group set - set attributes of a packet trap group
DEV - the devlink device that owns the packet trap group ๐
group GROUP - the packet trap group you want to change ๐
action { trap | drop | mirror } - the packet trap action. It gets applied to every packet trap in the group, but the actions of non-drop traps can't be changed, so those get skipped ๐
policer POLICER - the packet trap policer you want to attach to this group. Set it to "0" and whatever policer is currently attached gets unbound ๐ธ
nopolicer - unbinds the packet trap policer from the packet trap group ๐
โญ devlink trap policer set - set attributes of packet trap policer
DEV - the devlink device that owns the packet trap policer ๐
policer POLICER - the packet trap policer you want to change โจ
rate RATE - the packet trap policer rate, in packets per second ๐ซง
burst BURST - the packet trap policer burst size, in packets ๐
๐ EXAMPLES ๐
Here's how it looks in action, bestie ๐ง
devlink trap show
List available packet traps. ๐
devlink trap group show
List available packet trap groups. ๐
devlink -vs trap show pci/0000:01:00.0 trap source_mac_is_multicast
Show attributes and statistics of a specific packet trap. โจ
devlink -s trap group show pci/0000:01:00.0 group l2_drops
Show attributes and statistics of a specific packet trap group. ๐ฆ
devlink trap set pci/0000:01:00.0 trap source_mac_is_multicast action trap
Set the action of a specific packet trap to 'trap'. ๐ฅ
devlink trap policer show
List available packet trap policers. ๐
devlink -s trap policer show pci/0000:01:00.0 policer 1
Show attributes and statistics of a specific packet trap policer. ๐
devlink trap policer set pci/0000:01:00.0 policer 1 rate 1000 burst 128
Set the rate and burst size of a specific packet trap policer. ๐
๐ธ SEE ALSO ๐ธ
devlink(8), devlink-dev(8), devlink-monitor(8),
๐ซถ AUTHOR ๐ซถ
Ido Schimmel <idosch@mellanox.com>
bestie, you're literally a devlink-trap pro now ๐๐โจ this page came from iproute2, last updated 2 August 2019, so it's a little vintage but still iconic ๐๐
๐ฆ 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