From: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
To: dev@dpdk.org
Cc: Shahaji Bhosle <sbhosle@broadcom.com>,
stable@dpdk.org, Randy Schacher <stuart.schacher@broadcom.com>,
Kishore Padmanabha <kishore.padmanabha@broadcom.com>,
Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>,
Ajit Khaparde <ajit.khaparde@broadcom.com>
Subject: [PATCH v8 01/47] net/bnxt: tf_core: fix wc tcam multi slice delete issue
Date: Thu, 7 Nov 2024 19:22:08 +0530 [thread overview]
Message-ID: <20241107135254.1611676-2-sriharsha.basavapatna@broadcom.com> (raw)
In-Reply-To: <20241107135254.1611676-1-sriharsha.basavapatna@broadcom.com>
From: Shahaji Bhosle <sbhosle@broadcom.com>
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")
Cc: stable@dpdk.org
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Shahaji Bhosle <sbhosle@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/tf_core/tf_msg.c | 28 +++++++++++-----------
drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c | 21 ++++++++++++++--
2 files changed, 33 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 75a0b77ac2..fc8d0098f9 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,18 @@ 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_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");
+ }
+ return rc;
}
int
@@ -589,7 +598,15 @@ 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_LINE(ERR,
+ "Tunnel already allocated, type:%d port:%d",
+ hwtype, udp_port);
+ else
+ PMD_DRV_LOG_LINE(ERR, "Tunnel allocation failed, type:%d port:%d",
+ 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.39.3
next parent reply other threads:[~2024-11-07 13:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20241107135254.1611676-1-sriharsha.basavapatna@broadcom.com>
2024-11-07 13:52 ` Sriharsha Basavapatna [this message]
2024-11-07 13:52 ` [PATCH v8 02/47] net/bnxt: tf_core: tcam manager data corruption Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 04/47] net/bnxt: tf_core: Thor TF EM key size check Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 07/47] net/bnxt: tf_core: fix slice count in case of HA entry move Sriharsha Basavapatna
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241107135254.1611676-2-sriharsha.basavapatna@broadcom.com \
--to=sriharsha.basavapatna@broadcom.com \
--cc=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=kishore.padmanabha@broadcom.com \
--cc=sbhosle@broadcom.com \
--cc=stable@dpdk.org \
--cc=stuart.schacher@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).