From: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
To: dev@dpdk.org
Cc: Sangtani Parag Satishbhai
<parag-satishbhai.sangtani@broadcom.com>,
stable@dpdk.org,
Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>,
Ajit Khaparde <ajit.khaparde@broadcom.com>
Subject: [PATCH v8 07/47] net/bnxt: tf_core: fix slice count in case of HA entry move
Date: Thu, 7 Nov 2024 19:22:14 +0530 [thread overview]
Message-ID: <20241107135254.1611676-8-sriharsha.basavapatna@broadcom.com> (raw)
In-Reply-To: <20241107135254.1611676-1-sriharsha.basavapatna@broadcom.com>
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
prev 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 ` [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 ` Sriharsha Basavapatna [this message]
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-8-sriharsha.basavapatna@broadcom.com \
--to=sriharsha.basavapatna@broadcom.com \
--cc=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=parag-satishbhai.sangtani@broadcom.com \
--cc=stable@dpdk.org \
/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).