devlink: Create dedicated trap group for layer 3 exceptions

Packets that hit exceptions during layer 3 forwarding must be trapped to
the CPU for the control plane to function properly. Create a dedicated
group for them, so that user space could choose to assign a different
policer for them.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Ido Schimmel 2020-05-29 21:36:36 +03:00 committed by David S. Miller
parent af0a2482fa
commit 678eb199cc
3 changed files with 9 additions and 2 deletions

View File

@ -277,8 +277,11 @@ narrow. The description of these groups must be added to the following table:
- Contains packet traps for packets that were dropped by the device during - Contains packet traps for packets that were dropped by the device during
layer 2 forwarding (i.e., bridge) layer 2 forwarding (i.e., bridge)
* - ``l3_drops`` * - ``l3_drops``
- Contains packet traps for packets that were dropped by the device or hit - Contains packet traps for packets that were dropped by the device during
an exception (e.g., TTL error) during layer 3 forwarding layer 3 forwarding
* - ``l3_exceptions``
- Contains packet traps for packets that hit an exception (e.g., TTL
error) during layer 3 forwarding
* - ``buffer_drops`` * - ``buffer_drops``
- Contains packet traps for packets that were dropped by the device due to - Contains packet traps for packets that were dropped by the device due to
an enqueue decision an enqueue decision

View File

@ -657,6 +657,7 @@ enum devlink_trap_generic_id {
enum devlink_trap_group_generic_id { enum devlink_trap_group_generic_id {
DEVLINK_TRAP_GROUP_GENERIC_ID_L2_DROPS, DEVLINK_TRAP_GROUP_GENERIC_ID_L2_DROPS,
DEVLINK_TRAP_GROUP_GENERIC_ID_L3_DROPS, DEVLINK_TRAP_GROUP_GENERIC_ID_L3_DROPS,
DEVLINK_TRAP_GROUP_GENERIC_ID_L3_EXCEPTIONS,
DEVLINK_TRAP_GROUP_GENERIC_ID_BUFFER_DROPS, DEVLINK_TRAP_GROUP_GENERIC_ID_BUFFER_DROPS,
DEVLINK_TRAP_GROUP_GENERIC_ID_TUNNEL_DROPS, DEVLINK_TRAP_GROUP_GENERIC_ID_TUNNEL_DROPS,
DEVLINK_TRAP_GROUP_GENERIC_ID_ACL_DROPS, DEVLINK_TRAP_GROUP_GENERIC_ID_ACL_DROPS,
@ -730,6 +731,8 @@ enum devlink_trap_group_generic_id {
"l2_drops" "l2_drops"
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_L3_DROPS \ #define DEVLINK_TRAP_GROUP_GENERIC_NAME_L3_DROPS \
"l3_drops" "l3_drops"
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_L3_EXCEPTIONS \
"l3_exceptions"
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_BUFFER_DROPS \ #define DEVLINK_TRAP_GROUP_GENERIC_NAME_BUFFER_DROPS \
"buffer_drops" "buffer_drops"
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_TUNNEL_DROPS \ #define DEVLINK_TRAP_GROUP_GENERIC_NAME_TUNNEL_DROPS \

View File

@ -8505,6 +8505,7 @@ static const struct devlink_trap devlink_trap_generic[] = {
static const struct devlink_trap_group devlink_trap_group_generic[] = { static const struct devlink_trap_group devlink_trap_group_generic[] = {
DEVLINK_TRAP_GROUP(L2_DROPS), DEVLINK_TRAP_GROUP(L2_DROPS),
DEVLINK_TRAP_GROUP(L3_DROPS), DEVLINK_TRAP_GROUP(L3_DROPS),
DEVLINK_TRAP_GROUP(L3_EXCEPTIONS),
DEVLINK_TRAP_GROUP(BUFFER_DROPS), DEVLINK_TRAP_GROUP(BUFFER_DROPS),
DEVLINK_TRAP_GROUP(TUNNEL_DROPS), DEVLINK_TRAP_GROUP(TUNNEL_DROPS),
DEVLINK_TRAP_GROUP(ACL_DROPS), DEVLINK_TRAP_GROUP(ACL_DROPS),