]> git.proxmox.com Git - mirror_iproute2.git/commit
devlink: Add devlink trap set and show commands
authorIdo Schimmel <idosch@mellanox.com>
Tue, 13 Aug 2019 08:31:41 +0000 (11:31 +0300)
committerDavid Ahern <dsahern@gmail.com>
Sun, 18 Aug 2019 18:49:27 +0000 (11:49 -0700)
commitef12d6dafaeb9e3fe6dd1c6ebadc01af9e7f476c
treee88bf0cbea68f70c6fee0551dbe5999362f466e5
parentb83220db3767eb8bcaa6d4c286947a9cbd0472fd
devlink: Add devlink trap set and show commands

The trap set command allows the user to set the action of an individual
trap. Example:

# devlink trap set netdevsim/netdevsim10 trap blackhole_route action trap

The trap show command allows the user to get the current status of an
individual trap or a dump of all traps in case one is not specified.
When '-s' is specified the trap's statistics are shown. When '-v' is
specified the metadata types the trap can provide are shown. Example:

# devlink -jvps trap show netdevsim/netdevsim10 trap blackhole_route
{
    "trap": {
        "netdevsim/netdevsim10": [ {
                "name": "blackhole_route",
                "type": "drop",
                "generic": true,
                "action": "trap",
                "group": "l3_drops",
                "metadata": [ "input_port" ],
                "stats": {
                    "rx": {
                        "bytes": 0,
                        "packets": 0
                    }
                }
            } ]
    }
}

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
devlink/devlink.c