]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
devlink: Add 'control' trap type
authorIdo Schimmel <idosch@mellanox.com>
Sun, 7 Jun 2020 08:36:46 +0000 (11:36 +0300)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 11 Jun 2020 16:51:10 +0000 (09:51 -0700)
This type is used for traps that trap control packets such as ARP
request and IGMP query to the CPU.

Example:

# devlink -jp trap show netdevsim/netdevsim10 trap igmp_v1_report
{
    "trap": {
        "netdevsim/netdevsim10": [ {
                "name": "igmp_v1_report",
                "type": "control",
                "generic": true,
                "action": "trap",
                "group": "mc_snooping"
            } ]
    }
}

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
devlink/devlink.c

index ce2e46766617cd2fc62b7160c47af4d54d9624cc..913feeb6db6d191dbbfdc70bf1ef705bdda2022a 100644 (file)
@@ -7080,6 +7080,8 @@ static const char *trap_type_name(uint8_t type)
                return "drop";
        case DEVLINK_TRAP_TYPE_EXCEPTION:
                return "exception";
+       case DEVLINK_TRAP_TYPE_CONTROL:
+               return "control";
        default:
                return "<unknown type>";
        }