patch 'net/nfp: fix TP flow action for UDP' has been queued to stable release 22.11.3

Xueming Li xuemingl at nvidia.com
Sun Jun 25 08:34:46 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=c40b9a9873ae43010e4732f94d86b4f15e79ffd5

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From c40b9a9873ae43010e4732f94d86b4f15e79ffd5 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he at corigine.com>
Date: Fri, 9 Jun 2023 14:22:19 +0800
Subject: [PATCH] net/nfp: fix TP flow action for UDP
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 0896b1a22a5b23895af6fabbfdc5df528b24cecd ]

The former logic can't distinguish the TCP and UDP set action, and
only send a TCP type ctrl message to firmware, which cause the set
action of UDP can't offload.

Fixes: fc185097bbe6 ("net/nfp: support TP source flow action")
Fixes: 87986df09d75 ("net/nfp: support TP destination flow action")

Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 30 ++++++++++++++++++++++++++----
 drivers/net/nfp/nfp_flow.h |  1 +
 2 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 5b562a1086..1700aeec9d 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -1898,6 +1898,19 @@ nfp_flow_inner_item_get(const struct rte_flow_item items[],
 	return false;
 }
 
+static bool
+nfp_flow_tcp_flag_check(const struct rte_flow_item items[])
+{
+	const struct rte_flow_item *item;
+
+	for (item = items; item->type != RTE_FLOW_ITEM_TYPE_END; ++item) {
+		if (item->type == RTE_FLOW_ITEM_TYPE_TCP)
+			return true;
+	}
+
+	return false;
+}
+
 static int
 nfp_flow_compile_item_proc(struct nfp_flower_representor *repr,
 		const struct rte_flow_item items[],
@@ -1993,6 +2006,9 @@ nfp_flow_compile_items(struct nfp_flower_representor *representor,
 		mbuf_off_mask += sizeof(struct nfp_flower_ext_meta);
 	}
 
+	if (nfp_flow_tcp_flag_check(items))
+		nfp_flow->tcp_flag = true;
+
 	/* Check if this is a tunnel flow and get the inner item*/
 	is_tun_flow = nfp_flow_inner_item_get(items, &loop_item);
 	if (is_tun_flow)
@@ -2164,7 +2180,8 @@ static void
 nfp_flow_action_set_tp(char *act_data,
 		const struct rte_flow_action *action,
 		bool tp_src_flag,
-		bool tp_set_flag)
+		bool tp_set_flag,
+		bool tcp_flag)
 {
 	size_t act_size;
 	struct nfp_fl_act_set_tport *set_tp;
@@ -2176,7 +2193,10 @@ nfp_flow_action_set_tp(char *act_data,
 		set_tp = (struct nfp_fl_act_set_tport *)act_data;
 
 	act_size = sizeof(struct nfp_fl_act_set_tport);
-	set_tp->head.jump_id = NFP_FL_ACTION_OPCODE_SET_TCP;
+	if (tcp_flag)
+		set_tp->head.jump_id = NFP_FL_ACTION_OPCODE_SET_TCP;
+	else
+		set_tp->head.jump_id = NFP_FL_ACTION_OPCODE_SET_UDP;
 	set_tp->head.len_lw  = act_size >> NFP_FL_LW_SIZ;
 	set_tp->reserved     = 0;
 
@@ -3394,7 +3414,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,
 			break;
 		case RTE_FLOW_ACTION_TYPE_SET_TP_SRC:
 			PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_SET_TP_SRC");
-			nfp_flow_action_set_tp(position, action, true, tp_set_flag);
+			nfp_flow_action_set_tp(position, action, true,
+					tp_set_flag, nfp_flow->tcp_flag);
 			if (!tp_set_flag) {
 				position += sizeof(struct nfp_fl_act_set_tport);
 				tp_set_flag = true;
@@ -3402,7 +3423,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,
 			break;
 		case RTE_FLOW_ACTION_TYPE_SET_TP_DST:
 			PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_SET_TP_DST");
-			nfp_flow_action_set_tp(position, action, false, tp_set_flag);
+			nfp_flow_action_set_tp(position, action, false,
+					tp_set_flag, nfp_flow->tcp_flag);
 			if (!tp_set_flag) {
 				position += sizeof(struct nfp_fl_act_set_tport);
 				tp_set_flag = true;
diff --git a/drivers/net/nfp/nfp_flow.h b/drivers/net/nfp/nfp_flow.h
index 8071243b86..314ff2083a 100644
--- a/drivers/net/nfp/nfp_flow.h
+++ b/drivers/net/nfp/nfp_flow.h
@@ -224,6 +224,7 @@ struct rte_flow {
 	uint32_t hash_key;
 	uint32_t port_id;
 	bool install_flag;
+	bool tcp_flag;    /**< Used in the SET_TP_* action */
 	enum nfp_flow_type type;
 };
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-06-25 14:32:00.337762800 +0800
+++ 0068-net-nfp-fix-TP-flow-action-for-UDP.patch	2023-06-25 14:31:58.425773900 +0800
@@ -1 +1 @@
-From 0896b1a22a5b23895af6fabbfdc5df528b24cecd Mon Sep 17 00:00:00 2001
+From c40b9a9873ae43010e4732f94d86b4f15e79ffd5 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 0896b1a22a5b23895af6fabbfdc5df528b24cecd ]
@@ -15 +17,0 @@
-Cc: stable at dpdk.org
@@ -25 +27 @@
-index 359423dc28..14749f03a2 100644
+index 5b562a1086..1700aeec9d 100644
@@ -28 +30 @@
-@@ -1908,6 +1908,19 @@ nfp_flow_inner_item_get(const struct rte_flow_item items[],
+@@ -1898,6 +1898,19 @@ nfp_flow_inner_item_get(const struct rte_flow_item items[],
@@ -48 +50 @@
-@@ -2003,6 +2016,9 @@ nfp_flow_compile_items(struct nfp_flower_representor *representor,
+@@ -1993,6 +2006,9 @@ nfp_flow_compile_items(struct nfp_flower_representor *representor,
@@ -58 +60 @@
-@@ -2174,7 +2190,8 @@ static void
+@@ -2164,7 +2180,8 @@ static void
@@ -68 +70 @@
-@@ -2186,7 +2203,10 @@ nfp_flow_action_set_tp(char *act_data,
+@@ -2176,7 +2193,10 @@ nfp_flow_action_set_tp(char *act_data,
@@ -80 +82 @@
-@@ -3443,7 +3463,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,
+@@ -3394,7 +3414,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,
@@ -90 +92 @@
-@@ -3451,7 +3472,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,
+@@ -3402,7 +3423,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,
@@ -101 +103 @@
-index d352671c2c..414bd4573b 100644
+index 8071243b86..314ff2083a 100644
@@ -104,2 +106,2 @@
-@@ -225,6 +225,7 @@ struct rte_flow {
- 	uint32_t mtr_id;
+@@ -224,6 +224,7 @@ struct rte_flow {
+ 	uint32_t hash_key;


More information about the stable mailing list