{
    "content": [
        {
            "type": "text",
            "text": "# devlink-trap(8) (man)\n\n**Summary:** devlink-trap - devlink trap configuration\n\n**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 ]\n\n## Examples\n\n- `devlink trap show`\n- `List available packet traps.`\n- `devlink trap group show`\n- `List available packet trap groups.`\n- `devlink -vs trap show pci/0000:01:00.0 trap sourcemacismulticast`\n- `Show attributes and statistics of a specific packet trap.`\n- `devlink -s trap group show pci/0000:01:00.0 group l2drops`\n- `Show attributes and statistics of a specific packet trap group.`\n- `devlink trap set pci/0000:01:00.0 trap sourcemacismulticast action trap`\n- `Set the action of a specific packet trap to 'trap'.`\n- `devlink trap policer show`\n- `List available packet trap policers.`\n- `devlink -s trap policer show pci/0000:01:00.0 policer 1`\n- `Show attributes and statistics of a specific packet trap policer.`\n- `devlink trap policer set pci/0000:01:00.0 policer 1 rate 1000 burst 128`\n- `Set the rate and burst size of a specific packet trap policer.`\n\n## See Also\n\n- devlink(8)\n- devlink-dev(8)\n- devlink-monitor(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (16 lines) — 1 subsections\n  - devlink trap help (1 lines)\n- **DESCRIPTION** (1 lines) — 6 subsections\n  - devlink trap show - display available packet traps and their (8 lines)\n  - devlink trap set - set attributes of a packet trap (18 lines)\n  - devlink trap group show - display available packet trap grou (8 lines)\n  - devlink trap group set - set attributes of a packet trap gro (16 lines)\n  - nopolicer (3 lines)\n  - devlink trap policer set - set attributes of packet trap pol (12 lines)\n- **EXAMPLES** (25 lines)\n- **SEE ALSO** (3 lines)\n- **AUTHOR** (5 lines)\n\n## Full Content\n\n### NAME\n\ndevlink-trap - devlink trap configuration\n\n### SYNOPSIS\n\ndevlink [ 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\n#### devlink trap help\n\n### DESCRIPTION\n\n#### devlink trap show - display available packet traps and their attributes\n\nDEV - 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#### devlink trap set - set attributes of a packet trap\n\nDEV - 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#### devlink trap group show - display available packet trap groups and their attributes\n\nDEV - 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#### devlink trap group set - set attributes of a packet trap group\n\nDEV - 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#### nopolicer\n\nUnbind packet trap policer from the packet trap group.\n\n#### devlink trap policer set - set attributes of packet trap policer\n\nDEV - 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\n\ndevlink 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### SEE ALSO\n\ndevlink(8), devlink-dev(8), devlink-monitor(8),\n\n### AUTHOR\n\nIdo Schimmel <idosch@mellanox.com>\n\n\n\niproute2                                    2 August 2019                            DEVLINK-TRAP(8)\n\n"
        }
    ],
    "structuredContent": {
        "command": "devlink-trap",
        "section": "8",
        "mode": "man",
        "summary": "devlink-trap - devlink trap configuration",
        "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 ]",
        "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"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 16,
                "subsections": [
                    {
                        "name": "devlink trap help",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 1,
                "subsections": [
                    {
                        "name": "devlink trap show - display available packet traps and their attributes",
                        "lines": 8
                    },
                    {
                        "name": "devlink trap set - set attributes of a packet trap",
                        "lines": 18
                    },
                    {
                        "name": "devlink trap group show - display available packet trap groups and their attributes",
                        "lines": 8
                    },
                    {
                        "name": "devlink trap group set - set attributes of a packet trap group",
                        "lines": 16
                    },
                    {
                        "name": "nopolicer",
                        "lines": 3
                    },
                    {
                        "name": "devlink trap policer set - set attributes of packet trap policer",
                        "lines": 12
                    }
                ]
            },
            {
                "name": "EXAMPLES",
                "lines": 25,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}