diff mbox series

[SRU,J:linux-bluefield,v3,01/11] UBUNTU: SAUCE: net/sched: Provide act to offload action

Message ID 20230606230120.407292-2-witu@nvidia.com
State New
Headers show
Series Support hardware miss to tc action | expand

Commit Message

William Tu June 6, 2023, 11:01 p.m. UTC
From: Paul Blakey <paulb@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@nvidia.com>
Signed-off-by: William Tu <witu@nvidia.com>
Reviewed-by: William Tu <witu@nvidia.com>
---
 include/net/flow_offload.h | 1 +
 net/sched/cls_api.c        | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h
index 7a2b0223a02c..5cc43cf3e075 100644
--- a/include/net/flow_offload.h
+++ b/include/net/flow_offload.h
@@ -198,6 +198,7 @@  void flow_action_cookie_destroy(struct flow_action_cookie *cookie);
 struct flow_action_entry {
 	enum flow_action_id		id;
 	enum flow_action_hw_stats	hw_stats;
+	void				*act;
 	action_destr			destructor;
 	void				*destructor_priv;
 	union {
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 62ce6981942b..9574bf9037b9 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -3571,6 +3571,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);
 		err = tcf_act_get_cookie(entry, act);
 		if (err)