diff mbox series

[SRU,F:linux-bluefield,v2,1/5] UBUNTU: SAUCE: net/sched: Provide act to offload action

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

Commit Message

William Tu April 3, 2023, 9:58 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>
---
v1->v2
- talked to Paul and he explained that this patch is to provide
interface for OFED and is an alternative to bring lots and lots
of upstream patches. This isn't used by upstream driver and so is
unused also in bluefield kernel.
External modules such as OFED can use it.
---
 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 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;