diff mbox series

[v3,net-next,1/3] flow_offload: add a cookie to flow_action_entry

Message ID 5c11a13f-2fd9-8b5f-7f52-9652a6dffdc7@solarflare.com
State Changes Requested
Delegated to: David Miller
Headers show
Series flow_offload: Re-add per-action statistics | expand

Commit Message

Edward Cree May 22, 2019, 9:38 p.m. UTC
Populated with the address of the struct tc_action from which it was made.
Required for support of shared counters (and possibly other shared per-
 action entities in future).

Signed-off-by: Edward Cree <ecree@solarflare.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 a2df99f9b196..d5f4cc0b45d4 100644
--- a/include/net/flow_offload.h
+++ b/include/net/flow_offload.h
@@ -139,6 +139,7 @@  enum flow_action_mangle_base {
 
 struct flow_action_entry {
 	enum flow_action_id		id;
+	unsigned long			cookie;
 	union {
 		u32			chain_index;	/* FLOW_ACTION_GOTO */
 		struct net_device	*dev;		/* FLOW_ACTION_REDIRECT */
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index d4699156974a..5411cec17af5 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -3195,6 +3195,7 @@  int tc_setup_flow_action(struct flow_action *flow_action,
 		struct flow_action_entry *entry;
 
 		entry = &flow_action->entries[j];
+		entry->cookie = (unsigned long)act;
 		if (is_tcf_gact_ok(act)) {
 			entry->id = FLOW_ACTION_ACCEPT;
 		} else if (is_tcf_gact_shot(act)) {