Skip to content

Commit 08e335f

Browse files
amitcohen1davem330
authored andcommitted
devlink: Add early_drop trap
Add the packet trap that can report packets that were ECN marked due to RED AQM. Signed-off-by: Amit Cohen <amitc@mellanox.com> Signed-off-by: Petr Machata <petrm@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 80fbbb1 commit 08e335f

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,10 @@ be added to the following table:
405405
- ``control``
406406
- Traps packets logged during processing of flow action trap (e.g., via
407407
tc's trap action)
408+
* - ``early_drop``
409+
- ``drop``
410+
- Traps packets dropped due to the RED (Random Early Detection) algorithm
411+
(i.e., early drops)
408412

409413
Driver-specific Packet Traps
410414
============================

‎include/net/devlink.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@ enum devlink_trap_generic_id {
703703
DEVLINK_TRAP_GENERIC_ID_PTP_GENERAL,
704704
DEVLINK_TRAP_GENERIC_ID_FLOW_ACTION_SAMPLE,
705705
DEVLINK_TRAP_GENERIC_ID_FLOW_ACTION_TRAP,
706+
DEVLINK_TRAP_GENERIC_ID_EARLY_DROP,
706707

707708
/* Add new generic trap IDs above */
708709
__DEVLINK_TRAP_GENERIC_ID_MAX,
@@ -891,6 +892,8 @@ enum devlink_trap_group_generic_id {
891892
"flow_action_sample"
892893
#define DEVLINK_TRAP_GENERIC_NAME_FLOW_ACTION_TRAP \
893894
"flow_action_trap"
895+
#define DEVLINK_TRAP_GENERIC_NAME_EARLY_DROP \
896+
"early_drop"
894897

895898
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_L2_DROPS \
896899
"l2_drops"

‎net/core/devlink.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8801,6 +8801,7 @@ static const struct devlink_trap devlink_trap_generic[] = {
88018801
DEVLINK_TRAP(PTP_GENERAL, CONTROL),
88028802
DEVLINK_TRAP(FLOW_ACTION_SAMPLE, CONTROL),
88038803
DEVLINK_TRAP(FLOW_ACTION_TRAP, CONTROL),
8804+
DEVLINK_TRAP(EARLY_DROP, DROP),
88048805
};
88058806

88068807
#define DEVLINK_TRAP_GROUP(_id) \

0 commit comments

Comments
 (0)