patch 'net/nfp: fix NFDk metadata process' has been queued to stable release 23.11.1

Xueming Li xuemingl at nvidia.com
Tue Mar 5 10:47:56 CET 2024


Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. 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=23.11-staging

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

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From cc670c78337dc89cffa5248facf46c121216cf43 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he at corigine.com>
Date: Tue, 20 Feb 2024 16:14:51 +0800
Subject: [PATCH] net/nfp: fix NFDk metadata process
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit b36f0b1d3e453727999a5770b00af555e21f07b1 ]

The Tx function can not check if the metadata process success for
the process function with void return type.

Fix it by change the return type of the metadata function from
void to integer and add the error handle logic in the Tx function.

Fixes: 7c82b8626af8 ("net/nfp: support VLAN insert with NFDk")

Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Long Wu <long.wu at corigine.com>
Reviewed-by: Peng Zhang <peng.zhang at corigine.com>
---
 drivers/net/nfp/nfdk/nfp_nfdk_dp.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
index 0141fbcc8f..6a9e7ec042 100644
--- a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
+++ b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
@@ -167,7 +167,7 @@ close_block:
 	return nop_slots;
 }

-static void
+static int
 nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt,
 		struct nfp_net_txq *txq,
 		uint64_t *metadata)
@@ -206,8 +206,10 @@ nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt,
 		meta_data.length += 3 * NFP_NET_META_FIELD_SIZE;
 	}

-	if (meta_data.length == 0)
-		return;
+	if (meta_data.length == 0) {
+		*metadata = 0;
+		return 0;
+	}

 	meta_type = meta_data.header;
 	header_offset = meta_type << NFP_NET_META_NFDK_LENGTH;
@@ -223,15 +225,16 @@ nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt,
 		case NFP_NET_META_VLAN:
 			if (vlan_layer > 0) {
 				PMD_DRV_LOG(ERR, "At most 1 layers of vlan is supported");
-				return;
+				return -EINVAL;
 			}
+
 			nfp_net_set_meta_vlan(&meta_data, pkt, layer);
 			vlan_layer++;
 			break;
 		case NFP_NET_META_IPSEC:
 			if (ipsec_layer > 2) {
 				PMD_DRV_LOG(ERR, "At most 3 layers of ipsec is supported for now.");
-				return;
+				return -EINVAL;
 			}

 			nfp_net_set_meta_ipsec(&meta_data, txq, pkt, layer, ipsec_layer);
@@ -239,13 +242,15 @@ nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt,
 			break;
 		default:
 			PMD_DRV_LOG(ERR, "The metadata type not supported");
-			return;
+			return -ENOTSUP;
 		}

 		memcpy(meta, &meta_data.data[layer], sizeof(meta_data.data[layer]));
 	}

 	*metadata = NFDK_DESC_TX_CHAIN_META;
+
+	return 0;
 }

 uint16_t
@@ -292,6 +297,7 @@ nfp_net_nfdk_xmit_pkts_common(void *tx_queue,

 	/* Sending packets */
 	while (npkts < nb_pkts && free_descs > 0) {
+		int ret;
 		int nop_descs;
 		uint32_t type;
 		uint32_t dma_len;
@@ -319,10 +325,13 @@ nfp_net_nfdk_xmit_pkts_common(void *tx_queue,

 		temp_pkt = pkt;

-		if (repr_flag)
+		if (repr_flag) {
 			metadata = NFDK_DESC_TX_CHAIN_META;
-		else
-			nfp_net_nfdk_set_meta_data(pkt, txq, &metadata);
+		} else {
+			ret = nfp_net_nfdk_set_meta_data(pkt, txq, &metadata);
+			if (unlikely(ret != 0))
+				goto xmit_end;
+		}

 		if (unlikely(pkt->nb_segs > 1 &&
 				(hw->super.cap & NFP_NET_CFG_CTRL_GATHER) == 0)) {
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:35.044073435 +0800
+++ 0135-net-nfp-fix-NFDk-metadata-process.patch	2024-03-05 17:39:31.093566504 +0800
@@ -1 +1 @@
-From b36f0b1d3e453727999a5770b00af555e21f07b1 Mon Sep 17 00:00:00 2001
+From cc670c78337dc89cffa5248facf46c121216cf43 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit b36f0b1d3e453727999a5770b00af555e21f07b1 ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -23 +25 @@
-index a1c6ecdfe5..daf5ac5b30 100644
+index 0141fbcc8f..6a9e7ec042 100644
@@ -26 +28 @@
-@@ -169,7 +169,7 @@ close_block:
+@@ -167,7 +167,7 @@ close_block:
@@ -108 +110 @@
- 				(hw->super.ctrl & NFP_NET_CFG_CTRL_GATHER) == 0)) {
+ 				(hw->super.cap & NFP_NET_CFG_CTRL_GATHER) == 0)) {


More information about the stable mailing list