diff mbox series

[iproute2,1/2] devlink: Add 'control' trap type

Message ID 20200607083647.2022510-2-idosch@idosch.org
State Accepted
Delegated to: stephen hemminger
Headers show
Series Two devlink-trap enhancements | expand

Commit Message

Ido Schimmel June 7, 2020, 8:36 a.m. UTC
From: Ido Schimmel <idosch@mellanox.com>

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>
---
 devlink/devlink.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/devlink/devlink.c b/devlink/devlink.c
index 507972c360a7..f06e7c2a0a29 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -7073,6 +7073,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>";
 	}