]> git.proxmox.com Git - mirror_iproute2.git/commit
devlink: Add ability to bind policer to trap group
authorIdo Schimmel <idosch@mellanox.com>
Tue, 31 Mar 2020 08:42:52 +0000 (11:42 +0300)
committerDavid Ahern <dsahern@gmail.com>
Tue, 31 Mar 2020 23:25:07 +0000 (23:25 +0000)
commit02a2a6683ff2df271c0f58e57a7fe6ff979c6de5
tree244cc03a82c9573b2087104b4e96eb1a3a5308a0
parenta66af5569337b01a1aa11f929cf50ac04cae359e
devlink: Add ability to bind policer to trap group

Add ability to associate a policer with a trap group. The policer can be
unbound by using the 'nopolicer' keyword. In which case, the value
encoded in the 'DEVLINK_ATTR_TRAP_POLICER_ID' attribute will be '0'.
This is consistent with ip-link 'nomaster' keyword and the 'IFLA_MASTER'
attribute.

Example:

# devlink trap group set netdevsim/netdevsim10 group l3_drops policer 2
# devlink -jp trap group show netdevsim/netdevsim10 group l3_drops
{
    "trap_group": {
        "netdevsim/netdevsim10": [ {
                "name": "l3_drops",
                "generic": true,
                "policer": 2
            } ]
    }
}

# devlink trap group set netdevsim/netdevsim10 group l3_drops nopolicer
# devlink -jp trap group show netdevsim/netdevsim10 group l3_drops
{
    "trap_group": {
        "netdevsim/netdevsim10": [ {
                "name": "l3_drops",
                "generic": true
            } ]
    }
}

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-trap.8