]> git.proxmox.com Git - mirror_iproute2.git/commit
devlink: Add devlink trap policer set and show commands
authorIdo Schimmel <idosch@mellanox.com>
Tue, 31 Mar 2020 08:42:51 +0000 (11:42 +0300)
committerDavid Ahern <dsahern@gmail.com>
Tue, 31 Mar 2020 23:24:35 +0000 (23:24 +0000)
commita66af5569337b01a1aa11f929cf50ac04cae359e
tree54c097a22a6dc74f906c1f99b2b9d503885af442
parentce9191ffee31d440591bf49ef530b80ee9975dfb
devlink: Add devlink trap policer set and show commands

The trap policer set command allows the user to set the parameters of
the packet trap policer, such as rate and burst size. Example:

# devlink trap policer set netdevsim/netdevsim10 policer 1 rate 1000 burst 32

The trap policer show command allows the user to get the current
parameters of an individual policer or a dump of all policers in case
one is not specified. When '-s' is specified the policer's statistics
are shown. Example:

# devlink -jps trap policer show netdevsim/netdevsim10 policer 1
{
    "trap_policer": {
        "netdevsim/netdevsim10": [ {
                "policer": 1,
                "rate": 1000,
                "burst": 32,
                "stats": {
                    "rx": {
                        "dropped": 53
                    }
                }
            } ]
    }
}

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
devlink/devlink.c
man/man8/devlink-monitor.8
man/man8/devlink-trap.8