Commit 5eb18a2b authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

devlink: Add ACL control packet traps

Add packet traps for packets that are sampled / trapped by ACLs, so that
capable drivers could register them with devlink. Add documentation for
every added packet trap and packet trap group.
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d77cfd16
...@@ -397,6 +397,14 @@ be added to the following table: ...@@ -397,6 +397,14 @@ be added to the following table:
- ``control`` - ``control``
- Traps PTP general messages (Announce, Follow_Up, Delay_Resp, - Traps PTP general messages (Announce, Follow_Up, Delay_Resp,
Pdelay_Resp_Follow_Up, management and signaling) Pdelay_Resp_Follow_Up, management and signaling)
* - ``flow_action_sample``
- ``control``
- Traps packets sampled during processing of flow action sample (e.g., via
tc's sample action)
* - ``flow_action_trap``
- ``control``
- Traps packets logged during processing of flow action trap (e.g., via
tc's trap action)
Driver-specific Packet Traps Driver-specific Packet Traps
============================ ============================
...@@ -487,6 +495,12 @@ narrow. The description of these groups must be added to the following table: ...@@ -487,6 +495,12 @@ narrow. The description of these groups must be added to the following table:
* - ``ptp_general`` * - ``ptp_general``
- Contains packet traps for PTP general messages (Announce, Follow_Up, - Contains packet traps for PTP general messages (Announce, Follow_Up,
Delay_Resp, Pdelay_Resp_Follow_Up, management and signaling) Delay_Resp, Pdelay_Resp_Follow_Up, management and signaling)
* - ``acl_sample``
- Contains packet traps for packets that were sampled by the device during
ACL processing
* - ``acl_trap``
- Contains packet traps for packets that were trapped (logged) by the
device during ACL processing
Packet Trap Policers Packet Trap Policers
==================== ====================
......
...@@ -687,6 +687,8 @@ enum devlink_trap_generic_id { ...@@ -687,6 +687,8 @@ enum devlink_trap_generic_id {
DEVLINK_TRAP_GENERIC_ID_IPV6_ROUTER_ALERT, DEVLINK_TRAP_GENERIC_ID_IPV6_ROUTER_ALERT,
DEVLINK_TRAP_GENERIC_ID_PTP_EVENT, DEVLINK_TRAP_GENERIC_ID_PTP_EVENT,
DEVLINK_TRAP_GENERIC_ID_PTP_GENERAL, DEVLINK_TRAP_GENERIC_ID_PTP_GENERAL,
DEVLINK_TRAP_GENERIC_ID_FLOW_ACTION_SAMPLE,
DEVLINK_TRAP_GENERIC_ID_FLOW_ACTION_TRAP,
/* Add new generic trap IDs above */ /* Add new generic trap IDs above */
__DEVLINK_TRAP_GENERIC_ID_MAX, __DEVLINK_TRAP_GENERIC_ID_MAX,
...@@ -719,6 +721,8 @@ enum devlink_trap_group_generic_id { ...@@ -719,6 +721,8 @@ enum devlink_trap_group_generic_id {
DEVLINK_TRAP_GROUP_GENERIC_ID_IPV6, DEVLINK_TRAP_GROUP_GENERIC_ID_IPV6,
DEVLINK_TRAP_GROUP_GENERIC_ID_PTP_EVENT, DEVLINK_TRAP_GROUP_GENERIC_ID_PTP_EVENT,
DEVLINK_TRAP_GROUP_GENERIC_ID_PTP_GENERAL, DEVLINK_TRAP_GROUP_GENERIC_ID_PTP_GENERAL,
DEVLINK_TRAP_GROUP_GENERIC_ID_ACL_SAMPLE,
DEVLINK_TRAP_GROUP_GENERIC_ID_ACL_TRAP,
/* Add new generic trap group IDs above */ /* Add new generic trap group IDs above */
__DEVLINK_TRAP_GROUP_GENERIC_ID_MAX, __DEVLINK_TRAP_GROUP_GENERIC_ID_MAX,
...@@ -868,6 +872,10 @@ enum devlink_trap_group_generic_id { ...@@ -868,6 +872,10 @@ enum devlink_trap_group_generic_id {
"ptp_event" "ptp_event"
#define DEVLINK_TRAP_GENERIC_NAME_PTP_GENERAL \ #define DEVLINK_TRAP_GENERIC_NAME_PTP_GENERAL \
"ptp_general" "ptp_general"
#define DEVLINK_TRAP_GENERIC_NAME_FLOW_ACTION_SAMPLE \
"flow_action_sample"
#define DEVLINK_TRAP_GENERIC_NAME_FLOW_ACTION_TRAP \
"flow_action_trap"
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_L2_DROPS \ #define DEVLINK_TRAP_GROUP_GENERIC_NAME_L2_DROPS \
"l2_drops" "l2_drops"
...@@ -913,6 +921,10 @@ enum devlink_trap_group_generic_id { ...@@ -913,6 +921,10 @@ enum devlink_trap_group_generic_id {
"ptp_event" "ptp_event"
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_PTP_GENERAL \ #define DEVLINK_TRAP_GROUP_GENERIC_NAME_PTP_GENERAL \
"ptp_general" "ptp_general"
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_ACL_SAMPLE \
"acl_sample"
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_ACL_TRAP \
"acl_trap"
#define DEVLINK_TRAP_GENERIC(_type, _init_action, _id, _group_id, \ #define DEVLINK_TRAP_GENERIC(_type, _init_action, _id, _group_id, \
_metadata_cap) \ _metadata_cap) \
......
...@@ -8537,6 +8537,8 @@ static const struct devlink_trap devlink_trap_generic[] = { ...@@ -8537,6 +8537,8 @@ static const struct devlink_trap devlink_trap_generic[] = {
DEVLINK_TRAP(IPV6_ROUTER_ALERT, CONTROL), DEVLINK_TRAP(IPV6_ROUTER_ALERT, CONTROL),
DEVLINK_TRAP(PTP_EVENT, CONTROL), DEVLINK_TRAP(PTP_EVENT, CONTROL),
DEVLINK_TRAP(PTP_GENERAL, CONTROL), DEVLINK_TRAP(PTP_GENERAL, CONTROL),
DEVLINK_TRAP(FLOW_ACTION_SAMPLE, CONTROL),
DEVLINK_TRAP(FLOW_ACTION_TRAP, CONTROL),
}; };
#define DEVLINK_TRAP_GROUP(_id) \ #define DEVLINK_TRAP_GROUP(_id) \
...@@ -8568,6 +8570,8 @@ static const struct devlink_trap_group devlink_trap_group_generic[] = { ...@@ -8568,6 +8570,8 @@ static const struct devlink_trap_group devlink_trap_group_generic[] = {
DEVLINK_TRAP_GROUP(IPV6), DEVLINK_TRAP_GROUP(IPV6),
DEVLINK_TRAP_GROUP(PTP_EVENT), DEVLINK_TRAP_GROUP(PTP_EVENT),
DEVLINK_TRAP_GROUP(PTP_GENERAL), DEVLINK_TRAP_GROUP(PTP_GENERAL),
DEVLINK_TRAP_GROUP(ACL_SAMPLE),
DEVLINK_TRAP_GROUP(ACL_TRAP),
}; };
static int devlink_trap_generic_verify(const struct devlink_trap *trap) static int devlink_trap_generic_verify(const struct devlink_trap *trap)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment