[16/20] net/bnxt: shadow tcam and tbl reference count modification
diff mbox series

Message ID 20200723111329.21855-17-somnath.kotur@broadcom.com
State Superseded, archived
Delegated to: Ajit Khaparde
Headers show
Series
  • bnxt patches
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Somnath Kotur July 23, 2020, 11:13 a.m. UTC
From: Mike Baucom <michael.baucom@broadcom.com>

Moved setting the refcnt for shadow tcam and table entries to the
allocation path only.  The insert can be called multiple times for
updates and was resetting the refcnt to 1 each time.  Now multiple
insertion/modifications will not change the reference count.

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
---
 drivers/net/bnxt/tf_core/tf_shadow_tbl.c  | 2 --
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/drivers/net/bnxt/tf_core/tf_shadow_tbl.c b/drivers/net/bnxt/tf_core/tf_shadow_tbl.c
index 019a26e..a4207eb 100644
--- a/drivers/net/bnxt/tf_core/tf_shadow_tbl.c
+++ b/drivers/net/bnxt/tf_core/tf_shadow_tbl.c
@@ -687,8 +687,6 @@  tf_shadow_tbl_insert(struct tf_shadow_tbl_insert_parms *parms)
 	if (!TF_SHADOW_HB_HANDLE_IS_VALID(sr_entry->hb_handle))
 		return 0;
 
-	sr_entry->refcnt = 1;
-
 	return 0;
 }
 
diff --git a/drivers/net/bnxt/tf_core/tf_shadow_tcam.c b/drivers/net/bnxt/tf_core/tf_shadow_tcam.c
index a0130d6..e2c347a 100644
--- a/drivers/net/bnxt/tf_core/tf_shadow_tcam.c
+++ b/drivers/net/bnxt/tf_core/tf_shadow_tcam.c
@@ -472,6 +472,7 @@  tf_shadow_tcam_bind_index(struct tf_shadow_tcam_bind_index_parms *parms)
 	/* Write the result table */
 	sr_entry->key_size = parms->key_size;
 	sr_entry->hb_handle = parms->hb_handle;
+	sr_entry->refcnt = 1;
 
 	return 0;
 }
@@ -738,7 +739,6 @@  tf_shadow_tcam_insert(struct tf_shadow_tcam_insert_parms *parms)
 
 	memcpy(sr_entry->result, sparms->result, sparms->result_size);
 	sr_entry->result_size = sparms->result_size;
-	sr_entry->refcnt = 1;
 
 	return 0;
 }