[SRU][F:linux-bluefield][PATCH 9/9] net: flow_offload: Add original direction flag to ct_metadata

Roi Dayan roid at nvidia.com
Tue Apr 6 17:52:09 UTC 2021


From: Paul Blakey <paulb at nvidia.com>

BugLink: https://bugs.launchpad.net/ubuntu/+source/linux-bluefield/+bug/1922682

Give offloading drivers the direction of the offloaded ct flow,
this will be used for matches on direction (ct_state +/-rpl).

Signed-off-by: Paul Blakey <paulb at nvidia.com>
Reviewed-by: Jiri Pirko <jiri at nvidia.com>
Signed-off-by: Jakub Kicinski <kuba at kernel.org>
(cherry picked from commit 941eff5aea5d4371fb8a496a66e29aa8fc7a0c23)
Signed-off-by: Roi Dayan <roid at nvidia.com>
---
 include/net/flow_offload.h | 1 +
 net/sched/act_ct.c         | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h
index fcc7a4e2a25d..4f442ab26689 100644
--- a/include/net/flow_offload.h
+++ b/include/net/flow_offload.h
@@ -211,6 +211,7 @@ struct flow_action_entry {
 			unsigned long cookie;
 			u32 mark;
 			u32 labels[4];
+			bool orig_dir;
 		} ct_metadata;
 		struct {				/* FLOW_ACTION_MPLS_PUSH */
 			u32		label;
diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
index fe132943eac2..4627bb7bdfa7 100644
--- a/net/sched/act_ct.c
+++ b/net/sched/act_ct.c
@@ -186,6 +186,7 @@ static void tcf_ct_flow_table_add_action_meta(struct nf_conn *ct,
 					     IP_CT_ESTABLISHED_REPLY;
 	/* aligns with the CT reference on the SKB nf_ct_set */
 	entry->ct_metadata.cookie = (unsigned long)ct | ctinfo;
+	entry->ct_metadata.orig_dir = dir == IP_CT_DIR_ORIGINAL;
 
 	act_ct_labels = entry->ct_metadata.labels;
 	ct_labels = nf_ct_labels_find(ct);
-- 
2.26.2




More information about the kernel-team mailing list