{
    "mode": "man",
    "parameter": "devlink-trap",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/devlink-trap/8/json",
    "generated": "2026-05-30T07:07:48Z",
    "synopsis": "devlink [ OPTIONS ] trap { COMMAND | help }\nOPTIONS := { -v[erbose] | -s[tatistics] }\ndevlink trap show [ DEV trap TRAP ]\ndevlink trap set DEV trap TRAP [ action { trap | drop | mirror } ]\ndevlink trap group show [ DEV group GROUP ]\ndevlink trap group set DEV group GROUP [ action { trap | drop | mirror } ]\n[ policer POLICER ] [ nopolicer ]\ndevlink trap policer set DEV policer POLICER [ rate RATE ] [ burst BURST ]",
    "sections": {
        "NAME": {
            "content": "devlink-trap - devlink trap configuration\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "devlink [ OPTIONS ] trap { COMMAND | help }\n\n\nOPTIONS := { -v[erbose] | -s[tatistics] }\n\ndevlink trap show [ DEV trap TRAP ]\n\ndevlink trap set DEV trap TRAP [ action { trap | drop | mirror } ]\n\ndevlink trap group show [ DEV group GROUP ]\n\ndevlink trap group set DEV group GROUP [ action { trap | drop | mirror } ]\n[ policer POLICER ] [ nopolicer ]\n\ndevlink trap policer set DEV policer POLICER [ rate RATE ] [ burst BURST ]\n",
            "subsections": [
                {
                    "name": "devlink trap help",
                    "content": ""
                }
            ]
        },
        "DESCRIPTION": {
            "content": "",
            "subsections": [
                {
                    "name": "devlink trap show - display available packet traps and their attributes",
                    "content": "DEV - specifies the devlink device from which to show packet traps.  If this argument is\nomitted all packet traps of all devices are listed.\n\n\ntrap TRAP - specifies the packet trap.  Only applicable if a devlink device is also speci‐\nfied.\n\n"
                },
                {
                    "name": "devlink trap set - set attributes of a packet trap",
                    "content": "DEV - specifies the devlink device the packet trap belongs to.\n\n\ntrap TRAP - specifies the packet trap.\n\n\naction { trap | drop | mirror }\npacket trap action.\n\ntrap - the sole copy of the packet is sent to the CPU.\n\ndrop - the packet is dropped by the underlying device and a copy is not sent to the\nCPU.\n\nmirror - the packet is forwarded by the underlying device and a copy is sent to the\nCPU.\n\n"
                },
                {
                    "name": "devlink trap group show - display available packet trap groups and their attributes",
                    "content": "DEV - specifies the devlink device from which to show packet trap groups.  If this argument\nis omitted all packet trap groups of all devices are listed.\n\n\ngroup GROUP - specifies the packet trap group.  Only applicable if a devlink device is also\nspecified.\n\n"
                },
                {
                    "name": "devlink trap group set - set attributes of a packet trap group",
                    "content": "DEV - specifies the devlink device the packet trap group belongs to.\n\n\ngroup GROUP - specifies the packet trap group.\n\n\naction { trap | drop | mirror }\npacket trap action. The action is set for all the packet traps member in the trap\ngroup. The actions of non-drop traps cannot be changed and are thus skipped.\n\n\npolicer POLICER\npacket trap policer. The policer to bind to the packet trap group. A value of \"0\" will\nunbind the currently bound policer.\n\n"
                },
                {
                    "name": "nopolicer",
                    "content": "Unbind packet trap policer from the packet trap group.\n\n"
                },
                {
                    "name": "devlink trap policer set - set attributes of packet trap policer",
                    "content": "DEV - specifies the devlink device the packet trap policer belongs to.\n\n\npolicer POLICER - specifies the packet trap policer.\n\n\nrate RATE - packet trap policer rate in packets per second.\n\n\nburst BURST - packet trap policer burst size in packets.\n\n"
                }
            ]
        },
        "EXAMPLES": {
            "content": "devlink trap show\nList available packet traps.\n\ndevlink trap group show\nList available packet trap groups.\n\ndevlink -vs trap show pci/0000:01:00.0 trap sourcemacismulticast\nShow attributes and statistics of a specific packet trap.\n\ndevlink -s trap group show pci/0000:01:00.0 group l2drops\nShow attributes and statistics of a specific packet trap group.\n\ndevlink trap set pci/0000:01:00.0 trap sourcemacismulticast action trap\nSet the action of a specific packet trap to 'trap'.\n\ndevlink trap policer show\nList available packet trap policers.\n\ndevlink -s trap policer show pci/0000:01:00.0 policer 1\nShow attributes and statistics of a specific packet trap policer.\n\ndevlink trap policer set pci/0000:01:00.0 policer 1 rate 1000 burst 128\nSet the rate and burst size of a specific packet trap policer.\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "devlink(8), devlink-dev(8), devlink-monitor(8),\n\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Ido Schimmel <idosch@mellanox.com>\n\n\n\niproute2                                    2 August 2019                            DEVLINK-TRAP(8)",
            "subsections": []
        }
    },
    "summary": "devlink-trap - devlink trap configuration",
    "flags": [],
    "examples": [
        "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 sourcemacismulticast",
        "Show attributes and statistics of a specific packet trap.",
        "devlink -s trap group show pci/0000:01:00.0 group l2drops",
        "Show attributes and statistics of a specific packet trap group.",
        "devlink trap set pci/0000:01:00.0 trap sourcemacismulticast 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": [
        {
            "name": "devlink",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/devlink/8/json"
        },
        {
            "name": "devlink-dev",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/devlink-dev/8/json"
        },
        {
            "name": "devlink-monitor",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/devlink-monitor/8/json"
        }
    ]
}