devlink: Add early_drop trap
authorAmit Cohen <amitc@mellanox.com>
Mon, 3 Aug 2020 16:11:33 +0000 (19:11 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Aug 2020 01:06:46 +0000 (18:06 -0700)
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>
Documentation/networking/devlink/devlink-trap.rst
include/net/devlink.h
net/core/devlink.c

index 2014307fbe63428d6751d83f59bb941190259aff..7a798352b45d19e0d4b456175852f844556cb13c 100644 (file)
@@ -405,6 +405,10 @@ be added to the following table:
      - ``control``
      - Traps packets logged during processing of flow action trap (e.g., via
        tc's trap action)
+   * - ``early_drop``
+     - ``drop``
+     - Traps packets dropped due to the RED (Random Early Detection) algorithm
+       (i.e., early drops)
 
 Driver-specific Packet Traps
 ============================
index 0606967cb501072d57afa1116086dff4f274b44a..fd3ae07604925f06b010effd0375aabec07ab50e 100644 (file)
@@ -703,6 +703,7 @@ enum devlink_trap_generic_id {
        DEVLINK_TRAP_GENERIC_ID_PTP_GENERAL,
        DEVLINK_TRAP_GENERIC_ID_FLOW_ACTION_SAMPLE,
        DEVLINK_TRAP_GENERIC_ID_FLOW_ACTION_TRAP,
+       DEVLINK_TRAP_GENERIC_ID_EARLY_DROP,
 
        /* Add new generic trap IDs above */
        __DEVLINK_TRAP_GENERIC_ID_MAX,
@@ -891,6 +892,8 @@ enum devlink_trap_group_generic_id {
        "flow_action_sample"
 #define DEVLINK_TRAP_GENERIC_NAME_FLOW_ACTION_TRAP \
        "flow_action_trap"
+#define DEVLINK_TRAP_GENERIC_NAME_EARLY_DROP \
+       "early_drop"
 
 #define DEVLINK_TRAP_GROUP_GENERIC_NAME_L2_DROPS \
        "l2_drops"
index 5fdebb7289e9e774808992437c39f778a2a589c7..bde4c29a30bcd063774b8cdbf4649f0af30337f8 100644 (file)
@@ -8801,6 +8801,7 @@ static const struct devlink_trap devlink_trap_generic[] = {
        DEVLINK_TRAP(PTP_GENERAL, CONTROL),
        DEVLINK_TRAP(FLOW_ACTION_SAMPLE, CONTROL),
        DEVLINK_TRAP(FLOW_ACTION_TRAP, CONTROL),
+       DEVLINK_TRAP(EARLY_DROP, DROP),
 };
 
 #define DEVLINK_TRAP_GROUP(_id)                                                      \