Skip to content

Commit 678eb19

Browse files
idoschdavem330
authored andcommitted
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>
1 parent af0a248 commit 678eb19

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎Documentation/networking/devlink/devlink-trap.rst‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,11 @@ narrow. The description of these groups must be added to the following table:
277277
- Contains packet traps for packets that were dropped by the device during
278278
layer 2 forwarding (i.e., bridge)
279279
* - ``l3_drops``
280-
- Contains packet traps for packets that were dropped by the device or hit
281-
an exception (e.g., TTL error) during layer 3 forwarding
280+
- Contains packet traps for packets that were dropped by the device during
281+
layer 3 forwarding
282+
* - ``l3_exceptions``
283+
- Contains packet traps for packets that hit an exception (e.g., TTL
284+
error) during layer 3 forwarding
282285
* - ``buffer_drops``
283286
- Contains packet traps for packets that were dropped by the device due to
284287
an enqueue decision

‎include/net/devlink.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ enum devlink_trap_generic_id {
657657
enum devlink_trap_group_generic_id {
658658
DEVLINK_TRAP_GROUP_GENERIC_ID_L2_DROPS,
659659
DEVLINK_TRAP_GROUP_GENERIC_ID_L3_DROPS,
660+
DEVLINK_TRAP_GROUP_GENERIC_ID_L3_EXCEPTIONS,
660661
DEVLINK_TRAP_GROUP_GENERIC_ID_BUFFER_DROPS,
661662
DEVLINK_TRAP_GROUP_GENERIC_ID_TUNNEL_DROPS,
662663
DEVLINK_TRAP_GROUP_GENERIC_ID_ACL_DROPS,
@@ -730,6 +731,8 @@ enum devlink_trap_group_generic_id {
730731
"l2_drops"
731732
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_L3_DROPS \
732733
"l3_drops"
734+
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_L3_EXCEPTIONS \
735+
"l3_exceptions"
733736
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_BUFFER_DROPS \
734737
"buffer_drops"
735738
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_TUNNEL_DROPS \

‎net/core/devlink.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8505,6 +8505,7 @@ static const struct devlink_trap devlink_trap_generic[] = {
85058505
static const struct devlink_trap_group devlink_trap_group_generic[] = {
85068506
DEVLINK_TRAP_GROUP(L2_DROPS),
85078507
DEVLINK_TRAP_GROUP(L3_DROPS),
8508+
DEVLINK_TRAP_GROUP(L3_EXCEPTIONS),
85088509
DEVLINK_TRAP_GROUP(BUFFER_DROPS),
85098510
DEVLINK_TRAP_GROUP(TUNNEL_DROPS),
85108511
DEVLINK_TRAP_GROUP(ACL_DROPS),

0 commit comments

Comments
 (0)