[SRU][F:linux-bluefield][PATCH v1 1/5] net/sched: Provide act to offload action

William Tu witu at nvidia.com
Thu Mar 23 19:15:46 UTC 2023


From: Paul Blakey <paulb at nvidia.com>

BugLink: https://bugs.launchpad.net/bugs/2012571

To support act stats, provide the action instance
in flow offload operation. This instance will be
saved by drivers, and used to directly update the
stats on.

Signed-off-by: Paul Blakey <paulb at nvidia.com>
Reviewed-by: William Tu <witu at nvidia.com>
---
 include/net/flow_offload.h | 1 +
 net/sched/cls_api.c        | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h
index e9686f7e5cdf..d9e2e5d905ee 100644
--- a/include/net/flow_offload.h
+++ b/include/net/flow_offload.h
@@ -166,6 +166,7 @@ typedef void (*action_destr)(void *priv);
 
 struct flow_action_entry {
 	enum flow_action_id		id;
+	void				*act;
 	action_destr			destructor;
 	void				*destructor_priv;
 	union {
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 5d933c9e9cc0..384a4d815849 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -3518,6 +3518,7 @@ int tc_setup_flow_action(struct flow_action *flow_action,
 		struct flow_action_entry *entry;
 
 		entry = &flow_action->entries[j];
+		entry->act = act;
 		spin_lock_bh(&act->tcfa_lock);
 		if (is_tcf_gact_ok(act)) {
 			entry->id = FLOW_ACTION_ACCEPT;
-- 
2.37.1 (Apple Git-137.1)




More information about the kernel-team mailing list