{
    "content": [
        {
            "type": "text",
            "text": "# devlink-trap (man)\n\n## NAME\n\ndevlink-trap - devlink trap configuration\n\n## SYNOPSIS\n\ndevlink [ 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## Sections\n\n- **NAME**\n- **SYNOPSIS** (1 subsections)\n- **DESCRIPTION** (6 subsections)\n- **EXAMPLES**\n- **SEE ALSO**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "devlink-trap",
        "section": "",
        "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 ]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "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": 3,
                "subsections": []
            }
        ],
        "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\niproute2                                    2 August 2019                            DEVLINK-TRAP(8)",
                "subsections": []
            }
        }
    }
}