summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorOleksandr Mazur <oleksandr.mazur@plvision.eu>2021-06-14 16:01:12 +0300
committerDavid S. Miller <davem@davemloft.net>2021-06-14 23:04:25 +0300
commitddee9dbc3d7aec1cd9fdcc671db2dd0016fd0f3d (patch)
tree96530a832ce468547c348bc9f8dfa3a04a441a0b /include
parentea99750e401972c896d2212ea9244d903b8fbf73 (diff)
downloadlinux-ddee9dbc3d7aec1cd9fdcc671db2dd0016fd0f3d.tar.xz
net: core: devlink: add dropped stats traps field
Whenever query statistics is issued for trap, devlink subsystem would also fill-in statistics 'dropped' field. This field indicates the number of packets HW dropped and failed to report to the device driver, and thus - to the devlink subsystem itself. In case if device driver didn't register callback for hard drop statistics querying, 'dropped' field will be omitted and not filled. Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/devlink.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h
index eb045f1b5d1d..57b738b78073 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -1348,6 +1348,16 @@ struct devlink_ops {
enum devlink_trap_action action,
struct netlink_ext_ack *extack);
/**
+ * @trap_drop_counter_get: Trap drop counter get function.
+ *
+ * Should be used by device drivers to report number of packets
+ * that have been dropped, and cannot be passed to the devlink
+ * subsystem by the underlying device.
+ */
+ int (*trap_drop_counter_get)(struct devlink *devlink,
+ const struct devlink_trap *trap,
+ u64 *p_drops);
+ /**
* @trap_policer_init: Trap policer initialization function.
*
* Should be used by device drivers to initialize the trap policer in