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 ๐Ÿฆ‹

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 ๐Ÿซถ

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 ๐Ÿฆ‹

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 ๐Ÿ’–

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 ๐Ÿ’…

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