* [PATCH v8 01/47] net/bnxt: tf_core: fix wc tcam multi slice delete issue
[not found] <20241107135254.1611676-1-sriharsha.basavapatna@broadcom.com>
@ 2024-11-07 13:52 ` Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 02/47] net/bnxt: tf_core: tcam manager data corruption Sriharsha Basavapatna
` (2 subsequent siblings)
3 siblings, 0 replies; 4+ messages in thread
From: Sriharsha Basavapatna @ 2024-11-07 13:52 UTC (permalink / raw)
To: dev
Cc: Shahaji Bhosle, stable, Randy Schacher, Kishore Padmanabha,
Sriharsha Basavapatna, Ajit Khaparde
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v8 02/47] net/bnxt: tf_core: tcam manager data corruption
[not found] <20241107135254.1611676-1-sriharsha.basavapatna@broadcom.com>
2024-11-07 13:52 ` [PATCH v8 01/47] net/bnxt: tf_core: fix wc tcam multi slice delete issue Sriharsha Basavapatna
@ 2024-11-07 13:52 ` 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
3 siblings, 0 replies; 4+ messages in thread
From: Sriharsha Basavapatna @ 2024-11-07 13:52 UTC (permalink / raw)
To: dev
Cc: Shahaji Bhosle, stable, Sriharsha Basavapatna, Farah Smith,
Kishore Padmanabha, Shuanglin Wang, Ajit Khaparde
From: Shahaji Bhosle <sbhosle@broadcom.com>
Max entries per session were not getting initialized
to 0, when the sessions were closed.
Reset max entries counter session when the session is initialized
Fixes: 97435d7906d7 ("net/bnxt: update Truflow core")
Cc: stable@dpdk.org
Signed-off-by: Shahaji Bhosle <sbhosle@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Reviewed-by: Farah Smith <farah.smith@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Shuanglin Wang <shuanglin.wang@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/tf_core/cfa_tcam_mgr.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnxt/tf_core/cfa_tcam_mgr.c b/drivers/net/bnxt/tf_core/cfa_tcam_mgr.c
index f26d93e7a9..9df2d2b937 100644
--- a/drivers/net/bnxt/tf_core/cfa_tcam_mgr.c
+++ b/drivers/net/bnxt/tf_core/cfa_tcam_mgr.c
@@ -909,6 +909,7 @@ cfa_tcam_mgr_init(int sess_idx, enum cfa_tcam_mgr_device_type type,
/* Now calculate the max entries per table and global max entries based
* on the updated table limits.
*/
+ cfa_tcam_mgr_max_entries[sess_idx] = 0;
for (dir = 0; dir < ARRAY_SIZE(cfa_tcam_mgr_tables[sess_idx]); dir++)
for (tbl_type = 0;
tbl_type < ARRAY_SIZE(cfa_tcam_mgr_tables[sess_idx][dir]);
@@ -958,8 +959,8 @@ cfa_tcam_mgr_init(int sess_idx, enum cfa_tcam_mgr_device_type type,
if (parms != NULL)
parms->max_entries = cfa_tcam_mgr_max_entries[sess_idx];
- CFA_TCAM_MGR_LOG(INFO, "Global TCAM table initialized for sess_idx %d.\n",
- sess_idx);
+ CFA_TCAM_MGR_LOG(DEBUG, "Global TCAM table initialized for sess_idx %d max entries %d.\n",
+ sess_idx, cfa_tcam_mgr_max_entries[sess_idx]);
return 0;
}
--
2.39.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v8 04/47] net/bnxt: tf_core: Thor TF EM key size check
[not found] <20241107135254.1611676-1-sriharsha.basavapatna@broadcom.com>
2024-11-07 13:52 ` [PATCH v8 01/47] net/bnxt: tf_core: fix wc tcam multi slice delete issue Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 02/47] net/bnxt: tf_core: tcam manager data corruption Sriharsha Basavapatna
@ 2024-11-07 13:52 ` 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
3 siblings, 0 replies; 4+ messages in thread
From: Sriharsha Basavapatna @ 2024-11-07 13:52 UTC (permalink / raw)
To: dev
Cc: Farah Smith, stable, Sriharsha Basavapatna, Kishore Padmanabha,
Shahaji Bhosle, Ajit Khaparde
From: Farah Smith <farah.smith@broadcom.com>
The maximum EM key size is 640 bits for Thor. But the lookup record
+ the key size is 679 bits. This value must be rounded up to a 128 bit
aligned number. So the size check should be 96 bytes rather than 80.
This fix allows keys > 601 bits to be successfully inserted.
Fixes: 539931eab3a5 ("net/bnxt: support EM with FKB")
Cc: stable@dpdk.org
Signed-off-by: Farah Smith <farah.smith@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Reviewed-by: Farah Smith <farah.smith@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/tf_core/tf_msg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/tf_core/tf_msg.c b/drivers/net/bnxt/tf_core/tf_msg.c
index 08e9783d52..dd5ea1c80e 100644
--- a/drivers/net/bnxt/tf_core/tf_msg.c
+++ b/drivers/net/bnxt/tf_core/tf_msg.c
@@ -25,7 +25,7 @@
*/
#define TF_MSG_SET_GLOBAL_CFG_DATA_SIZE 16
#define TF_MSG_EM_INSERT_KEY_SIZE 64
-#define TF_MSG_EM_INSERT_RECORD_SIZE 80
+#define TF_MSG_EM_INSERT_RECORD_SIZE 96
#define TF_MSG_TBL_TYPE_SET_DATA_SIZE 88
/* Compile check - Catch any msg changes that we depend on, like the
--
2.39.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v8 07/47] net/bnxt: tf_core: fix slice count in case of HA entry move
[not found] <20241107135254.1611676-1-sriharsha.basavapatna@broadcom.com>
` (2 preceding siblings ...)
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 ` Sriharsha Basavapatna
3 siblings, 0 replies; 4+ messages in thread
From: Sriharsha Basavapatna @ 2024-11-07 13:52 UTC (permalink / raw)
To: dev
Cc: Sangtani Parag Satishbhai, stable, Sriharsha Basavapatna, Ajit Khaparde
From: Sangtani Parag Satishbhai <parag-satishbhai.sangtani@broadcom.com>
When entries are moved during HA, a shared move function transfers
TCAM entries by using get/set message APIs, and the slice number of the
entry is required to accomplish the movement. The slice number is
calculated as the product of row_slice and entry size. Before calling
get/set message APIs, the source entry size should be updated with the
destination entry size; otherwise, it might corrupt the slice number field,
which may result in writing an incorrect entry. A fix is made which now
copies the entry size from the source to the destination before calling
get/set message APIs, ensuring the correct slice number is modified.
Fixes: 97435d7906d7 ("net/bnxt: update Truflow core")
Cc: stable@dpdk.org
Signed-off-by: Sangtani Parag Satishbhai <parag-satishbhai.sangtani@broadcom.com>
Reviewed-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
.mailmap | 1 +
drivers/net/bnxt/tf_core/cfa_tcam_mgr.c | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/.mailmap b/.mailmap
index 504c390f0f..210df76f0f 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1321,6 +1321,7 @@ Samina Arshad <samina.arshad@intel.com>
Sampath Peechu <speechu@cisco.com>
Samuel Gauthier <samuel.gauthier@6wind.com>
Sandilya Bhagi <sbhagi@solarflare.com>
+Sangtani Parag Satishbhai <parag-satishbhai.sangtani@broadcom.com>
Sangjin Han <sangjin@eecs.berkeley.edu>
Sankar Chokkalingam <sankarx.chokkalingam@intel.com>
Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
diff --git a/drivers/net/bnxt/tf_core/cfa_tcam_mgr.c b/drivers/net/bnxt/tf_core/cfa_tcam_mgr.c
index 349f52caba..33b1e4121e 100644
--- a/drivers/net/bnxt/tf_core/cfa_tcam_mgr.c
+++ b/drivers/net/bnxt/tf_core/cfa_tcam_mgr.c
@@ -1717,6 +1717,11 @@ cfa_tcam_mgr_shared_entry_move(int sess_idx, struct cfa_tcam_mgr_context *contex
uint8_t key[CFA_TCAM_MGR_MAX_KEY_SIZE];
uint8_t mask[CFA_TCAM_MGR_MAX_KEY_SIZE];
uint8_t result[CFA_TCAM_MGR_MAX_KEY_SIZE];
+ /*
+ * Copy entry size before moving else if
+ * slice number is non zero and entry size is zero it will cause issues
+ */
+ dst_row->entry_size = src_row->entry_size;
int rc;
@@ -1791,7 +1796,6 @@ cfa_tcam_mgr_shared_entry_move(int sess_idx, struct cfa_tcam_mgr_context *contex
ROW_ENTRY_SET(dst_row, dst_row_slice);
dst_row->entries[dst_row_slice] = entry_id;
- dst_row->entry_size = src_row->entry_size;
dst_row->priority = src_row->priority;
ROW_ENTRY_CLEAR(src_row, entry->slice);
entry->row = dst_row_index;
--
2.39.3
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-07 13:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20241107135254.1611676-1-sriharsha.basavapatna@broadcom.com>
2024-11-07 13:52 ` [PATCH v8 01/47] net/bnxt: tf_core: fix wc tcam multi slice delete issue Sriharsha Basavapatna
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
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).