summaryrefslogtreecommitdiffstats
path: root/include/net/devlink.h
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2020-09-29 11:15:50 +0300
committerDavid S. Miller <davem@davemloft.net>2020-09-30 18:01:26 -0700
commit5b88823bfe0875b327cc041017b5dcbec9dcbcc8 (patch)
treef2200fe9d945c0969fdc67dd9d7103769e939b15 /include/net/devlink.h
parent8333c1c4ee61c873bdb5327dba858f58de2a98d8 (diff)
devlink: Add a tracepoint for trap reports
Add a tracepoint for trap reports so that drop monitor could register its probe on it. Use trace_devlink_trap_report_enabled() to avoid wasting cycles setting the trap metadata if the tracepoint is not enabled. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/devlink.h')
-rw-r--r--include/net/devlink.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 7339bf9ba6b4..1014294ba6a0 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -625,6 +625,20 @@ struct devlink_health_reporter_ops {
};
/**
+ * struct devlink_trap_metadata - Packet trap metadata.
+ * @trap_name: Trap name.
+ * @trap_group_name: Trap group name.
+ * @input_dev: Input netdevice.
+ * @fa_cookie: Flow action user cookie.
+ */
+struct devlink_trap_metadata {
+ const char *trap_name;
+ const char *trap_group_name;
+ struct net_device *input_dev;
+ const struct flow_action_cookie *fa_cookie;
+};
+
+/**
* struct devlink_trap_policer - Immutable packet trap policer attributes.
* @id: Policer identifier.
* @init_rate: Initial rate in packets / sec.