patch 'net/bnxt/tf_core: fix WC TCAM multi-slice delete' has been queued to stable release 23.11.3

Xueming Li xuemingl at nvidia.com
Sat Dec 7 09:00:09 CET 2024


Hi,

FYI, your patch has been queued to stable release 23.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 12/10/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=e5ebe71958e2c9f1e93fe4211f2e02aea5391363

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From e5ebe71958e2c9f1e93fe4211f2e02aea5391363 Mon Sep 17 00:00:00 2001
From: Shahaji Bhosle <sbhosle at broadcom.com>
Date: Thu, 7 Nov 2024 19:22:08 +0530
Subject: [PATCH] net/bnxt/tf_core: fix WC TCAM multi-slice delete
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 78dcdb821cb81f4abddfd4abc0192e238d4bfcec ]

FW tries to update the HWRM request data in the
delete case to update the mode bit and also
update invalid profile id. This update only
happens when the data is send over DMA. HWRM
requests are read only buffers and cannot be
updated. So driver now will always send WC
tcam set message over DMA channel.

Update tunnel alloc apis to provide error message.

Fixes: ca5e61bd562d ("net/bnxt: support EM and TCAM lookup with table scope")

Signed-off-by: Shahaji Bhosle <sbhosle at broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna at broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha at broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/tf_core/tf_msg.c          | 28 +++++++++++-----------
 drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c | 16 +++++++++++--
 2 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/drivers/net/bnxt/tf_core/tf_msg.c b/drivers/net/bnxt/tf_core/tf_msg.c
index 1c66c7e01a..4aa90f6b07 100644
--- a/drivers/net/bnxt/tf_core/tf_msg.c
+++ b/drivers/net/bnxt/tf_core/tf_msg.c
@@ -1612,20 +1612,20 @@ tf_msg_tcam_entry_set(struct tf *tfp,
 	req.result_size = parms->result_size;
 	data_size = 2 * req.key_size + req.result_size;

-	if (data_size <= TF_PCI_BUF_SIZE_MAX) {
-		/* use pci buffer */
-		data = &req.dev_data[0];
-	} else {
-		/* use dma buffer */
-		req.flags |= HWRM_TF_TCAM_SET_INPUT_FLAGS_DMA;
-		rc = tf_msg_alloc_dma_buf(&buf, data_size);
-		if (rc)
-			goto cleanup;
-		data = buf.va_addr;
-		tfp_memcpy(&req.dev_data[0],
-			   &buf.pa_addr,
-			   sizeof(buf.pa_addr));
-	}
+	/*
+	 * Always use dma buffer, as the delete multi slice
+	 * tcam entries not support with HWRM request buffer
+	 * only DMA'ed buffer can update the mode bits for
+	 * the delete to work
+	 */
+	req.flags |= HWRM_TF_TCAM_SET_INPUT_FLAGS_DMA;
+	rc = tf_msg_alloc_dma_buf(&buf, data_size);
+	if (rc)
+		goto cleanup;
+	data = buf.va_addr;
+	tfp_memcpy(&req.dev_data[0],
+		   &buf.pa_addr,
+		   sizeof(buf.pa_addr));

 	tfp_memcpy(&data[0], parms->key, parms->key_size);
 	tfp_memcpy(&data[parms->key_size], parms->mask, parms->key_size);
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c b/drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c
index 239191e14e..b0d9d8d3d9 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c
@@ -32,9 +32,16 @@ bnxt_tunnel_dst_port_alloc(struct bnxt *bp,
 			   uint16_t port,
 			   uint8_t type)
 {
-	return bnxt_hwrm_tunnel_dst_port_alloc(bp,
+	int rc = 0;
+	rc = bnxt_hwrm_tunnel_dst_port_alloc(bp,
 					       port,
 					       type);
+	if (rc) {
+		PMD_DRV_LOG(ERR, "Tunnel type:%d alloc failed for port:%d error:%s\n",
+			    type, port, (rc == HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_ALLOCATED) ?
+			    "already allocated" : "no resource");
+	}
+	return rc;
 }

 int
@@ -589,7 +596,12 @@ bnxt_pmd_global_tunnel_set(uint16_t port_id, uint8_t type,
 		}

 		rc = bnxt_hwrm_tunnel_dst_port_alloc(bp, udp_port, hwtype);
-		if (!rc) {
+		if (rc) {
+			if (rc == HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_ALLOCATED)
+				PMD_DRV_LOG(ERR, "Tunnel already allocated, type:%d port:%d\n", hwtype, udp_port);
+			else
+				PMD_DRV_LOG(ERR, "Tunnel allocation failed, type:%d port:%d\n", hwtype, udp_port);
+		} else {
 			ulp_global_tunnel_db[type].ref_cnt++;
 			ulp_global_tunnel_db[type].dport = udp_port;
 			bnxt_pmd_global_reg_data_to_hndl(port_id, bp->ecpri_upar_in_use,
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-12-06 23:26:45.787438007 +0800
+++ 0051-net-bnxt-tf_core-fix-WC-TCAM-multi-slice-delete.patch	2024-12-06 23:26:43.953044828 +0800
@@ -1 +1 @@
-From 78dcdb821cb81f4abddfd4abc0192e238d4bfcec Mon Sep 17 00:00:00 2001
+From e5ebe71958e2c9f1e93fe4211f2e02aea5391363 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 78dcdb821cb81f4abddfd4abc0192e238d4bfcec ]
@@ -17 +19,0 @@
-Cc: stable at dpdk.org
@@ -26,2 +28,2 @@
- drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c | 21 ++++++++++++++--
- 2 files changed, 33 insertions(+), 16 deletions(-)
+ drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c | 16 +++++++++++--
+ 2 files changed, 28 insertions(+), 16 deletions(-)
@@ -69 +71 @@
-index 75a0b77ac2..fc8d0098f9 100644
+index 239191e14e..b0d9d8d3d9 100644
@@ -72 +74 @@
-@@ -32,9 +32,18 @@ bnxt_tunnel_dst_port_alloc(struct bnxt *bp,
+@@ -32,9 +32,16 @@ bnxt_tunnel_dst_port_alloc(struct bnxt *bp,
@@ -82,5 +84,3 @@
-+		PMD_DRV_LOG_LINE(ERR, "Tunnel type:%d alloc failed for port:%d error:%s",
-+				 type, port,
-+				 (rc ==
-+				  HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_ALLOCATED) ?
-+				 "already allocated" : "no resource");
++		PMD_DRV_LOG(ERR, "Tunnel type:%d alloc failed for port:%d error:%s\n",
++			    type, port, (rc == HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_ALLOCATED) ?
++			    "already allocated" : "no resource");
@@ -92 +92 @@
-@@ -589,7 +598,15 @@ bnxt_pmd_global_tunnel_set(uint16_t port_id, uint8_t type,
+@@ -589,7 +596,12 @@ bnxt_pmd_global_tunnel_set(uint16_t port_id, uint8_t type,
@@ -99,3 +99 @@
-+				PMD_DRV_LOG_LINE(ERR,
-+						 "Tunnel already allocated, type:%d port:%d",
-+						 hwtype, udp_port);
++				PMD_DRV_LOG(ERR, "Tunnel already allocated, type:%d port:%d\n", hwtype, udp_port);
@@ -103,2 +101 @@
-+				PMD_DRV_LOG_LINE(ERR, "Tunnel allocation failed, type:%d port:%d",
-+						 hwtype, udp_port);
++				PMD_DRV_LOG(ERR, "Tunnel allocation failed, type:%d port:%d\n", hwtype, udp_port);


More information about the stable mailing list