[02/47] net/bnxt: tf_core: tcam manager data corruption

Message ID 20240830140049.1715230-3-sriharsha.basavapatna@broadcom.com (mailing list archive)
State Superseded
Delegated to: Ajit Khaparde
Headers
Series TruFlow update for Thor2 |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Sriharsha Basavapatna Aug. 30, 2024, 2 p.m. UTC
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")
Signed-off-by: Shahaji Bhosle <sbhosle@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>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
---
 drivers/net/bnxt/tf_core/cfa_tcam_mgr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Patch

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;
 }