DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: Randy Schacher <stuart.schacher@broadcom.com>,
	Kishore Padmanabha <kishore.padmanabha@broadcom.com>,
	Peter Spreadborough <peter.spreadborough@broadcom.com>
Subject: [PATCH v3 01/11] net/bnxt: remove deprecated features
Date: Thu,  4 May 2023 10:36:02 -0700	[thread overview]
Message-ID: <20230504173612.17696-2-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20230504173612.17696-1-ajit.khaparde@broadcom.com>

[-- Attachment #1: Type: text/plain, Size: 81234 bytes --]

From: Randy Schacher <stuart.schacher@broadcom.com>

- Deprecate shadow identifier
- Deprecate shadow TCAM
- Remove files which are not needed anymore.

Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com>
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c                  |  53 --
 drivers/net/bnxt/bnxt_hwrm.h                  |  10 -
 drivers/net/bnxt/tf_core/meson.build          |   2 -
 drivers/net/bnxt/tf_core/tf_core.c            |   2 -
 drivers/net/bnxt/tf_core/tf_core.h            |  91 +-
 drivers/net/bnxt/tf_core/tf_device.c          |  35 -
 drivers/net/bnxt/tf_core/tf_device.h          |   6 -
 drivers/net/bnxt/tf_core/tf_device_p4.c       |  10 -
 drivers/net/bnxt/tf_core/tf_device_p58.c      |  10 -
 drivers/net/bnxt/tf_core/tf_identifier.c      | 108 ---
 drivers/net/bnxt/tf_core/tf_identifier.h      |   4 -
 drivers/net/bnxt/tf_core/tf_if_tbl.h          |   8 -
 drivers/net/bnxt/tf_core/tf_session.c         |   9 +-
 drivers/net/bnxt/tf_core/tf_session.h         |  18 +-
 .../net/bnxt/tf_core/tf_shadow_identifier.c   | 190 ----
 .../net/bnxt/tf_core/tf_shadow_identifier.h   | 229 -----
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c     | 837 ------------------
 drivers/net/bnxt/tf_core/tf_shadow_tcam.h     | 195 ----
 drivers/net/bnxt/tf_core/tf_tcam.c            | 243 -----
 drivers/net/bnxt/tf_core/tf_tcam.h            |  38 +-
 drivers/net/bnxt/tf_core/tf_util.c            |   2 -
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |   3 -
 22 files changed, 8 insertions(+), 2095 deletions(-)
 delete mode 100644 drivers/net/bnxt/tf_core/tf_shadow_identifier.c
 delete mode 100644 drivers/net/bnxt/tf_core/tf_shadow_identifier.h
 delete mode 100644 drivers/net/bnxt/tf_core/tf_shadow_tcam.c
 delete mode 100644 drivers/net/bnxt/tf_core/tf_shadow_tcam.h

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index d86ac73293..3f273df6f3 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -407,59 +407,6 @@ int bnxt_hwrm_tf_message_direct(struct bnxt *bp,
 	return rc;
 }
 
-int bnxt_hwrm_tf_message_tunneled(struct bnxt *bp,
-				  bool use_kong_mb,
-				  uint16_t tf_type,
-				  uint16_t tf_subtype,
-				  uint32_t *tf_response_code,
-				  void *msg,
-				  uint32_t msg_len,
-				  void *response,
-				  uint32_t response_len)
-{
-	int rc = 0;
-	struct hwrm_cfa_tflib_input req = { .req_type = 0 };
-	struct hwrm_cfa_tflib_output *resp = bp->hwrm_cmd_resp_addr;
-	bool mailbox = BNXT_USE_CHIMP_MB;
-
-	if (msg_len > sizeof(req.tf_req))
-		return -ENOMEM;
-
-	if (use_kong_mb)
-		mailbox = BNXT_USE_KONG(bp);
-
-	HWRM_PREP(&req, HWRM_TF, mailbox);
-	/* Build request using the user supplied request payload.
-	 * TLV request size is checked at build time against HWRM
-	 * request max size, thus no checking required.
-	 */
-	req.tf_type = tf_type;
-	req.tf_subtype = tf_subtype;
-	memcpy(req.tf_req, msg, msg_len);
-
-	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), mailbox);
-	HWRM_CHECK_RESULT();
-
-	/* Copy the resp to user provided response buffer */
-	if (response != NULL)
-		/* Post process response data. We need to copy only
-		 * the 'payload' as the HWRM data structure really is
-		 * HWRM header + msg header + payload and the TFLIB
-		 * only provided a payload place holder.
-		 */
-		if (response_len != 0) {
-			memcpy(response,
-			       resp->tf_resp,
-			       response_len);
-		}
-
-	/* Extract the internal tflib response code */
-	*tf_response_code = resp->tf_resp_code;
-	HWRM_UNLOCK();
-
-	return rc;
-}
-
 int bnxt_hwrm_cfa_l2_clear_rx_mask(struct bnxt *bp, struct bnxt_vnic_info *vnic)
 {
 	int rc = 0;
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index a82d9fb3ef..f9d9fe0ef2 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -79,16 +79,6 @@ struct hwrm_func_qstats_output;
 	bp->rx_cos_queue[x].profile =	\
 		resp->queue_id##x##_service_profile
 
-int bnxt_hwrm_tf_message_tunneled(struct bnxt *bp,
-				  bool use_kong_mb,
-				  uint16_t tf_type,
-				  uint16_t tf_subtype,
-				  uint32_t *tf_response_code,
-				  void *msg,
-				  uint32_t msg_len,
-				  void *response,
-				  uint32_t response_len);
-
 int bnxt_hwrm_tf_message_direct(struct bnxt *bp,
 				bool use_kong_mb,
 				uint16_t msg_type,
diff --git a/drivers/net/bnxt/tf_core/meson.build b/drivers/net/bnxt/tf_core/meson.build
index 206935d18a..f812e471d1 100644
--- a/drivers/net/bnxt/tf_core/meson.build
+++ b/drivers/net/bnxt/tf_core/meson.build
@@ -30,9 +30,7 @@ sources += files(
         'tf_identifier.c',
         'tf_if_tbl.c',
         'tf_session.c',
-        'tf_shadow_tcam.c',
         'tf_tcam.c',
         'tf_tcam_shared.c',
-        'tf_shadow_identifier.c',
         'tf_hash.c',
         'tf_device_p58.c')
diff --git a/drivers/net/bnxt/tf_core/tf_core.c b/drivers/net/bnxt/tf_core/tf_core.c
index 90ff93946b..038e439101 100644
--- a/drivers/net/bnxt/tf_core/tf_core.c
+++ b/drivers/net/bnxt/tf_core/tf_core.c
@@ -917,7 +917,6 @@ tf_free_tcam_entry(struct tf *tfp,
 	return 0;
 }
 
-#ifdef TF_TCAM_SHARED
 int
 tf_move_tcam_shared_entries(struct tf *tfp,
 			    struct tf_move_tcam_shared_entries_parms *parms)
@@ -1019,7 +1018,6 @@ tf_clear_tcam_shared_entries(struct tf *tfp,
 
 	return 0;
 }
-#endif /* TF_TCAM_SHARED */
 
 int
 tf_alloc_tbl_entry(struct tf *tfp,
diff --git a/drivers/net/bnxt/tf_core/tf_core.h b/drivers/net/bnxt/tf_core/tf_core.h
index f891d7a48f..814eff68da 100644
--- a/drivers/net/bnxt/tf_core/tf_core.h
+++ b/drivers/net/bnxt/tf_core/tf_core.h
@@ -337,41 +337,6 @@ enum tf_tbl_type {
 	TF_TBL_TYPE_MAX
 };
 
-/** Enable Shared TCAM Management
- *
- *  This feature allows for management of high and low pools within
- *  the WC TCAM.  These pools are only valid when this feature is enabled.
- *
- *  For normal OVS-DPDK operation, this feature is not required and can
- *  be disabled by commenting out TF_TCAM_SHARED in this header file.
- *
- *  Operation:
- *
- *  When a shared session is created with WC TCAM entries allocated during
- *  tf_open_session(), the TF_TCAM_TBL_TYPE_WC_TCAM pool entries will be divided
- *  into 2 equal pools - TF_TCAM_TBL_TYPE_WC_TCAM_HIGH and
- *  TF_TCAM_TBL_TYPE_WC_TCAM_LOW.
- *
- *  The user will allocate and free entries from either of these pools to obtain
- *  WC_TCAM entry offsets.  For the WC_TCAM_HI/LO management, alloc/free is done
- *  using the tf_alloc_tcam_entry()/tf_free_tcam_entry() APIs for the shared
- *  session.
- *
- *  The use case for this feature is so that applications can have a shared
- *  session and use the TF core to allocate/set/free entries within a given
- *  region of the WC_TCAM within the shared session.  Application A only writes
- *  to the LOW region for example and Application B only writes to the HIGH
- *  region during normal operation.  After Application A goes down, Application
- *  B may decide to overwrite the LOW region with the HIGH region's entries
- *  and switch to the low region.
- *
- *  For other TCAM types in the  shared session, no alloc/free operations are
- *  permitted. Only set should be used for other TCAM table types after getting
- *  the range as provided by the tf_get_resource_info() API.
- *
- */
-#define TF_TCAM_SHARED 1
-
 /**
  * TCAM table type
  */
@@ -390,12 +355,10 @@ enum tf_tcam_tbl_type {
 	TF_TCAM_TBL_TYPE_CT_RULE_TCAM,
 	/** Virtual Edge Bridge TCAM */
 	TF_TCAM_TBL_TYPE_VEB_TCAM,
-#ifdef TF_TCAM_SHARED
 	/** Wildcard TCAM HI Priority */
 	TF_TCAM_TBL_TYPE_WC_TCAM_HIGH,
 	/** Wildcard TCAM Low Priority */
 	TF_TCAM_TBL_TYPE_WC_TCAM_LOW,
-#endif /* TF_TCAM_SHARED */
 	TF_TCAM_TBL_TYPE_MAX
 };
 
@@ -626,20 +589,6 @@ struct tf_open_session_parms {
 	 * 0000:02:00.0. The name for shared session is 0000:02:00.0-tf_shared.
 	 */
 	char ctrl_chan_name[TF_SESSION_NAME_MAX];
-	/**
-	 * [in] shadow_copy
-	 *
-	 * Boolean controlling the use and availability of shadow
-	 * copy. Shadow copy will allow the TruFlow to keep track of
-	 * resource content on the firmware side without having to
-	 * query firmware. Additional private session core_data will
-	 * be allocated if this boolean is set to 'true', default
-	 * 'false'.
-	 *
-	 * Size of memory depends on the NVM Resource settings for the
-	 * control channel.
-	 */
-	bool shadow_copy;
 	/**
 	 * [in/out] session_id
 	 *
@@ -1045,9 +994,6 @@ struct tf_search_identifier_parms {
  * TruFlow core will allocate a free id from the per identifier resource type
  * pool reserved for the session during tf_open().  No firmware is involved.
  *
- * If shadow copy is enabled, the internal ref_cnt is set to 1 in the
- * shadow table for a newly allocated resource.
- *
  * Returns success or failure code.
  */
 int tf_alloc_identifier(struct tf *tfp,
@@ -1061,8 +1007,7 @@ int tf_alloc_identifier(struct tf *tfp,
  * complete pool is returned to the firmware.
  *
  * additional operation (experimental)
- * Decrement reference count.  Only release resource once refcnt goes to 0 if
- * shadow copy is enabled.
+ * Decrement reference count.
  *
  * Returns success or failure code.
  */
@@ -1072,19 +1017,6 @@ int tf_free_identifier(struct tf *tfp,
 /**
  * Search identifier resource (experimental)
  *
- * If the shadow copy is enabled search_id is used to search for a matching
- * entry in the shadow table.  The shadow table consists of an array of
- * reference counts indexed by identifier.  If a matching entry is found hit is
- * set to TRUE, refcnt is increased by 1 and returned.  Otherwise, hit is
- * set to false and refcnt is set to 0.
- *
- * TODO: we may need a per table internal shadow copy enable flag to stage
- * the shadow table implementation.  We do not need the shadow table for other
- * tables at this time so we may only want to enable the identifier shadow.
- *
- * TODO: remove this pseudocode below added to show that if search fails
- * we shouldn't allocate a new entry but return.
- *
  * identifier alloc (search_en=1)
  * if (ident is allocated and ref_cnt >=1)
  *      return ident - hit is set, incr refcnt
@@ -1262,11 +1194,9 @@ int tf_free_tbl_scope(struct tf *tfp,
  *
  * @ref tf_free_tcam_entry
  *
-#ifdef TF_TCAM_SHARED
  * @ref tf_move_tcam_shared_entries
  *
  * @ref tf_clear_tcam_shared_entries
-#endif
  */
 
 /**
@@ -1332,14 +1262,9 @@ struct tf_search_tcam_entry_parms {
  *
  * Search for a TCAM entry
  *
- * This function searches the shadow copy of the TCAM table for a matching
- * entry.  Key and mask must match for hit to be set.  Only TruFlow core data
- * is accessed.  If shadow_copy is not enabled, an error is returned.
- *
  * Implementation:
  *
- * A hash is performed on the key/mask data and mapped to a shadow copy entry
- * where the full key/mask is populated.  If the full key/mask matches the
+ * If the full key/mask matches the
  * entry, hit is set, ref_cnt is incremented, and search_status indicates what
  * action the caller can take regarding setting the entry.
  *
@@ -1416,8 +1341,7 @@ struct tf_alloc_tcam_entry_parms {
  *
  * This function allocates a TCAM table record.	 This function
  * will attempt to allocate a TCAM table entry from the session
- * owned TCAM entries or search a shadow copy of the TCAM table for a
- * matching entry if search is enabled.	 Key, mask and result must match for
+ * owned TCAM entries.  Key, mask and result must match for
  * hit to be set.  Only TruFlow core data is accessed.
  * A hash table to entry mapping is maintained for search purposes.  If
  * search is not enabled, the first available free entry is returned based
@@ -1568,7 +1492,6 @@ struct tf_free_tcam_entry_parms {
 int tf_free_tcam_entry(struct tf *tfp,
 		       struct tf_free_tcam_entry_parms *parms);
 
-#ifdef TF_TCAM_SHARED
 /**
  * tf_move_tcam_shared_entries parameter definition
  */
@@ -1633,7 +1556,6 @@ struct tf_clear_tcam_shared_entries_parms {
 int tf_clear_tcam_shared_entries(struct tf *tfp,
 			      struct tf_clear_tcam_shared_entries_parms *parms);
 
-#endif /* TF_TCAM_SHARED */
 /**
  * @page table Table Access
  *
@@ -1854,9 +1776,6 @@ struct tf_get_tbl_entry_parms {
  *
  * Used to retrieve a previous set index table entry.
  *
- * Reads and compares with the shadow table copy (if enabled) (only
- * for internal objects).
- *
  * Returns success or failure code. Failure will be returned if the
  * provided data buffer is too small for the data type requested.
  */
@@ -2165,9 +2084,7 @@ int tf_delete_em_entry(struct tf *tfp,
  * succeeds, a pointer to the matching entry and the result record associated
  * with the matching entry will be provided.
  *
- * If flow_handle is set, search shadow copy.
- *
- * Otherwise, query the fw with key to get result.
+ * Query the fw with key to get result.
  *
  * External:
  *
diff --git a/drivers/net/bnxt/tf_core/tf_device.c b/drivers/net/bnxt/tf_core/tf_device.c
index a35d22841c..1c97218b5b 100644
--- a/drivers/net/bnxt/tf_core/tf_device.c
+++ b/drivers/net/bnxt/tf_core/tf_device.c
@@ -9,10 +9,8 @@
 #include "tfp.h"
 #include "tf_em.h"
 #include "tf_rm.h"
-#ifdef TF_TCAM_SHARED
 #include "tf_tcam_shared.h"
 #include "tf_tbl_sram.h"
-#endif /* TF_TCAM_SHARED */
 
 struct tf;
 
@@ -67,9 +65,6 @@ tf_dev_reservation_check(uint16_t count,
  * [in] tfp
  *   Pointer to TF handle
  *
- * [in] shadow_copy
- *   Flag controlling shadow copy DB creation
- *
  * [in] resources
  *   Pointer to resource allocation information
  *
@@ -82,7 +77,6 @@ tf_dev_reservation_check(uint16_t count,
  */
 static int
 tf_dev_bind_p4(struct tf *tfp,
-	       bool shadow_copy,
 	       struct tf_session_resources *resources,
 	       struct tf_dev_info *dev_handle,
 	       enum tf_wc_num_slice wc_num_slices)
@@ -115,7 +109,6 @@ tf_dev_bind_p4(struct tf *tfp,
 	if (rsv_cnt) {
 		ident_cfg.num_elements = TF_IDENT_TYPE_MAX;
 		ident_cfg.cfg = tf_ident_p4;
-		ident_cfg.shadow_copy = shadow_copy;
 		ident_cfg.resources = resources;
 		rc = tf_ident_bind(tfp, &ident_cfg);
 		if (rc) {
@@ -150,14 +143,9 @@ tf_dev_bind_p4(struct tf *tfp,
 	if (rsv_cnt) {
 		tcam_cfg.num_elements = TF_TCAM_TBL_TYPE_MAX;
 		tcam_cfg.cfg = tf_tcam_p4;
-		tcam_cfg.shadow_copy = shadow_copy;
 		tcam_cfg.resources = resources;
 		tcam_cfg.wc_num_slices = wc_num_slices;
-#ifdef TF_TCAM_SHARED
 		rc = tf_tcam_shared_bind(tfp, &tcam_cfg);
-#else /* !TF_TCAM_SHARED */
-		rc = tf_tcam_bind(tfp, &tcam_cfg);
-#endif
 		if (rc) {
 			TFP_DRV_LOG(ERR,
 				    "TCAM initialization failure\n");
@@ -223,7 +211,6 @@ tf_dev_bind_p4(struct tf *tfp,
 	 */
 	if_tbl_cfg.num_elements = TF_IF_TBL_TYPE_MAX;
 	if_tbl_cfg.cfg = tf_if_tbl_p4;
-	if_tbl_cfg.shadow_copy = shadow_copy;
 	rc = tf_if_tbl_bind(tfp, &if_tbl_cfg);
 	if (rc) {
 		TFP_DRV_LOG(ERR,
@@ -287,11 +274,7 @@ tf_dev_unbind_p4(struct tf *tfp)
 	 * In case of residuals TCAMs are cleaned up first as to
 	 * invalidate the pipeline in a clean manner.
 	 */
-#ifdef TF_TCAM_SHARED
 	rc = tf_tcam_shared_unbind(tfp);
-#else /* !TF_TCAM_SHARED */
-	rc = tf_tcam_unbind(tfp);
-#endif /* TF_TCAM_SHARED */
 	if (rc) {
 		TFP_DRV_LOG(INFO,
 			    "Device unbind failed, TCAM\n");
@@ -354,9 +337,6 @@ tf_dev_unbind_p4(struct tf *tfp)
  * [in] tfp
  *   Pointer to TF handle
  *
- * [in] shadow_copy
- *   Flag controlling shadow copy DB creation
- *
  * [in] resources
  *   Pointer to resource allocation information
  *
@@ -369,7 +349,6 @@ tf_dev_unbind_p4(struct tf *tfp)
  */
 static int
 tf_dev_bind_p58(struct tf *tfp,
-		bool shadow_copy,
 		struct tf_session_resources *resources,
 		struct tf_dev_info *dev_handle,
 		enum tf_wc_num_slice wc_num_slices)
@@ -400,7 +379,6 @@ tf_dev_bind_p58(struct tf *tfp,
 	if (rsv_cnt) {
 		ident_cfg.num_elements = TF_IDENT_TYPE_MAX;
 		ident_cfg.cfg = tf_ident_p58;
-		ident_cfg.shadow_copy = shadow_copy;
 		ident_cfg.resources = resources;
 		rc = tf_ident_bind(tfp, &ident_cfg);
 		if (rc) {
@@ -443,14 +421,9 @@ tf_dev_bind_p58(struct tf *tfp,
 	if (rsv_cnt) {
 		tcam_cfg.num_elements = TF_TCAM_TBL_TYPE_MAX;
 		tcam_cfg.cfg = tf_tcam_p58;
-		tcam_cfg.shadow_copy = shadow_copy;
 		tcam_cfg.resources = resources;
 		tcam_cfg.wc_num_slices = wc_num_slices;
-#ifdef TF_TCAM_SHARED
 		rc = tf_tcam_shared_bind(tfp, &tcam_cfg);
-#else /* !TF_TCAM_SHARED */
-		rc = tf_tcam_bind(tfp, &tcam_cfg);
-#endif
 		if (rc) {
 			TFP_DRV_LOG(ERR,
 				    "TCAM initialization failure\n");
@@ -495,7 +468,6 @@ tf_dev_bind_p58(struct tf *tfp,
 	 */
 	if_tbl_cfg.num_elements = TF_IF_TBL_TYPE_MAX;
 	if_tbl_cfg.cfg = tf_if_tbl_p58;
-	if_tbl_cfg.shadow_copy = shadow_copy;
 	rc = tf_if_tbl_bind(tfp, &if_tbl_cfg);
 	if (rc) {
 		TFP_DRV_LOG(ERR,
@@ -560,11 +532,7 @@ tf_dev_unbind_p58(struct tf *tfp)
 	 * In case of residuals TCAMs are cleaned up first as to
 	 * invalidate the pipeline in a clean manner.
 	 */
-#ifdef TF_TCAM_SHARED
 	rc = tf_tcam_shared_unbind(tfp);
-#else /* !TF_TCAM_SHARED */
-	rc = tf_tcam_unbind(tfp);
-#endif /* TF_TCAM_SHARED */
 	if (rc) {
 		TFP_DRV_LOG(INFO,
 			    "Device unbind failed, TCAM\n");
@@ -629,7 +597,6 @@ tf_dev_unbind_p58(struct tf *tfp)
 int
 tf_dev_bind(struct tf *tfp __rte_unused,
 	    enum tf_device_type type,
-	    bool shadow_copy,
 	    struct tf_session_resources *resources,
 	    uint16_t wc_num_slices,
 	    struct tf_dev_info *dev_handle)
@@ -639,14 +606,12 @@ tf_dev_bind(struct tf *tfp __rte_unused,
 	case TF_DEVICE_TYPE_SR:
 		dev_handle->type = type;
 		return tf_dev_bind_p4(tfp,
-				      shadow_copy,
 				      resources,
 				      dev_handle,
 				      wc_num_slices);
 	case TF_DEVICE_TYPE_THOR:
 		dev_handle->type = type;
 		return tf_dev_bind_p58(tfp,
-				       shadow_copy,
 				       resources,
 				       dev_handle,
 				       wc_num_slices);
diff --git a/drivers/net/bnxt/tf_core/tf_device.h b/drivers/net/bnxt/tf_core/tf_device.h
index bfb5de4370..bc6de60423 100644
--- a/drivers/net/bnxt/tf_core/tf_device.h
+++ b/drivers/net/bnxt/tf_core/tf_device.h
@@ -11,9 +11,7 @@
 #include "tf_identifier.h"
 #include "tf_tbl.h"
 #include "tf_tcam.h"
-#ifdef TF_TCAM_SHARED
 #include "tf_tcam_shared.h"
-#endif
 #include "tf_if_tbl.h"
 #include "tf_global_cfg.h"
 
@@ -86,7 +84,6 @@ struct tf_hcapi_resource_map {
  */
 int tf_dev_bind(struct tf *tfp,
 		enum tf_device_type type,
-		bool shadow_copy,
 		struct tf_session_resources *resources,
 		uint16_t wc_num_slices,
 		struct tf_dev_info *dev_handle);
@@ -705,7 +702,6 @@ struct tf_dev_ops {
 	int (*tf_dev_get_tcam)(struct tf *tfp,
 			       struct tf_tcam_get_parms *parms);
 
-#ifdef TF_TCAM_SHARED
 	/**
 	 * Move TCAM shared entries
 	 *
@@ -738,8 +734,6 @@ struct tf_dev_ops {
 	int (*tf_dev_clear_tcam)(struct tf *tfp,
 			      struct tf_clear_tcam_shared_entries_parms *parms);
 
-#endif /* TF_TCAM_SHARED */
-
 	/**
 	 * Retrieves the tcam resource info.
 	 *
diff --git a/drivers/net/bnxt/tf_core/tf_device_p4.c b/drivers/net/bnxt/tf_core/tf_device_p4.c
index b8b3dcbb3f..72c6b1cde8 100644
--- a/drivers/net/bnxt/tf_core/tf_device_p4.c
+++ b/drivers/net/bnxt/tf_core/tf_device_p4.c
@@ -10,9 +10,7 @@
 #include "tf_identifier.h"
 #include "tf_tbl.h"
 #include "tf_tcam.h"
-#ifdef TF_TCAM_SHARED
 #include "tf_tcam_shared.h"
-#endif /* TF_TCAM_SHARED */
 #include "tf_em.h"
 #include "tf_if_tbl.h"
 #include "tfp.h"
@@ -540,20 +538,12 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_get_bulk_sram_tbl = NULL,
 	.tf_dev_get_shared_tbl_increment = tf_dev_p4_get_shared_tbl_increment,
 	.tf_dev_get_tbl_resc_info = tf_tbl_get_resc_info,
-#ifdef TF_TCAM_SHARED
 	.tf_dev_alloc_tcam = tf_tcam_shared_alloc,
 	.tf_dev_free_tcam = tf_tcam_shared_free,
 	.tf_dev_set_tcam = tf_tcam_shared_set,
 	.tf_dev_get_tcam = tf_tcam_shared_get,
 	.tf_dev_move_tcam = tf_tcam_shared_move_p4,
 	.tf_dev_clear_tcam = tf_tcam_shared_clear,
-#else /* !TF_TCAM_SHARED */
-	.tf_dev_alloc_tcam = tf_tcam_alloc,
-	.tf_dev_free_tcam = tf_tcam_free,
-	.tf_dev_set_tcam = tf_tcam_set,
-	.tf_dev_get_tcam = tf_tcam_get,
-#endif
-	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_get_tcam_resc_info = tf_tcam_get_resc_info,
 	.tf_dev_insert_int_em_entry = tf_em_insert_int_entry,
 	.tf_dev_delete_int_em_entry = tf_em_delete_int_entry,
diff --git a/drivers/net/bnxt/tf_core/tf_device_p58.c b/drivers/net/bnxt/tf_core/tf_device_p58.c
index 8179287e46..f8b424ebc9 100644
--- a/drivers/net/bnxt/tf_core/tf_device_p58.c
+++ b/drivers/net/bnxt/tf_core/tf_device_p58.c
@@ -10,9 +10,7 @@
 #include "tf_identifier.h"
 #include "tf_tbl.h"
 #include "tf_tcam.h"
-#ifdef TF_TCAM_SHARED
 #include "tf_tcam_shared.h"
-#endif /* TF_TCAM_SHARED */
 #include "tf_em.h"
 #include "tf_if_tbl.h"
 #include "tfp.h"
@@ -848,20 +846,12 @@ const struct tf_dev_ops tf_dev_ops_p58 = {
 	.tf_dev_get_bulk_sram_tbl = tf_tbl_sram_bulk_get,
 	.tf_dev_get_shared_tbl_increment = tf_dev_p58_get_shared_tbl_increment,
 	.tf_dev_get_tbl_resc_info = tf_tbl_get_resc_info,
-#ifdef TF_TCAM_SHARED
 	.tf_dev_alloc_tcam = tf_tcam_shared_alloc,
 	.tf_dev_free_tcam = tf_tcam_shared_free,
 	.tf_dev_set_tcam = tf_tcam_shared_set,
 	.tf_dev_get_tcam = tf_tcam_shared_get,
 	.tf_dev_move_tcam = tf_tcam_shared_move_p58,
 	.tf_dev_clear_tcam = tf_tcam_shared_clear,
-#else /* !TF_TCAM_SHARED */
-	.tf_dev_alloc_tcam = tf_tcam_alloc,
-	.tf_dev_free_tcam = tf_tcam_free,
-	.tf_dev_set_tcam = tf_tcam_set,
-	.tf_dev_get_tcam = tf_tcam_get,
-#endif
-	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_get_tcam_resc_info = tf_tcam_get_resc_info,
 	.tf_dev_insert_int_em_entry = tf_em_hash_insert_int_entry,
 	.tf_dev_delete_int_em_entry = tf_em_hash_delete_int_entry,
diff --git a/drivers/net/bnxt/tf_core/tf_identifier.c b/drivers/net/bnxt/tf_core/tf_identifier.c
index c491f77a2b..8131d8754d 100644
--- a/drivers/net/bnxt/tf_core/tf_identifier.c
+++ b/drivers/net/bnxt/tf_core/tf_identifier.c
@@ -6,7 +6,6 @@
 #include <rte_common.h>
 
 #include "tf_identifier.h"
-#include "tf_shadow_identifier.h"
 #include "tf_common.h"
 #include "tf_rm.h"
 #include "tf_util.h"
@@ -15,16 +14,6 @@
 
 struct tf;
 
-/**
- * Identifier shadow DBs.
- */
-static void *ident_shadow_db[TF_DIR_MAX];
-
-/**
- * Shadow DB Init flag, set on bind and cleared on unbind
- */
-static uint8_t shadow_init;
-
 int
 tf_ident_bind(struct tf *tfp,
 	      struct tf_ident_cfg_parms *parms)
@@ -33,8 +22,6 @@ tf_ident_bind(struct tf *tfp,
 	int db_rc[TF_DIR_MAX] = { 0 };
 	int i;
 	struct tf_rm_create_db_parms db_cfg = { 0 };
-	struct tf_shadow_ident_cfg_parms shadow_cfg = { 0 };
-	struct tf_shadow_ident_create_db_parms shadow_cdb = { 0 };
 	struct ident_rm_db *ident_db;
 	struct tfp_calloc_parms cparms;
 	struct tf_session *tfs;
@@ -74,23 +61,6 @@ tf_ident_bind(struct tf *tfp,
 			db_rc[i] = tf_rm_create_db_no_reservation(tfp, &db_cfg);
 		else
 			db_rc[i] = tf_rm_create_db(tfp, &db_cfg);
-
-		if (parms->shadow_copy) {
-			shadow_cfg.alloc_cnt =
-				parms->resources->ident_cnt[i].cnt;
-			shadow_cdb.num_elements = parms->num_elements;
-			shadow_cdb.tf_shadow_ident_db = &ident_shadow_db[i];
-			shadow_cdb.cfg = &shadow_cfg;
-			rc = tf_shadow_ident_create_db(&shadow_cdb);
-			if (rc) {
-				TFP_DRV_LOG(ERR,
-				    "%s: Ident shadow DB creation failed\n",
-				    tf_dir_2_str(i));
-
-				return rc;
-			}
-			shadow_init = 1;
-		}
 	}
 
 	/* No db created */
@@ -111,7 +81,6 @@ tf_ident_unbind(struct tf *tfp)
 	int rc = 0;
 	int i;
 	struct tf_rm_free_db_parms fparms = { 0 };
-	struct tf_shadow_ident_free_db_parms sparms = { 0 };
 	struct ident_rm_db *ident_db;
 	void *ident_db_ptr = NULL;
 
@@ -132,22 +101,8 @@ tf_ident_unbind(struct tf *tfp)
 			TFP_DRV_LOG(ERR,
 				    "rm free failed on unbind\n");
 		}
-		if (shadow_init) {
-			sparms.tf_shadow_ident_db = ident_shadow_db[i];
-			rc = tf_shadow_ident_free_db(&sparms);
-			if (rc) {
-				/* TODO: If there are failures on unbind we
-				 * really just have to try until all DBs are
-				 * attempted to be cleared.
-				 */
-			}
-			ident_shadow_db[i] = NULL;
-		}
 		ident_db->ident_db[i] = NULL;
 	}
-
-	shadow_init = 0;
-
 	return 0;
 }
 
@@ -159,7 +114,6 @@ tf_ident_alloc(struct tf *tfp __rte_unused,
 	uint32_t id;
 	uint32_t base_id;
 	struct tf_rm_allocate_parms aparms = { 0 };
-	struct tf_shadow_ident_insert_parms iparms = { 0 };
 	struct ident_rm_db *ident_db;
 	void *ident_db_ptr = NULL;
 
@@ -187,23 +141,7 @@ tf_ident_alloc(struct tf *tfp __rte_unused,
 		return rc;
 	}
 
-	if (shadow_init) {
-		iparms.tf_shadow_ident_db = ident_shadow_db[parms->dir];
-		iparms.type = parms->type;
-		iparms.id = base_id;
-
-		rc = tf_shadow_ident_insert(&iparms);
-		if (rc) {
-			TFP_DRV_LOG(ERR,
-				    "%s: Failed insert shadow DB, type:%d\n",
-				    tf_dir_2_str(parms->dir),
-				    parms->type);
-			return rc;
-		}
-	}
-
 	*parms->id = id;
-
 	return 0;
 }
 
@@ -214,7 +152,6 @@ tf_ident_free(struct tf *tfp __rte_unused,
 	int rc;
 	struct tf_rm_is_allocated_parms aparms = { 0 };
 	struct tf_rm_free_parms fparms = { 0 };
-	struct tf_shadow_ident_remove_parms rparms = { 0 };
 	int allocated = 0;
 	uint32_t base_id;
 	struct ident_rm_db *ident_db;
@@ -250,27 +187,6 @@ tf_ident_free(struct tf *tfp __rte_unused,
 		return -EINVAL;
 	}
 
-	if (shadow_init) {
-		rparms.tf_shadow_ident_db = ident_shadow_db[parms->dir];
-		rparms.type = parms->type;
-		rparms.id = base_id;
-		rparms.ref_cnt = parms->ref_cnt;
-
-		rc = tf_shadow_ident_remove(&rparms);
-		if (rc) {
-			TFP_DRV_LOG(ERR,
-				    "%s: ref_cnt was 0 in shadow DB,"
-				    " type:%d, index:%d\n",
-				    tf_dir_2_str(parms->dir),
-				    parms->type,
-				    parms->id);
-			return rc;
-		}
-
-		if (*rparms.ref_cnt > 0)
-			return 0;
-	}
-
 	/* Free requested element */
 	fparms.rm_db = ident_db->ident_db[parms->dir];
 	fparms.subtype = parms->type;
@@ -294,7 +210,6 @@ tf_ident_search(struct tf *tfp __rte_unused,
 {
 	int rc;
 	struct tf_rm_is_allocated_parms aparms = { 0 };
-	struct tf_shadow_ident_search_parms sparms = { 0 };
 	int allocated = 0;
 	uint32_t base_id;
 	struct ident_rm_db *ident_db;
@@ -302,13 +217,6 @@ tf_ident_search(struct tf *tfp __rte_unused,
 
 	TF_CHECK_PARMS2(tfp, parms);
 
-	if (!shadow_init) {
-		TFP_DRV_LOG(ERR,
-			    "%s: Identifier Shadow copy is not enabled\n",
-			    tf_dir_2_str(parms->dir));
-		return -EINVAL;
-	}
-
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_IDENTIFIER, &ident_db_ptr);
 	if (rc) {
 		TFP_DRV_LOG(ERR,
@@ -336,22 +244,6 @@ tf_ident_search(struct tf *tfp __rte_unused,
 			    parms->search_id);
 		return -EINVAL;
 	}
-
-	sparms.tf_shadow_ident_db = ident_shadow_db[parms->dir];
-	sparms.type = parms->type;
-	sparms.search_id = base_id;
-	sparms.hit = parms->hit;
-	sparms.ref_cnt = parms->ref_cnt;
-
-	rc = tf_shadow_ident_search(&sparms);
-	if (rc) {
-		TFP_DRV_LOG(ERR,
-			    "%s: Failed search shadow DB, type:%d\n",
-			    tf_dir_2_str(parms->dir),
-			    parms->type);
-		return rc;
-	}
-
 	return 0;
 }
 
diff --git a/drivers/net/bnxt/tf_core/tf_identifier.h b/drivers/net/bnxt/tf_core/tf_identifier.h
index 55c093802e..285ff11ce2 100644
--- a/drivers/net/bnxt/tf_core/tf_identifier.h
+++ b/drivers/net/bnxt/tf_core/tf_identifier.h
@@ -22,10 +22,6 @@ struct tf_ident_cfg_parms {
 	 * [in] Identifier configuration array
 	 */
 	struct tf_rm_element_cfg *cfg;
-	/**
-	 * [in] Boolean controlling the request shadow copy.
-	 */
-	bool shadow_copy;
 	/**
 	 * [in] Session resource allocations
 	 */
diff --git a/drivers/net/bnxt/tf_core/tf_if_tbl.h b/drivers/net/bnxt/tf_core/tf_if_tbl.h
index 9f081c8196..bea2f07324 100644
--- a/drivers/net/bnxt/tf_core/tf_if_tbl.h
+++ b/drivers/net/bnxt/tf_core/tf_if_tbl.h
@@ -84,14 +84,6 @@ struct tf_if_tbl_cfg_parms {
 	 * Table Type element configuration array
 	 */
 	struct tf_if_tbl_cfg *cfg;
-	/**
-	 * Shadow table type configuration array
-	 */
-	struct tf_shadow_if_tbl_cfg *shadow_cfg;
-	/**
-	 * Boolean controlling the request shadow copy.
-	 */
-	bool shadow_copy;
 };
 
 /**
diff --git a/drivers/net/bnxt/tf_core/tf_session.c b/drivers/net/bnxt/tf_core/tf_session.c
index c30c0e7029..d0a0916c6a 100644
--- a/drivers/net/bnxt/tf_core/tf_session.c
+++ b/drivers/net/bnxt/tf_core/tf_session.c
@@ -141,8 +141,6 @@ tf_session_create(struct tf *tfp,
 	/* Return the allocated session id */
 	session_id->id = session->session_id.id;
 
-	session->shadow_copy = parms->open_cfg->shadow_copy;
-
 	/* Init session client list */
 	ll_init(&session->client_ll);
 
@@ -200,7 +198,6 @@ tf_session_create(struct tf *tfp,
 
 	rc = tf_dev_bind(tfp,
 			 parms->open_cfg->device_type,
-			 session->shadow_copy,
 			 &parms->open_cfg->resources,
 			 parms->open_cfg->wc_num_slices,
 			 &session->dev);
@@ -360,7 +357,7 @@ tf_session_client_create(struct tf *tfp,
  *   - (-EINVAL) on failure.
  *   - (-ENOTFOUND) error, client not owned by the session.
  *   - (-ENOTSUPP) error, unable to destroy client as its the last
- *                 client. Please use the tf_session_close().
+ *		 client. Please use the tf_session_close().
  */
 static int
 tf_session_client_destroy(struct tf *tfp,
@@ -992,8 +989,6 @@ tf_session_set_db(struct tf *tfp,
 	return rc;
 }
 
-#ifdef TF_TCAM_SHARED
-
 int
 tf_session_get_tcam_shared_db(struct tf *tfp,
 			      void **tcam_shared_db_handle)
@@ -1070,8 +1065,6 @@ tf_session_set_sram_db(struct tf *tfp,
 	return rc;
 }
 
-#endif /* TF_TCAM_SHARED */
-
 int
 tf_session_get_global_db(struct tf *tfp,
 			 void **global_handle)
diff --git a/drivers/net/bnxt/tf_core/tf_session.h b/drivers/net/bnxt/tf_core/tf_session.h
index 19a96c28b1..a6716dfff4 100644
--- a/drivers/net/bnxt/tf_core/tf_session.h
+++ b/drivers/net/bnxt/tf_core/tf_session.h
@@ -48,8 +48,7 @@
  *
  * Shared memory containing private TruFlow session information.
  * Through this structure the session can keep track of resource
- * allocations and (if so configured) any shadow copy of flow
- * information. It also holds info about Session Clients.
+ * allocations.  It also holds info about Session Clients.
  *
  * Memory is assigned to the Truflow instance by way of
  * tf_open_session. Memory is allocated and owned by i.e. ULP.
@@ -86,19 +85,6 @@ struct tf_session {
 	 */
 	bool shared_session_creator;
 
-	/**
-	 * Boolean controlling the use and availability of shadow
-	 * copy. Shadow copy will allow the TruFlow Core to keep track
-	 * of resource content on the firmware side without having to
-	 * query firmware. Additional private session core_data will
-	 * be allocated if this boolean is set to 'true', default
-	 * 'false'.
-	 *
-	 * Size of memory depends on the NVM Resource settings for the
-	 * control channel.
-	 */
-	bool shadow_copy;
-
 	/**
 	 * Session Reference Count. To keep track of functions per
 	 * session the ref_count is updated. There is also a
@@ -159,12 +145,10 @@ struct tf_session {
 	 */
 	void *em_pool[TF_DIR_MAX];
 
-#ifdef TF_TCAM_SHARED
 	/**
 	 * tcam db reference for the session
 	 */
 	void *tcam_shared_db_handle;
-#endif /* TF_TCAM_SHARED */
 
 	/**
 	 * SRAM db reference for the session
diff --git a/drivers/net/bnxt/tf_core/tf_shadow_identifier.c b/drivers/net/bnxt/tf_core/tf_shadow_identifier.c
deleted file mode 100644
index dc9606712c..0000000000
--- a/drivers/net/bnxt/tf_core/tf_shadow_identifier.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2019-2021 Broadcom
- * All rights reserved.
- */
-
-#include <rte_common.h>
-
-#include "tf_shadow_identifier.h"
-#include "tf_common.h"
-#include "tf_util.h"
-#include "tfp.h"
-
-/**
- * Shadow identifier DB element
- */
-struct tf_shadow_ident_element {
-	/**
-	 * Identifier
-	 */
-	uint32_t *id;
-
-	/**
-	 * Reference count, array of number of identifier type entries
-	 */
-	uint32_t *ref_count;
-};
-
-/**
- * Shadow identifier DB definition
- */
-struct tf_shadow_ident_db {
-	/**
-	 * Number of elements in the DB
-	 */
-	uint16_t num_entries;
-
-	/**
-	 * The DB consists of an array of elements
-	 */
-	struct tf_shadow_ident_element *db;
-};
-
-int
-tf_shadow_ident_create_db(struct tf_shadow_ident_create_db_parms *parms)
-{
-	int rc;
-	int i;
-	struct tfp_calloc_parms cparms;
-	struct tf_shadow_ident_db *shadow_db;
-	struct tf_shadow_ident_element *db;
-
-	TF_CHECK_PARMS1(parms);
-
-	/* Build the shadow DB per the request */
-	cparms.nitems = 1;
-	cparms.size = sizeof(struct tf_shadow_ident_db);
-	cparms.alignment = 0;
-	rc = tfp_calloc(&cparms);
-	if (rc)
-		return rc;
-	shadow_db = (void *)cparms.mem_va;
-
-	/* Build the DB within shadow DB */
-	cparms.nitems = parms->num_elements;
-	cparms.size = sizeof(struct tf_shadow_ident_element);
-	rc = tfp_calloc(&cparms);
-	if (rc)
-		return rc;
-	shadow_db->db = (struct tf_shadow_ident_element *)cparms.mem_va;
-	shadow_db->num_entries = parms->num_elements;
-
-	db = shadow_db->db;
-	for (i = 0; i < parms->num_elements; i++) {
-		/* If the element didn't request an allocation no need
-		 * to create a pool nor verify if we got a reservation.
-		 */
-		if (parms->cfg->alloc_cnt[i] == 0)
-			continue;
-
-		/* Create array */
-		cparms.nitems = parms->cfg->alloc_cnt[i];
-		cparms.size = sizeof(uint32_t);
-		rc = tfp_calloc(&cparms);
-		if (rc) {
-			TFP_DRV_LOG(ERR,
-				    "%s: Array alloc failed, type:%d\n",
-				    tf_dir_2_str(parms->dir),
-				    i);
-			goto fail;
-		}
-		db[i].ref_count = (uint32_t *)cparms.mem_va;
-	}
-
-	*parms->tf_shadow_ident_db = (void *)shadow_db;
-
-	return 0;
-fail:
-	tfp_free((void *)db->ref_count);
-	tfp_free((void *)db);
-	tfp_free((void *)shadow_db);
-	parms->tf_shadow_ident_db = NULL;
-
-	return -EINVAL;
-}
-
-int
-tf_shadow_ident_free_db(struct tf_shadow_ident_free_db_parms *parms)
-{
-	int i;
-	struct tf_shadow_ident_db *shadow_db;
-
-	TF_CHECK_PARMS1(parms);
-
-	shadow_db = (struct tf_shadow_ident_db *)parms->tf_shadow_ident_db;
-	for (i = 0; i < shadow_db->num_entries; i++)
-		tfp_free((void *)shadow_db->db[i].ref_count);
-
-	tfp_free((void *)shadow_db->db);
-	tfp_free((void *)parms->tf_shadow_ident_db);
-
-	return 0;
-}
-
-int
-tf_shadow_ident_search(struct tf_shadow_ident_search_parms *parms)
-{
-	struct tf_shadow_ident_db *shadow_db;
-	uint32_t ref_cnt = 0;
-
-	TF_CHECK_PARMS1(parms);
-
-	shadow_db = (struct tf_shadow_ident_db *)parms->tf_shadow_ident_db;
-	ref_cnt = shadow_db->db[parms->type].ref_count[parms->search_id];
-	if (ref_cnt > 0) {
-		*parms->hit = 1;
-		*parms->ref_cnt = ++ref_cnt;
-		shadow_db->db[parms->type].ref_count[parms->search_id] =
-								ref_cnt;
-	} else {
-		*parms->hit = 0;
-		*parms->ref_cnt = 0;
-	}
-
-
-	return 0;
-}
-
-#define ID_REF_CNT_MAX 0xffffffff
-int
-tf_shadow_ident_insert(struct tf_shadow_ident_insert_parms *parms)
-{
-	struct tf_shadow_ident_db *shadow_db;
-
-	TF_CHECK_PARMS1(parms);
-
-	shadow_db = (struct tf_shadow_ident_db *)parms->tf_shadow_ident_db;
-
-	/* In case of overflow, ref count keeps the max value */
-	if (shadow_db->db[parms->type].ref_count[parms->id] < ID_REF_CNT_MAX)
-		shadow_db->db[parms->type].ref_count[parms->id]++;
-	else
-		TFP_DRV_LOG(ERR,
-			    "Identifier %d in type %d reaches the max ref_cnt\n",
-			    parms->type,
-			    parms->id);
-
-	parms->ref_cnt = shadow_db->db[parms->type].ref_count[parms->id];
-
-	return 0;
-}
-
-int
-tf_shadow_ident_remove(struct tf_shadow_ident_remove_parms *parms)
-{
-	struct tf_shadow_ident_db *shadow_db;
-	uint32_t ref_cnt = 0;
-
-	TF_CHECK_PARMS1(parms);
-
-	shadow_db = (struct tf_shadow_ident_db *)parms->tf_shadow_ident_db;
-	ref_cnt = shadow_db->db[parms->type].ref_count[parms->id];
-	if (ref_cnt > 0)
-		shadow_db->db[parms->type].ref_count[parms->id]--;
-	else
-		return -EINVAL;
-
-	*parms->ref_cnt = shadow_db->db[parms->type].ref_count[parms->id];
-
-	return 0;
-}
diff --git a/drivers/net/bnxt/tf_core/tf_shadow_identifier.h b/drivers/net/bnxt/tf_core/tf_shadow_identifier.h
deleted file mode 100644
index ff41eaad9f..0000000000
--- a/drivers/net/bnxt/tf_core/tf_shadow_identifier.h
+++ /dev/null
@@ -1,229 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2019-2021 Broadcom
- * All rights reserved.
- */
-
-#ifndef _TF_SHADOW_IDENTIFIER_H_
-#define _TF_SHADOW_IDENTIFIER_H_
-
-#include "tf_core.h"
-
-struct tf;
-
-/**
- * The Shadow Identifier module provides shadow DB handling for identifier based
- * TF types. A shadow DB provides the capability that allows for reuse
- * of TF resources.
- *
- * A Shadow identifier DB is intended to be used by the Identifier Type module
- * only.
- */
-
-/**
- * Shadow DB configuration information for a single identifier type.
- *
- * It is used in an array of identifier types. The array must be ordered
- * by the TF type is represents.
- */
-struct tf_shadow_ident_cfg_parms {
-	/**
-	 * TF Identifier type
-	 */
-	enum tf_identifier_type type;
-
-	/**
-	 * Number of entries the Shadow DB needs to hold
-	 */
-	int num_entries;
-
-	/**
-	 * Resource allocation count array. This array content
-	 * originates from the tf_session_resources that is passed in
-	 * on session open.
-	 * Array size is num_elements.
-	 */
-	uint16_t *alloc_cnt;
-};
-
-/**
- * Shadow identifier DB creation parameters
- */
-struct tf_shadow_ident_create_db_parms {
-	/**
-	 * [in] Receive or transmit direction.
-	 */
-	enum tf_dir dir;
-	/**
-	 * [in] Configuration information for the shadow db
-	 */
-	struct tf_shadow_ident_cfg_parms *cfg;
-	/**
-	 * [in] Number of elements in the parms structure
-	 */
-	uint16_t num_elements;
-	/**
-	 * [out] Shadow identifier DB handle
-	 */
-	void **tf_shadow_ident_db;
-};
-
-/**
- * Shadow identifier DB free parameters
- */
-struct tf_shadow_ident_free_db_parms {
-	/**
-	 * Shadow identifier DB handle
-	 */
-	void *tf_shadow_ident_db;
-};
-
-/**
- * Shadow identifier search parameters
- */
-struct tf_shadow_ident_search_parms {
-	/**
-	 * [in] Shadow identifier DB handle
-	 */
-	void *tf_shadow_ident_db;
-	/**
-	 * [in] Identifier type
-	 */
-	enum tf_identifier_type type;
-	/**
-	 * [in] id to search
-	 */
-	uint16_t search_id;
-	/**
-	 * [out] Index of the found element returned if hit
-	 */
-	bool *hit;
-	/**
-	 * [out] Reference count incremented if hit
-	 */
-	uint32_t *ref_cnt;
-};
-
-/**
- * Shadow identifier insert parameters
- */
-struct tf_shadow_ident_insert_parms {
-	/**
-	 * [in] Shadow identifier DB handle
-	 */
-	void *tf_shadow_ident_db;
-	/**
-	 * [in] Tbl type
-	 */
-	enum tf_identifier_type type;
-	/**
-	 * [in] Entry to update
-	 */
-	uint16_t id;
-	/**
-	 * [out] Reference count after insert
-	 */
-	uint32_t ref_cnt;
-};
-
-/**
- * Shadow identifier remove parameters
- */
-struct tf_shadow_ident_remove_parms {
-	/**
-	 * [in] Shadow identifier DB handle
-	 */
-	void *tf_shadow_ident_db;
-	/**
-	 * [in] Tbl type
-	 */
-	enum tf_identifier_type type;
-	/**
-	 * [in] Entry to update
-	 */
-	uint16_t id;
-	/**
-	 * [out] Reference count after removal
-	 */
-	uint32_t *ref_cnt;
-};
-
-/**
- * @page shadow_ident Shadow identifier DB
- *
- * @ref tf_shadow_ident_create_db
- *
- * @ref tf_shadow_ident_free_db
- *
- * @reg tf_shadow_ident_search
- *
- * @reg tf_shadow_ident_insert
- *
- * @reg tf_shadow_ident_remove
- */
-
-/**
- * Creates and fills a Shadow identifier DB. The DB is indexed per the
- * parms structure.
- *
- * [in] parms
- *   Pointer to create db parameters
- *
- * Returns
- *   - (0) if successful.
- *   - (-EINVAL) on failure.
- */
-int tf_shadow_ident_create_db(struct tf_shadow_ident_create_db_parms *parms);
-
-/**
- * Closes the Shadow identifier DB and frees all allocated
- * resources per the associated database.
- *
- * [in] parms
- *   Pointer to the free DB parameters
- *
- * Returns
- *   - (0) if successful.
- *   - (-EINVAL) on failure.
- */
-int tf_shadow_ident_free_db(struct tf_shadow_ident_free_db_parms *parms);
-
-/**
- * Search Shadow identifier db for matching result
- *
- * [in] parms
- *   Pointer to the search parameters
- *
- * Returns
- *   - (0) if successful, element was found.
- *   - (-EINVAL) on failure.
- */
-int tf_shadow_ident_search(struct tf_shadow_ident_search_parms *parms);
-
-/**
- * Inserts an element into the Shadow identifier DB. Ref_count after insert
- * will be incremented.
- *
- * [in] parms
- *   Pointer to insert parameters
- *
- * Returns
- *   - (0) if successful.
- *   - (-EINVAL) on failure.
- */
-int tf_shadow_ident_insert(struct tf_shadow_ident_insert_parms *parms);
-
-/**
- * Removes an element from the Shadow identifier DB. Will fail if the
- * elements ref_count is 0. Ref_count after removal will be
- * decremented.
- *
- * [in] parms
- *   Pointer to remove parameter
- *
- * Returns
- *   - (0) if successful.
- *   - (-EINVAL) on failure.
- */
-int tf_shadow_ident_remove(struct tf_shadow_ident_remove_parms *parms);
-
-#endif /* _TF_SHADOW_IDENTIFIER_H_ */
diff --git a/drivers/net/bnxt/tf_core/tf_shadow_tcam.c b/drivers/net/bnxt/tf_core/tf_shadow_tcam.c
deleted file mode 100644
index 5fcd1f9107..0000000000
--- a/drivers/net/bnxt/tf_core/tf_shadow_tcam.c
+++ /dev/null
@@ -1,837 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2019-2021 Broadcom
- * All rights reserved.
- */
-
-#include "tf_common.h"
-#include "tf_util.h"
-#include "tfp.h"
-#include "tf_tcam.h"
-#include "tf_shadow_tcam.h"
-#include "tf_hash.h"
-
-/**
- * The implementation includes 3 tables per tcam table type.
- * - hash table
- *   - sized so that a minimum of 4 slots per shadow entry are available to
- *   minimize the likelihood of collisions.
- * - shadow key table
- *   - sized to the number of entries requested and is directly indexed
- *   - the index is zero based and is the tcam index - the base address
- *   - the key and mask are stored in the key table.
- *   - The stored key is the AND of the key/mask in order to eliminate the need
- *   to compare both the key and mask.
- * - shadow result table
- *   - the result table is stored separately since it only needs to be accessed
- *   when the key matches.
- *   - the result has a back pointer to the hash table via the hb handle.  The
- *   hb handle is a 32 bit representation of the hash with a valid bit, bucket
- *   element index, and the hash index.  It is necessary to store the hb handle
- *   with the result since subsequent removes only provide the tcam index.
- *
- * - Max entries is limited in the current implementation since bit 15 is the
- *   valid bit in the hash table.
- * - A 16bit hash is calculated and masked based on the number of entries
- * - 64b wide bucket is used and broken into 4x16bit elements.
- *   This decision is based on quicker bucket scanning to determine if any
- *   elements are in use.
- * - bit 15 of each bucket element is the valid, this is done to prevent having
- *   to read the larger key/result data for determining VALID.  It also aids
- *   in the more efficient scanning of the bucket for slot usage.
- */
-
-/*
- * The maximum number of shadow entries supported.  The value also doubles as
- * the maximum number of hash buckets.  There are only 15 bits of data per
- * bucket to point to the shadow tables.
- */
-#define TF_SHADOW_TCAM_ENTRIES_MAX (1 << 15)
-
-/* The number of elements(BE) per hash bucket (HB) */
-#define TF_SHADOW_TCAM_HB_NUM_ELEM (4)
-#define TF_SHADOW_TCAM_BE_VALID (1 << 15)
-#define TF_SHADOW_TCAM_BE_IS_VALID(be) (((be) & TF_SHADOW_TCAM_BE_VALID) != 0)
-
-/**
- * The hash bucket handle is 32b
- * - bit 31, the Valid bit
- * - bit 29-30, the element
- * - bits 0-15, the hash idx (is masked based on the allocated size)
- */
-#define TF_SHADOW_TCAM_HB_HANDLE_IS_VALID(hndl) (((hndl) & (1 << 31)) != 0)
-#define TF_SHADOW_TCAM_HB_HANDLE_CREATE(idx, be) ((1 << 31) | \
-						  ((be) << 29) | (idx))
-
-#define TF_SHADOW_TCAM_HB_HANDLE_BE_GET(hdl) (((hdl) >> 29) & \
-					      (TF_SHADOW_TCAM_HB_NUM_ELEM - 1))
-
-#define TF_SHADOW_TCAM_HB_HANDLE_HASH_GET(ctxt, hdl)((hdl) & \
-						     (ctxt)->hash_ctxt.hid_mask)
-
-/**
- * The idx provided by the caller is within a region, so currently the base is
- * either added or subtracted from the idx to ensure it can be used as a
- * compressed index
- */
-
-/* Convert the tcam index to a shadow index */
-#define TF_SHADOW_TCAM_IDX_TO_SHIDX(ctxt, idx) ((idx) - \
-						(ctxt)->shadow_ctxt.base_addr)
-
-/* Convert the shadow index to a tcam index */
-#define TF_SHADOW_TCAM_SHIDX_TO_IDX(ctxt, idx) ((idx) + \
-						(ctxt)->shadow_ctxt.base_addr)
-
-/* Simple helper masks for clearing en element from the bucket */
-#define TF_SHADOW_TCAM_BE0_MASK_CLEAR(hb) ((hb) & 0xffffffffffff0000ull)
-#define TF_SHADOW_TCAM_BE1_MASK_CLEAR(hb) ((hb) & 0xffffffff0000ffffull)
-#define TF_SHADOW_TCAM_BE2_MASK_CLEAR(hb) ((hb) & 0xffff0000ffffffffull)
-#define TF_SHADOW_TCAM_BE3_MASK_CLEAR(hb) ((hb) & 0x0000ffffffffffffull)
-
-/**
- * This should be coming from external, but for now it is assumed that no key
- * is greater than 1K bits and no result is bigger than 128 bits.  This makes
- * allocation of the hash table easier without having to allocate on the fly.
- */
-#define TF_SHADOW_TCAM_MAX_KEY_SZ 128
-#define TF_SHADOW_TCAM_MAX_RESULT_SZ 16
-
-/*
- * Local only defines for the internal data.
- */
-
-/**
- * tf_shadow_tcam_shadow_key_entry is the key/mask entry of the key table.
- * The key stored in the table is the masked version of the key.  This is done
- * to eliminate the need of comparing both the key and mask.
- */
-struct tf_shadow_tcam_shadow_key_entry {
-	uint8_t key[TF_SHADOW_TCAM_MAX_KEY_SZ];
-	uint8_t mask[TF_SHADOW_TCAM_MAX_KEY_SZ];
-};
-
-/**
- * tf_shadow_tcam_shadow_result_entry is the result table entry.
- * The result table writes are broken into two phases:
- * - The search phase, which stores the hb_handle and key size and
- * - The set phase, which writes the result, refcnt, and result size
- */
-struct tf_shadow_tcam_shadow_result_entry {
-	uint8_t result[TF_SHADOW_TCAM_MAX_RESULT_SZ];
-	uint16_t result_size;
-	uint16_t key_size;
-	uint32_t refcnt;
-	uint32_t hb_handle;
-};
-
-/**
- * tf_shadow_tcam_shadow_ctxt holds all information for accessing the key and
- * result tables.
- */
-struct tf_shadow_tcam_shadow_ctxt {
-	struct tf_shadow_tcam_shadow_key_entry *sh_key_tbl;
-	struct tf_shadow_tcam_shadow_result_entry *sh_res_tbl;
-	uint32_t base_addr;
-	uint16_t num_entries;
-	uint16_t alloc_idx;
-};
-
-/**
- * tf_shadow_tcam_hash_ctxt holds all information related to accessing the hash
- * table.
- */
-struct tf_shadow_tcam_hash_ctxt {
-	uint64_t *hashtbl;
-	uint16_t hid_mask;
-	uint16_t hash_entries;
-};
-
-/**
- * tf_shadow_tcam_ctxt holds the hash and shadow tables for the current shadow
- * tcam db.  This structure is per tcam table type as each tcam table has it's
- * own shadow and hash table.
- */
-struct tf_shadow_tcam_ctxt {
-	struct tf_shadow_tcam_shadow_ctxt shadow_ctxt;
-	struct tf_shadow_tcam_hash_ctxt hash_ctxt;
-};
-
-/**
- * tf_shadow_tcam_db is the allocated db structure returned as an opaque
- * void * pointer to the caller during create db.  It holds the pointers for
- * each tcam associated with the db.
- */
-struct tf_shadow_tcam_db {
-	/* Each context holds the shadow and hash table information */
-	struct tf_shadow_tcam_ctxt *ctxt[TF_TCAM_TBL_TYPE_MAX];
-};
-
-/**
- * Returns the number of entries in the contexts shadow table.
- */
-static inline uint16_t
-tf_shadow_tcam_sh_num_entries_get(struct tf_shadow_tcam_ctxt *ctxt)
-{
-	return ctxt->shadow_ctxt.num_entries;
-}
-
-/**
- * Compare the give key with the key in the shadow table.
- *
- * Returns 0 if the keys match
- */
-static int
-tf_shadow_tcam_key_cmp(struct tf_shadow_tcam_ctxt *ctxt,
-		       uint8_t *key,
-		       uint8_t *mask,
-		       uint16_t sh_idx,
-		       uint16_t size)
-{
-	if (size != ctxt->shadow_ctxt.sh_res_tbl[sh_idx].key_size ||
-	    sh_idx >= tf_shadow_tcam_sh_num_entries_get(ctxt) || !key || !mask)
-		return -1;
-
-	return memcmp(key, ctxt->shadow_ctxt.sh_key_tbl[sh_idx].key, size);
-}
-
-/**
- * Copies the shadow result to the result.
- *
- * Returns 0 on failure
- */
-static void *
-tf_shadow_tcam_res_cpy(struct tf_shadow_tcam_ctxt *ctxt,
-		       uint8_t *result,
-		       uint16_t sh_idx,
-		       uint16_t size)
-{
-	if (sh_idx >= tf_shadow_tcam_sh_num_entries_get(ctxt) || !result)
-		return 0;
-
-	if (ctxt->shadow_ctxt.sh_res_tbl[sh_idx].result_size != size)
-		return 0;
-
-	return memcpy(result,
-		      ctxt->shadow_ctxt.sh_res_tbl[sh_idx].result,
-		      size);
-}
-
-/**
- * Using a software based CRC function for now, but will look into using hw
- * assisted in the future.
- */
-static uint32_t
-tf_shadow_tcam_crc32_calc(uint8_t *key, uint32_t len)
-{
-	return tf_hash_calc_crc32(key, len);
-}
-
-/**
- * Free the memory associated with the context.
- */
-static void
-tf_shadow_tcam_ctxt_delete(struct tf_shadow_tcam_ctxt *ctxt)
-{
-	if (!ctxt)
-		return;
-
-	tfp_free(ctxt->hash_ctxt.hashtbl);
-	tfp_free(ctxt->shadow_ctxt.sh_key_tbl);
-	tfp_free(ctxt->shadow_ctxt.sh_res_tbl);
-}
-
-/**
- * The TF Shadow TCAM context is per TCAM and holds all information relating to
- * managing the shadow and search capability.  This routine allocated data that
- * needs to be deallocated by the tf_shadow_tcam_ctxt_delete prior when deleting
- * the shadow db.
- */
-static int
-tf_shadow_tcam_ctxt_create(struct tf_shadow_tcam_ctxt *ctxt,
-			   uint16_t num_entries,
-			   uint16_t base_addr)
-{
-	struct tfp_calloc_parms cparms;
-	uint16_t hash_size = 1;
-	uint16_t hash_mask;
-	int rc;
-
-	/* Hash table is a power of two that holds the number of entries */
-	if (num_entries > TF_SHADOW_TCAM_ENTRIES_MAX) {
-		TFP_DRV_LOG(ERR, "Too many entries for shadow %d > %d\n",
-			    num_entries,
-			    TF_SHADOW_TCAM_ENTRIES_MAX);
-		return -ENOMEM;
-	}
-
-	while (hash_size < num_entries)
-		hash_size = hash_size << 1;
-
-	hash_mask = hash_size - 1;
-
-	/* Allocate the hash table */
-	cparms.nitems = hash_size;
-	cparms.size = sizeof(uint64_t);
-	cparms.alignment = 0;
-	rc = tfp_calloc(&cparms);
-	if (rc)
-		goto error;
-	ctxt->hash_ctxt.hashtbl = cparms.mem_va;
-	ctxt->hash_ctxt.hid_mask = hash_mask;
-	ctxt->hash_ctxt.hash_entries = hash_size;
-
-	/* allocate the shadow tables */
-	/* allocate the shadow key table */
-	cparms.nitems = num_entries;
-	cparms.size = sizeof(struct tf_shadow_tcam_shadow_key_entry);
-	cparms.alignment = 0;
-	rc = tfp_calloc(&cparms);
-	if (rc)
-		goto error;
-	ctxt->shadow_ctxt.sh_key_tbl = cparms.mem_va;
-
-	/* allocate the shadow result table */
-	cparms.nitems = num_entries;
-	cparms.size = sizeof(struct tf_shadow_tcam_shadow_result_entry);
-	cparms.alignment = 0;
-	rc = tfp_calloc(&cparms);
-	if (rc)
-		goto error;
-	ctxt->shadow_ctxt.sh_res_tbl = cparms.mem_va;
-
-	ctxt->shadow_ctxt.num_entries = num_entries;
-	ctxt->shadow_ctxt.base_addr = base_addr;
-
-	return 0;
-error:
-	tf_shadow_tcam_ctxt_delete(ctxt);
-
-	return -ENOMEM;
-}
-
-/**
- * Get a shadow TCAM context given the db and the TCAM type
- */
-static struct tf_shadow_tcam_ctxt *
-tf_shadow_tcam_ctxt_get(struct tf_shadow_tcam_db *shadow_db,
-			enum tf_tcam_tbl_type type)
-{
-	if (type >= TF_TCAM_TBL_TYPE_MAX ||
-	    !shadow_db ||
-	    !shadow_db->ctxt[type])
-		return NULL;
-
-	return shadow_db->ctxt[type];
-}
-
-/**
- * Sets the hash entry into the table given the TCAM context, hash bucket
- * handle, and shadow index.
- */
-static inline int
-tf_shadow_tcam_set_hash_entry(struct tf_shadow_tcam_ctxt *ctxt,
-			      uint32_t hb_handle,
-			      uint16_t sh_idx)
-{
-	uint16_t hid = TF_SHADOW_TCAM_HB_HANDLE_HASH_GET(ctxt, hb_handle);
-	uint16_t be = TF_SHADOW_TCAM_HB_HANDLE_BE_GET(hb_handle);
-	uint64_t entry = sh_idx | TF_SHADOW_TCAM_BE_VALID;
-
-	if (hid >= ctxt->hash_ctxt.hash_entries)
-		return -EINVAL;
-
-	ctxt->hash_ctxt.hashtbl[hid] |= entry << (be * 16);
-	return 0;
-}
-
-/**
- * Clears the hash entry given the TCAM context and hash bucket handle.
- */
-static inline void
-tf_shadow_tcam_clear_hash_entry(struct tf_shadow_tcam_ctxt *ctxt,
-				uint32_t hb_handle)
-{
-	uint16_t hid, be;
-	uint64_t *bucket;
-
-	if (!TF_SHADOW_TCAM_HB_HANDLE_IS_VALID(hb_handle))
-		return;
-
-	hid = TF_SHADOW_TCAM_HB_HANDLE_HASH_GET(ctxt, hb_handle);
-	be = TF_SHADOW_TCAM_HB_HANDLE_BE_GET(hb_handle);
-	bucket = &ctxt->hash_ctxt.hashtbl[hid];
-
-	switch (be) {
-	case 0:
-		*bucket = TF_SHADOW_TCAM_BE0_MASK_CLEAR(*bucket);
-		break;
-	case 1:
-		*bucket = TF_SHADOW_TCAM_BE1_MASK_CLEAR(*bucket);
-		break;
-	case 2:
-		*bucket = TF_SHADOW_TCAM_BE2_MASK_CLEAR(*bucket);
-		break;
-	case 3:
-		*bucket = TF_SHADOW_TCAM_BE2_MASK_CLEAR(*bucket);
-		break;
-	default:
-		/*
-		 * Since the BE_GET masks non-inclusive bits, this will not
-		 * happen.
-		 */
-		break;
-	}
-}
-
-/**
- * Clears the shadow key and result entries given the TCAM context and
- * shadow index.
- */
-static void
-tf_shadow_tcam_clear_sh_entry(struct tf_shadow_tcam_ctxt *ctxt,
-			      uint16_t sh_idx)
-{
-	struct tf_shadow_tcam_shadow_key_entry *sk_entry;
-	struct tf_shadow_tcam_shadow_result_entry *sr_entry;
-
-	if (sh_idx >= tf_shadow_tcam_sh_num_entries_get(ctxt))
-		return;
-
-	sk_entry = &ctxt->shadow_ctxt.sh_key_tbl[sh_idx];
-	sr_entry = &ctxt->shadow_ctxt.sh_res_tbl[sh_idx];
-
-	/*
-	 * memset key/result to zero for now, possibly leave the data alone
-	 * in the future and rely on the valid bit in the hash table.
-	 */
-	memset(sk_entry, 0, sizeof(struct tf_shadow_tcam_shadow_key_entry));
-	memset(sr_entry, 0, sizeof(struct tf_shadow_tcam_shadow_result_entry));
-}
-
-/**
- * Binds the allocated tcam index with the hash and shadow tables.
- * The entry will be incomplete until the set has happened with the result
- * data.
- */
-int
-tf_shadow_tcam_bind_index(struct tf_shadow_tcam_bind_index_parms *parms)
-{
-	int rc;
-	int i;
-	uint16_t idx, klen;
-	struct tf_shadow_tcam_ctxt *ctxt;
-	struct tf_shadow_tcam_db *shadow_db;
-	struct tf_shadow_tcam_shadow_key_entry *sk_entry;
-	struct tf_shadow_tcam_shadow_result_entry *sr_entry;
-	uint8_t tkey[TF_SHADOW_TCAM_MAX_KEY_SZ];
-
-	if (!parms || !TF_SHADOW_TCAM_HB_HANDLE_IS_VALID(parms->hb_handle) ||
-	    !parms->key || !parms->mask) {
-		TFP_DRV_LOG(ERR, "Invalid parms\n");
-		return -EINVAL;
-	}
-
-	shadow_db = (struct tf_shadow_tcam_db *)parms->shadow_db;
-	ctxt = tf_shadow_tcam_ctxt_get(shadow_db, parms->type);
-	if (!ctxt) {
-		TFP_DRV_LOG(DEBUG, "%s no ctxt for table\n",
-			    tf_tcam_tbl_2_str(parms->type));
-		return -EINVAL;
-	}
-
-	memset(tkey, 0, sizeof(tkey));
-	idx = TF_SHADOW_TCAM_IDX_TO_SHIDX(ctxt, parms->idx);
-	klen = parms->key_size;
-	if (idx >= tf_shadow_tcam_sh_num_entries_get(ctxt) ||
-	    klen > TF_SHADOW_TCAM_MAX_KEY_SZ) {
-		TFP_DRV_LOG(ERR, "%s:%s Invalid len (%d) > %d || oob idx %d\n",
-			    tf_dir_2_str(parms->dir),
-			    tf_tcam_tbl_2_str(parms->type),
-			    klen,
-			    TF_SHADOW_TCAM_MAX_KEY_SZ, idx);
-
-		return -EINVAL;
-	}
-
-	rc = tf_shadow_tcam_set_hash_entry(ctxt, parms->hb_handle, idx);
-	if (rc)
-		return -EINVAL;
-
-	sk_entry = &ctxt->shadow_ctxt.sh_key_tbl[idx];
-	sr_entry = &ctxt->shadow_ctxt.sh_res_tbl[idx];
-
-	/*
-	 * Write the masked key to the table for more efficient comparisons
-	 * later.
-	 */
-	for (i = 0; i < klen; i++)
-		tkey[i] = parms->key[i] & parms->mask[i];
-
-	memcpy(sk_entry->key, tkey, klen);
-	memcpy(sk_entry->mask, parms->mask, klen);
-
-	/* Write the result table */
-	sr_entry->key_size = parms->key_size;
-	sr_entry->hb_handle = parms->hb_handle;
-	sr_entry->refcnt = 1;
-
-	return 0;
-}
-
-/**
- * Deletes hash/shadow information if no more references.
- *
- * Returns 0 - The caller should delete the tcam entry in hardware.
- * Returns non-zero - The number of references to the entry
- */
-int
-tf_shadow_tcam_remove(struct tf_shadow_tcam_remove_parms *parms)
-{
-	uint16_t idx;
-	uint32_t hb_handle;
-	struct tf_shadow_tcam_ctxt *ctxt;
-	struct tf_shadow_tcam_db *shadow_db;
-	struct tf_tcam_free_parms *fparms;
-	struct tf_shadow_tcam_shadow_result_entry *sr_entry;
-
-	if (!parms || !parms->fparms) {
-		TFP_DRV_LOG(ERR, "Invalid parms\n");
-		return -EINVAL;
-	}
-
-	fparms = parms->fparms;
-
-	/*
-	 * Initialize the reference count to zero.  It will only be changed if
-	 * non-zero.
-	 */
-	fparms->ref_cnt = 0;
-
-	shadow_db = (struct tf_shadow_tcam_db *)parms->shadow_db;
-	ctxt = tf_shadow_tcam_ctxt_get(shadow_db, fparms->type);
-	if (!ctxt) {
-		TFP_DRV_LOG(DEBUG, "%s no ctxt for table\n",
-			    tf_tcam_tbl_2_str(fparms->type));
-		return 0;
-	}
-
-	idx = TF_SHADOW_TCAM_IDX_TO_SHIDX(ctxt, fparms->idx);
-	if (idx >= tf_shadow_tcam_sh_num_entries_get(ctxt)) {
-		TFP_DRV_LOG(DEBUG, "%s %d >= %d\n",
-			    tf_tcam_tbl_2_str(fparms->type),
-			    fparms->idx,
-			    tf_shadow_tcam_sh_num_entries_get(ctxt));
-		return 0;
-	}
-
-	sr_entry = &ctxt->shadow_ctxt.sh_res_tbl[idx];
-	if (sr_entry->refcnt <= 1) {
-		hb_handle = sr_entry->hb_handle;
-		tf_shadow_tcam_clear_hash_entry(ctxt, hb_handle);
-		tf_shadow_tcam_clear_sh_entry(ctxt, idx);
-	} else {
-		sr_entry->refcnt--;
-		fparms->ref_cnt = sr_entry->refcnt;
-	}
-
-	return 0;
-}
-
-int
-tf_shadow_tcam_search(struct tf_shadow_tcam_search_parms *parms)
-{
-	uint16_t len;
-	uint8_t rcopy;
-	uint64_t bucket;
-	uint32_t i, hid32;
-	struct tf_shadow_tcam_ctxt *ctxt;
-	struct tf_shadow_tcam_db *shadow_db;
-	uint16_t hid16, hb_idx, hid_mask, shtbl_idx, shtbl_key, be_valid;
-	struct tf_tcam_alloc_search_parms *sparms;
-	uint8_t tkey[TF_SHADOW_TCAM_MAX_KEY_SZ];
-	uint32_t be_avail = TF_SHADOW_TCAM_HB_NUM_ELEM;
-
-	if (!parms || !parms->sparms) {
-		TFP_DRV_LOG(ERR, "tcam search with invalid parms\n");
-		return -EINVAL;
-	}
-
-	memset(tkey, 0, sizeof(tkey));
-	sparms = parms->sparms;
-
-	/* Initialize return values to invalid */
-	sparms->hit = 0;
-	sparms->search_status = REJECT;
-	parms->hb_handle = 0;
-	sparms->ref_cnt = 0;
-	/* see if caller wanted the result */
-	rcopy = sparms->result && sparms->result_size;
-
-	shadow_db = (struct tf_shadow_tcam_db *)parms->shadow_db;
-	ctxt = tf_shadow_tcam_ctxt_get(shadow_db, sparms->type);
-	if (!ctxt) {
-		TFP_DRV_LOG(ERR, "%s Unable to get tcam mgr context\n",
-			    tf_tcam_tbl_2_str(sparms->type));
-		return -EINVAL;
-	}
-
-	hid_mask = ctxt->hash_ctxt.hid_mask;
-
-	len = sparms->key_size;
-
-	if (len > TF_SHADOW_TCAM_MAX_KEY_SZ ||
-	    !sparms->key || !sparms->mask || !len) {
-		TFP_DRV_LOG(ERR, "%s:%s Invalid parms %d : %p : %p\n",
-			    tf_dir_2_str(sparms->dir),
-			    tf_tcam_tbl_2_str(sparms->type),
-			    len,
-			    sparms->key,
-			    sparms->mask);
-		return -EINVAL;
-	}
-
-	/* Combine the key and mask */
-	for (i = 0; i < len; i++)
-		tkey[i] = sparms->key[i] & sparms->mask[i];
-
-	/*
-	 * Calculate the crc32
-	 * Fold it to create a 16b value
-	 * Reduce it to fit the table
-	 */
-	hid32 = tf_shadow_tcam_crc32_calc(tkey, len);
-	hid16 = (uint16_t)(((hid32 >> 16) & 0xffff) ^ (hid32 & 0xffff));
-	hb_idx = hid16 & hid_mask;
-
-	bucket = ctxt->hash_ctxt.hashtbl[hb_idx];
-
-	if (!bucket) {
-		/* empty bucket means a miss and available entry */
-		sparms->search_status = MISS;
-		parms->hb_handle = TF_SHADOW_TCAM_HB_HANDLE_CREATE(hb_idx, 0);
-		sparms->idx = 0;
-		return 0;
-	}
-
-	/* Set the avail to max so we can detect when there is an avail entry */
-	be_avail = TF_SHADOW_TCAM_HB_NUM_ELEM;
-	for (i = 0; i < TF_SHADOW_TCAM_HB_NUM_ELEM; i++) {
-		shtbl_idx = (uint16_t)((bucket >> (i * 16)) & 0xffff);
-		be_valid = TF_SHADOW_TCAM_BE_IS_VALID(shtbl_idx);
-		if (!be_valid) {
-			/* The element is avail, keep going */
-			be_avail = i;
-			continue;
-		}
-		/* There is a valid entry, compare it */
-		shtbl_key = shtbl_idx & ~TF_SHADOW_TCAM_BE_VALID;
-		if (!tf_shadow_tcam_key_cmp(ctxt,
-					    sparms->key,
-					    sparms->mask,
-					    shtbl_key,
-					    sparms->key_size)) {
-			/*
-			 * It matches, increment the ref count if the caller
-			 * requested allocation and return the info
-			 */
-			if (sparms->alloc)
-				ctxt->shadow_ctxt.sh_res_tbl[shtbl_key].refcnt++;
-
-			sparms->hit = 1;
-			sparms->search_status = HIT;
-			parms->hb_handle =
-				TF_SHADOW_TCAM_HB_HANDLE_CREATE(hb_idx, i);
-			sparms->idx = TF_SHADOW_TCAM_SHIDX_TO_IDX(ctxt,
-								  shtbl_key);
-			sparms->ref_cnt =
-				ctxt->shadow_ctxt.sh_res_tbl[shtbl_key].refcnt;
-
-			/* copy the result, if caller wanted it. */
-			if (rcopy &&
-			    !tf_shadow_tcam_res_cpy(ctxt,
-						    sparms->result,
-						    shtbl_key,
-						    sparms->result_size)) {
-				/*
-				 * Should never get here, possible memory
-				 * corruption or something unexpected.
-				 */
-				TFP_DRV_LOG(ERR, "Error copying result\n");
-				return -EINVAL;
-			}
-
-			return 0;
-		}
-	}
-
-	/* No hits, return avail entry if exists */
-	if (be_avail < TF_SHADOW_TCAM_HB_NUM_ELEM) {
-		parms->hb_handle =
-			TF_SHADOW_TCAM_HB_HANDLE_CREATE(hb_idx, be_avail);
-		sparms->search_status = MISS;
-		sparms->hit = 0;
-		sparms->idx = 0;
-	} else {
-		sparms->search_status = REJECT;
-	}
-
-	return 0;
-}
-
-int
-tf_shadow_tcam_insert(struct tf_shadow_tcam_insert_parms *parms)
-{
-	uint16_t idx;
-	struct tf_shadow_tcam_ctxt *ctxt;
-	struct tf_tcam_set_parms *sparms;
-	struct tf_shadow_tcam_db *shadow_db;
-	struct tf_shadow_tcam_shadow_result_entry *sr_entry;
-
-	if (!parms || !parms->sparms) {
-		TFP_DRV_LOG(ERR, "Null parms\n");
-		return -EINVAL;
-	}
-
-	sparms = parms->sparms;
-	if (!sparms->result || !sparms->result_size) {
-		TFP_DRV_LOG(ERR, "%s:%s No result to set.\n",
-			    tf_dir_2_str(sparms->dir),
-			    tf_tcam_tbl_2_str(sparms->type));
-		return -EINVAL;
-	}
-
-	shadow_db = (struct tf_shadow_tcam_db *)parms->shadow_db;
-	ctxt = tf_shadow_tcam_ctxt_get(shadow_db, sparms->type);
-	if (!ctxt) {
-		/* We aren't tracking this table, so return success */
-		TFP_DRV_LOG(DEBUG, "%s Unable to get tcam mgr context\n",
-			    tf_tcam_tbl_2_str(sparms->type));
-		return 0;
-	}
-
-	idx = TF_SHADOW_TCAM_IDX_TO_SHIDX(ctxt, sparms->idx);
-	if (idx >= tf_shadow_tcam_sh_num_entries_get(ctxt)) {
-		TFP_DRV_LOG(ERR, "%s:%s Invalid idx(0x%x)\n",
-			    tf_dir_2_str(sparms->dir),
-			    tf_tcam_tbl_2_str(sparms->type),
-			    sparms->idx);
-		return -EINVAL;
-	}
-
-	/* Write the result table, the key/hash has been written already */
-	sr_entry = &ctxt->shadow_ctxt.sh_res_tbl[idx];
-
-	/*
-	 * If the handle is not valid, the bind was never called.  We aren't
-	 * tracking this entry.
-	 */
-	if (!TF_SHADOW_TCAM_HB_HANDLE_IS_VALID(sr_entry->hb_handle))
-		return 0;
-
-	if (sparms->result_size > TF_SHADOW_TCAM_MAX_RESULT_SZ) {
-		TFP_DRV_LOG(ERR, "%s:%s Result length %d > %d\n",
-			    tf_dir_2_str(sparms->dir),
-			    tf_tcam_tbl_2_str(sparms->type),
-			    sparms->result_size,
-			    TF_SHADOW_TCAM_MAX_RESULT_SZ);
-		return -EINVAL;
-	}
-
-	memcpy(sr_entry->result, sparms->result, sparms->result_size);
-	sr_entry->result_size = sparms->result_size;
-
-	return 0;
-}
-
-int
-tf_shadow_tcam_free_db(struct tf_shadow_tcam_free_db_parms *parms)
-{
-	struct tf_shadow_tcam_db *shadow_db;
-	int i;
-
-	TF_CHECK_PARMS1(parms);
-
-	shadow_db = (struct tf_shadow_tcam_db *)parms->shadow_db;
-	if (!shadow_db) {
-		TFP_DRV_LOG(DEBUG, "Shadow db is NULL cannot be freed\n");
-		return -EINVAL;
-	}
-
-	for (i = 0; i < TF_TCAM_TBL_TYPE_MAX; i++) {
-		if (shadow_db->ctxt[i]) {
-			tf_shadow_tcam_ctxt_delete(shadow_db->ctxt[i]);
-			tfp_free(shadow_db->ctxt[i]);
-		}
-	}
-
-	tfp_free(shadow_db);
-
-	return 0;
-}
-
-/**
- * Allocate the TCAM resources for search and allocate
- *
- */
-int tf_shadow_tcam_create_db(struct tf_shadow_tcam_create_db_parms *parms)
-{
-	int rc;
-	int i;
-	uint16_t base;
-	struct tfp_calloc_parms cparms;
-	struct tf_shadow_tcam_db *shadow_db = NULL;
-
-	TF_CHECK_PARMS1(parms);
-
-	/* Build the shadow DB per the request */
-	cparms.nitems = 1;
-	cparms.size = sizeof(struct tf_shadow_tcam_db);
-	cparms.alignment = 0;
-	rc = tfp_calloc(&cparms);
-	if (rc)
-		return rc;
-	shadow_db = (void *)cparms.mem_va;
-
-	for (i = 0; i < TF_TCAM_TBL_TYPE_MAX; i++) {
-		/* If the element didn't request an allocation no need
-		 * to create a pool nor verify if we got a reservation.
-		 */
-		if (!parms->cfg->alloc_cnt[i]) {
-			shadow_db->ctxt[i] = NULL;
-			continue;
-		}
-
-		cparms.nitems = 1;
-		cparms.size = sizeof(struct tf_shadow_tcam_ctxt);
-		cparms.alignment = 0;
-		rc = tfp_calloc(&cparms);
-		if (rc)
-			goto error;
-
-		shadow_db->ctxt[i] = cparms.mem_va;
-		base = parms->cfg->base_addr[i];
-		rc = tf_shadow_tcam_ctxt_create(shadow_db->ctxt[i],
-						parms->cfg->alloc_cnt[i],
-						base);
-		if (rc)
-			goto error;
-	}
-
-	*parms->shadow_db = (void *)shadow_db;
-
-	TFP_DRV_LOG(INFO,
-		    "TF SHADOW TCAM - initialized\n");
-
-	return 0;
-error:
-	for (i = 0; i < TF_TCAM_TBL_TYPE_MAX; i++) {
-		if (shadow_db->ctxt[i]) {
-			tf_shadow_tcam_ctxt_delete(shadow_db->ctxt[i]);
-			tfp_free(shadow_db->ctxt[i]);
-		}
-	}
-
-	tfp_free(shadow_db);
-
-	return -ENOMEM;
-}
diff --git a/drivers/net/bnxt/tf_core/tf_shadow_tcam.h b/drivers/net/bnxt/tf_core/tf_shadow_tcam.h
deleted file mode 100644
index d6506b219a..0000000000
--- a/drivers/net/bnxt/tf_core/tf_shadow_tcam.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2019-2021 Broadcom
- * All rights reserved.
- */
-
-#ifndef _TF_SHADOW_TCAM_H_
-#define _TF_SHADOW_TCAM_H_
-
-#include "tf_core.h"
-
-/**
- * Shadow DB configuration information
- *
- * The shadow configuration is for all tcam table types for a direction
- */
-struct tf_shadow_tcam_cfg_parms {
-	/**
-	 * [in] The number of elements in the alloc_cnt and base_addr
-	 * For now, it should always be equal to TF_TCAM_TBL_TYPE_MAX
-	 */
-	int num_entries;
-	/**
-	 * [in] Resource allocation count array
-	 * This array content originates from the tf_session_resources
-	 * that is passed in on session open
-	 * Array size is TF_TCAM_TBL_TYPE_MAX
-	 */
-	uint16_t *alloc_cnt;
-	/**
-	 * [in] The base index for each tcam table
-	 */
-	uint16_t base_addr[TF_TCAM_TBL_TYPE_MAX];
-};
-
-/**
- * Shadow TCAM  DB creation parameters.  The shadow db for this direction
- * is returned
- */
-struct tf_shadow_tcam_create_db_parms {
-	/**
-	 * [in] Receive or transmit direction
-	 */
-	enum tf_dir dir;
-	/**
-	 * [in] Configuration information for the shadow db
-	 */
-	struct tf_shadow_tcam_cfg_parms *cfg;
-	/**
-	 * [out] Shadow tcam DB handle
-	 */
-	void **shadow_db;
-};
-
-/**
- * Create the shadow db for a single direction
- *
- * The returned shadow db must be free using the free db API when no longer
- * needed
- */
-int
-tf_shadow_tcam_create_db(struct tf_shadow_tcam_create_db_parms *parms);
-
-/**
- * Shadow TCAM free parameters
- */
-struct tf_shadow_tcam_free_db_parms {
-	/**
-	 * [in] Shadow tcam DB handle
-	 */
-	void *shadow_db;
-};
-
-/**
- * Free all resources associated with the shadow db
- */
-int
-tf_shadow_tcam_free_db(struct tf_shadow_tcam_free_db_parms *parms);
-
-/**
- * Shadow TCAM bind index parameters
- */
-struct tf_shadow_tcam_bind_index_parms {
-	/**
-	 * [in] Shadow tcam DB handle
-	 */
-	void *shadow_db;
-	/**
-	 * [in] receive or transmit direction
-	 */
-	enum tf_dir dir;
-	/**
-	 * [in] TCAM table type
-	 */
-	enum tf_tcam_tbl_type type;
-	/**
-	 * [in] index of the entry to program
-	 */
-	uint16_t idx;
-	/**
-	 * [in] struct containing key
-	 */
-	uint8_t *key;
-	/**
-	 * [in] struct containing mask fields
-	 */
-	uint8_t *mask;
-	/**
-	 * [in] key size in bits (if search)
-	 */
-	uint16_t key_size;
-	/**
-	 * [in] The hash bucket handled returned from the search
-	 */
-	uint32_t hb_handle;
-};
-
-/**
- * Binds the allocated tcam index with the hash and shadow tables
- */
-int
-tf_shadow_tcam_bind_index(struct tf_shadow_tcam_bind_index_parms *parms);
-
-/**
- * Shadow TCAM insert parameters
- */
-struct	tf_shadow_tcam_insert_parms {
-	/**
-	 * [in] Shadow tcam DB handle
-	 */
-	void *shadow_db;
-	/**
-	 * [in] The set parms from tf core
-	 */
-	struct tf_tcam_set_parms *sparms;
-};
-
-/**
- * Set the entry into the tcam manager hash and shadow tables
- *
- * The search must have been used prior to setting the entry so that the
- * hash has been calculated and duplicate entries will not be added
- */
-int
-tf_shadow_tcam_insert(struct tf_shadow_tcam_insert_parms *parms);
-
-/**
- * Shadow TCAM remove parameters
- */
-struct tf_shadow_tcam_remove_parms {
-	/**
-	 * [in] Shadow tcam DB handle
-	 */
-	void *shadow_db;
-	/**
-	 * [in,out] The set parms from tf core
-	 */
-	struct tf_tcam_free_parms *fparms;
-};
-
-/**
- * Remove the entry from the tcam hash and shadow tables
- *
- * The search must have been used prior to setting the entry so that the
- * hash has been calculated and duplicate entries will not be added
- */
-int
-tf_shadow_tcam_remove(struct tf_shadow_tcam_remove_parms *parms);
-
-/**
- * Shadow TCAM search parameters
- */
-struct tf_shadow_tcam_search_parms {
-	/**
-	 * [in] Shadow tcam DB handle
-	 */
-	void *shadow_db;
-	/**
-	 * [in,out] The search parameters from tf core
-	 */
-	struct tf_tcam_alloc_search_parms *sparms;
-	/**
-	 * [out] The hash handle to use for the set
-	 */
-	uint32_t hb_handle;
-};
-
-/**
- * Search for an entry in the tcam hash/shadow tables
- *
- * If there is a miss, but there is room for insertion, the hb_handle returned
- * is used for insertion during the bind index API
- */
-int
-tf_shadow_tcam_search(struct tf_shadow_tcam_search_parms *parms);
-#endif
diff --git a/drivers/net/bnxt/tf_core/tf_tcam.c b/drivers/net/bnxt/tf_core/tf_tcam.c
index 273f20858b..1c42a6adc7 100644
--- a/drivers/net/bnxt/tf_core/tf_tcam.c
+++ b/drivers/net/bnxt/tf_core/tf_tcam.c
@@ -14,20 +14,9 @@
 #include "tfp.h"
 #include "tf_session.h"
 #include "tf_msg.h"
-#include "tf_shadow_tcam.h"
 
 struct tf;
 
-/**
- * TCAM Shadow DBs
- */
-static void *shadow_tcam_db[TF_DIR_MAX];
-
-/**
- * Shadow init flag, set on bind and cleared on unbind
- */
-static uint8_t shadow_init;
-
 int
 tf_tcam_bind(struct tf *tfp,
 	     struct tf_tcam_cfg_parms *parms)
@@ -40,9 +29,6 @@ tf_tcam_bind(struct tf *tfp,
 	struct tf_rm_create_db_parms db_cfg;
 	struct tf_tcam_resources *tcam_cnt;
 	struct tf_rm_get_alloc_info_parms ainfo;
-	struct tf_shadow_tcam_free_db_parms fshadow;
-	struct tf_shadow_tcam_cfg_parms shadow_cfg;
-	struct tf_shadow_tcam_create_db_parms shadow_cdb;
 	uint16_t num_slices = parms->wc_num_slices;
 	struct tf_session *tfs;
 	struct tf_dev_info *dev;
@@ -144,44 +130,6 @@ tf_tcam_bind(struct tf *tfp,
 	}
 
 	/* Initialize the TCAM manager. */
-	if (parms->shadow_copy) {
-		for (d = 0; d < TF_DIR_MAX; d++) {
-			memset(&shadow_cfg, 0, sizeof(shadow_cfg));
-			memset(&shadow_cdb, 0, sizeof(shadow_cdb));
-			/* Get the base addresses of the tcams for tcam mgr */
-			for (i = 0; i < TF_TCAM_TBL_TYPE_MAX; i++) {
-				memset(&info, 0, sizeof(info));
-
-				if (!parms->resources->tcam_cnt[d].cnt[i])
-					continue;
-				ainfo.rm_db = tcam_db->tcam_db[d];
-				ainfo.subtype = i;
-				ainfo.info = &info;
-				rc = tf_rm_get_info(&ainfo);
-				if (rc)
-					goto error;
-
-				shadow_cfg.base_addr[i] = info.entry.start;
-			}
-
-			/* Create the shadow db */
-			shadow_cfg.alloc_cnt =
-				parms->resources->tcam_cnt[d].cnt;
-			shadow_cfg.num_entries = parms->num_elements;
-
-			shadow_cdb.shadow_db = &shadow_tcam_db[d];
-			shadow_cdb.cfg = &shadow_cfg;
-			rc = tf_shadow_tcam_create_db(&shadow_cdb);
-			if (rc) {
-				TFP_DRV_LOG(ERR,
-					    "TCAM MGR DB creation failed "
-					    "rc=%d\n", rc);
-				goto error;
-			}
-		}
-		shadow_init = 1;
-	}
-
 	TFP_DRV_LOG(INFO,
 		    "TCAM - initialized\n");
 
@@ -193,19 +141,10 @@ tf_tcam_bind(struct tf *tfp,
 		fparms.rm_db = tcam_db->tcam_db[i];
 		/* Ignoring return here since we are in the error case */
 		(void)tf_rm_free_db(tfp, &fparms);
-
-		if (parms->shadow_copy) {
-			fshadow.shadow_db = shadow_tcam_db[i];
-			tf_shadow_tcam_free_db(&fshadow);
-			shadow_tcam_db[i] = NULL;
-		}
-
 		tcam_db->tcam_db[i] = NULL;
 		tf_session_set_db(tfp, TF_MODULE_TYPE_TCAM, NULL);
 	}
 
-	shadow_init = 0;
-
 	return rc;
 }
 
@@ -217,7 +156,6 @@ tf_tcam_unbind(struct tf *tfp)
 	struct tf_rm_free_db_parms fparms;
 	struct tcam_rm_db *tcam_db;
 	void *tcam_db_ptr = NULL;
-	struct tf_shadow_tcam_free_db_parms fshadow;
 	TF_CHECK_PARMS1(tfp);
 
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_TCAM, &tcam_db_ptr);
@@ -237,18 +175,8 @@ tf_tcam_unbind(struct tf *tfp)
 			return rc;
 
 		tcam_db->tcam_db[i] = NULL;
-
-		if (shadow_init) {
-			memset(&fshadow, 0, sizeof(fshadow));
-
-			fshadow.shadow_db = shadow_tcam_db[i];
-			tf_shadow_tcam_free_db(&fshadow);
-			shadow_tcam_db[i] = NULL;
-		}
 	}
 
-	shadow_init = 0;
-
 	return 0;
 }
 
@@ -346,7 +274,6 @@ tf_tcam_free(struct tf *tfp,
 	struct tf_rm_get_hcapi_parms hparms;
 	uint16_t num_slices = 1;
 	int allocated = 0;
-	struct tf_shadow_tcam_remove_parms shparms;
 	int i;
 	struct tcam_rm_db *tcam_db;
 	void *tcam_db_ptr = NULL;
@@ -416,35 +343,6 @@ tf_tcam_free(struct tf *tfp,
 		return -EINVAL;
 	}
 
-	/*
-	 * The Shadow mgmt, if enabled, determines if the entry needs
-	 * to be deleted.
-	 */
-	if (shadow_init) {
-		shparms.shadow_db = shadow_tcam_db[parms->dir];
-		shparms.fparms = parms;
-		rc = tf_shadow_tcam_remove(&shparms);
-		if (rc) {
-			/*
-			 * Should not get here, log it and let the entry be
-			 * deleted.
-			 */
-			TFP_DRV_LOG(ERR, "%s: Shadow free fail, "
-				    "type:%d index:%d deleting the entry.\n",
-				    tf_dir_2_str(parms->dir),
-				    parms->type,
-				    parms->idx);
-		} else {
-			/*
-			 * If the entry still has references, just return the
-			 * ref count to the caller.  No need to remove entry
-			 * from rm or hw
-			 */
-			if (parms->ref_cnt >= 1)
-				return rc;
-		}
-	}
-
 	for (i = 0; i < num_slices; i++) {
 		/* Free requested element */
 		memset(&fparms, 0, sizeof(fparms));
@@ -488,128 +386,6 @@ tf_tcam_free(struct tf *tfp,
 	return 0;
 }
 
-int
-tf_tcam_alloc_search(struct tf *tfp,
-		     struct tf_tcam_alloc_search_parms *parms)
-{
-	struct tf_shadow_tcam_search_parms sparms;
-	struct tf_shadow_tcam_bind_index_parms bparms;
-	struct tf_tcam_free_parms fparms;
-	struct tf_tcam_alloc_parms aparms;
-	uint16_t num_slice_per_row = 1;
-	struct tf_session *tfs;
-	struct tf_dev_info *dev;
-	int rc;
-
-	TF_CHECK_PARMS2(tfp, parms);
-
-	if (!shadow_init || !shadow_tcam_db[parms->dir]) {
-		TFP_DRV_LOG(ERR, "%s: TCAM Shadow not initialized for %s\n",
-			    tf_dir_2_str(parms->dir),
-			    tf_tcam_tbl_2_str(parms->type));
-		return -EINVAL;
-	}
-
-	/* Retrieve the session information */
-	rc = tf_session_get_session_internal(tfp, &tfs);
-	if (rc)
-		return rc;
-
-	/* Retrieve the device information */
-	rc = tf_session_get_device(tfs, &dev);
-	if (rc)
-		return rc;
-
-	if (dev->ops->tf_dev_get_tcam_slice_info == NULL) {
-		rc = -EOPNOTSUPP;
-		TFP_DRV_LOG(ERR,
-			    "%s: Operation not supported, rc:%s\n",
-			    tf_dir_2_str(parms->dir),
-			    strerror(-rc));
-		return rc;
-	}
-
-	/* Need to retrieve row size etc */
-	rc = dev->ops->tf_dev_get_tcam_slice_info(tfp,
-						  parms->type,
-						  parms->key_size,
-						  &num_slice_per_row);
-	if (rc)
-		return rc;
-
-	/*
-	 * Prep the shadow search, reusing the parms from original search
-	 * instead of copying them.  Shadow will update output in there.
-	 */
-	memset(&sparms, 0, sizeof(sparms));
-	sparms.sparms = parms;
-	sparms.shadow_db = shadow_tcam_db[parms->dir];
-
-	rc = tf_shadow_tcam_search(&sparms);
-	if (rc)
-		return rc;
-
-	/*
-	 * The app didn't request us to alloc the entry, so return now.
-	 * The hit should have been updated in the original search parm.
-	 */
-	if (!parms->alloc || parms->search_status != MISS)
-		return rc;
-
-	/* Caller desires an allocate on miss */
-	if (dev->ops->tf_dev_alloc_tcam == NULL) {
-		rc = -EOPNOTSUPP;
-		TFP_DRV_LOG(ERR,
-			    "%s: Operation not supported, rc:%s\n",
-			    tf_dir_2_str(parms->dir),
-			    strerror(-rc));
-		return rc;
-	}
-	memset(&aparms, 0, sizeof(aparms));
-	aparms.dir = parms->dir;
-	aparms.type = parms->type;
-	aparms.key_size = parms->key_size;
-	aparms.priority = parms->priority;
-	rc = dev->ops->tf_dev_alloc_tcam(tfp, &aparms);
-	if (rc)
-		return rc;
-
-	/* Successful allocation, attempt to add it to the shadow */
-	memset(&bparms, 0, sizeof(bparms));
-	bparms.dir = parms->dir;
-	bparms.shadow_db = shadow_tcam_db[parms->dir];
-	bparms.type = parms->type;
-	bparms.key = parms->key;
-	bparms.mask = parms->mask;
-	bparms.key_size = parms->key_size;
-	bparms.idx = aparms.idx;
-	bparms.hb_handle = sparms.hb_handle;
-	rc = tf_shadow_tcam_bind_index(&bparms);
-	if (rc) {
-		/* Error binding entry, need to free the allocated idx */
-		if (dev->ops->tf_dev_free_tcam == NULL) {
-			rc = -EOPNOTSUPP;
-			TFP_DRV_LOG(ERR,
-				    "%s: Operation not supported, rc:%s\n",
-				    tf_dir_2_str(parms->dir),
-				    strerror(-rc));
-			return rc;
-		}
-
-		fparms.dir = parms->dir;
-		fparms.type = parms->type;
-		fparms.idx = aparms.idx;
-		rc = dev->ops->tf_dev_free_tcam(tfp, &fparms);
-		if (rc)
-			return rc;
-	}
-
-	/* Add the allocated index to output and done */
-	parms->idx = aparms.idx;
-
-	return 0;
-}
-
 int
 tf_tcam_set(struct tf *tfp __rte_unused,
 	    struct tf_tcam_set_parms *parms __rte_unused)
@@ -619,7 +395,6 @@ tf_tcam_set(struct tf *tfp __rte_unused,
 	struct tf_dev_info *dev;
 	struct tf_rm_is_allocated_parms aparms;
 	struct tf_rm_get_hcapi_parms hparms;
-	struct tf_shadow_tcam_insert_parms iparms;
 	uint16_t num_slice_per_row = 1;
 	int allocated = 0;
 	struct tcam_rm_db *tcam_db;
@@ -705,24 +480,6 @@ tf_tcam_set(struct tf *tfp __rte_unused,
 			    strerror(-rc));
 		return rc;
 	}
-
-	/* Successfully added to hw, now for shadow if enabled. */
-	if (!shadow_init || !shadow_tcam_db[parms->dir])
-		return 0;
-
-	iparms.shadow_db = shadow_tcam_db[parms->dir];
-	iparms.sparms = parms;
-	rc = tf_shadow_tcam_insert(&iparms);
-	if (rc) {
-		TFP_DRV_LOG(ERR,
-			    "%s: %s: Entry %d set failed, rc:%s",
-			    tf_dir_2_str(parms->dir),
-			    tf_tcam_tbl_2_str(parms->type),
-			    parms->idx,
-			    strerror(-rc));
-		return rc;
-	}
-
 	return 0;
 }
 
diff --git a/drivers/net/bnxt/tf_core/tf_tcam.h b/drivers/net/bnxt/tf_core/tf_tcam.h
index b1e7a92b0b..0ed2250464 100644
--- a/drivers/net/bnxt/tf_core/tf_tcam.h
+++ b/drivers/net/bnxt/tf_core/tf_tcam.h
@@ -27,14 +27,6 @@ struct tf_tcam_cfg_parms {
 	 * TCAM configuration array
 	 */
 	struct tf_rm_element_cfg *cfg;
-	/**
-	 * Shadow table type configuration array
-	 */
-	struct tf_shadow_tcam_cfg *shadow_cfg;
-	/**
-	 * Boolean controlling the request shadow copy.
-	 */
-	bool shadow_copy;
 	/**
 	 * Session resource allocations
 	 */
@@ -91,11 +83,6 @@ struct tf_tcam_free_parms {
 	 * [in] Index to free
 	 */
 	uint16_t idx;
-	/**
-	 * [out] Reference count after free, only valid if session has been
-	 * created with shadow_copy.
-	 */
-	uint16_t ref_cnt;
 };
 
 /**
@@ -322,10 +309,8 @@ int tf_tcam_alloc(struct tf *tfp,
 		  struct tf_tcam_alloc_parms *parms);
 
 /**
- * Free's the requested table type and returns it to the DB. If shadow
- * DB is enabled its searched first and if found the element refcount
- * is decremented. If refcount goes to 0 then its returned to the
- * table type DB.
+ * Free's the requested table type and returns it to the DB.
+ * If refcount goes to 0 then its returned to the table type DB.
  *
  * [in] tfp
  *   Pointer to TF handle, used for HCAPI communication
@@ -340,25 +325,6 @@ int tf_tcam_alloc(struct tf *tfp,
 int tf_tcam_free(struct tf *tfp,
 		 struct tf_tcam_free_parms *parms);
 
-/**
- * Supported if Shadow DB is configured. Searches the Shadow DB for
- * any matching element. If found the refcount in the shadow DB is
- * updated accordingly. If not found a new element is allocated and
- * installed into the shadow DB.
- *
- * [in] tfp
- *   Pointer to TF handle, used for HCAPI communication
- *
- * [in] parms
- *   Pointer to parameters
- *
- * Returns
- *   - (0) if successful.
- *   - (-EINVAL) on failure.
- */
-int tf_tcam_alloc_search(struct tf *tfp,
-			 struct tf_tcam_alloc_search_parms *parms);
-
 /**
  * Configures the requested element by sending a firmware request which
  * then installs it into the device internal structures.
diff --git a/drivers/net/bnxt/tf_core/tf_util.c b/drivers/net/bnxt/tf_core/tf_util.c
index c1b9be0755..7d9de7c764 100644
--- a/drivers/net/bnxt/tf_core/tf_util.c
+++ b/drivers/net/bnxt/tf_core/tf_util.c
@@ -59,12 +59,10 @@ tf_tcam_tbl_2_str(enum tf_tcam_tbl_type tcam_type)
 		return "sp_tcam";
 	case TF_TCAM_TBL_TYPE_CT_RULE_TCAM:
 		return "ct_rule_tcam";
-#ifdef TF_TCAM_SHARED
 	case TF_TCAM_TBL_TYPE_WC_TCAM_HIGH:
 		return "wc_tcam_hi";
 	case TF_TCAM_TBL_TYPE_WC_TCAM_LOW:
 		return "wc_tcam_lo";
-#endif
 	default:
 		return "Invalid tcam table type";
 	}
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
index 1ee21fceef..1bb38399e4 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
@@ -461,7 +461,6 @@ ulp_ctx_shared_session_open(struct bnxt *bp,
 		return rc;
 	}
 
-	parms.shadow_copy = true;
 	parms.bp = bp;
 	if (app_id == 0)
 		parms.wc_num_slices = TF_WC_TCAM_2_SLICE_PER_ROW;
@@ -550,8 +549,6 @@ ulp_ctx_session_open(struct bnxt *bp,
 		return rc;
 	}
 
-	params.shadow_copy = true;
-
 	rc = bnxt_ulp_cntxt_app_id_get(bp->ulp_ctx, &app_id);
 	if (rc) {
 		BNXT_TF_DBG(ERR, "Unable to get the app id from ulp.\n");
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

  reply	other threads:[~2023-05-04 17:36 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04 17:36 [PATCH v3 00/11] sync Truflow support with latest release Ajit Khaparde
2023-05-04 17:36 ` Ajit Khaparde [this message]
2023-05-04 17:36 ` [PATCH v3 02/11] net/bnxt: update bnxt hsi structure Ajit Khaparde
2023-05-04 17:36 ` [PATCH v3 03/11] net/bnxt: update copyright date and cleanup whitespace Ajit Khaparde
2023-05-04 17:36 ` [PATCH v3 04/11] net/bnxt: update Truflow core Ajit Khaparde
2023-06-10 18:32   ` Thomas Monjalon
2023-06-28 16:29     ` [PATCH v4 00/11] sync Truflow support with latest release Ajit Khaparde
2023-06-28 16:29       ` [PATCH v4 01/11] net/bnxt: remove deprecated features Ajit Khaparde
2023-06-28 16:29       ` [PATCH v4 02/11] net/bnxt: update bnxt hsi structure Ajit Khaparde
2023-06-28 16:29       ` [PATCH v4 03/11] net/bnxt: update copyright date and cleanup whitespace Ajit Khaparde
2023-06-28 16:29       ` [PATCH v4 04/11] net/bnxt: update Truflow core Ajit Khaparde
2023-06-28 16:29       ` [PATCH v4 05/11] net/bnxt: update ULP shared session support Ajit Khaparde
2023-06-28 16:29       ` [PATCH v4 06/11] net/bnxt: add RSS and Queue action in TruFLow Ajit Khaparde
2023-06-28 16:29       ` [PATCH v4 07/11] net/bnxt: add support for rte meter Ajit Khaparde
2023-06-28 16:29       ` [PATCH v4 08/11] net/bnxt: update PTP support on Thor Ajit Khaparde
2023-06-28 16:29       ` [PATCH v4 09/11] net/bnxt: fix multi-root card support Ajit Khaparde
2023-06-28 16:29       ` [PATCH v4 10/11] net/bnxt: add support for eCPRI packet parsing Ajit Khaparde
2023-06-28 16:29       ` [PATCH v4 11/11] net/bnxt: set RSS config based on RSS mode Ajit Khaparde
2023-06-28 16:35     ` [PATCH v3 04/11] net/bnxt: update Truflow core Ajit Khaparde
2023-06-28 19:07       ` Thomas Monjalon
2023-06-29  4:30         ` Ajit Khaparde
2023-06-30 12:16           ` Ajit Khaparde
2023-05-04 17:36 ` [PATCH v3 05/11] net/bnxt: update ULP shared session support Ajit Khaparde
2023-05-04 17:36 ` [PATCH v3 06/11] net/bnxt: add RSS and Queue action in TruFLow Ajit Khaparde
2023-05-04 17:36 ` [PATCH v3 07/11] net/bnxt: add support for rte meter Ajit Khaparde
2023-05-04 17:36 ` [PATCH v3 08/11] net/bnxt: update PTP support on Thor Ajit Khaparde
2023-05-04 17:36 ` [PATCH v3 09/11] net/bnxt: fix multi-root card support Ajit Khaparde
2023-05-04 17:36 ` [PATCH v3 10/11] net/bnxt: add support for eCPRI packet parsing Ajit Khaparde
2023-05-04 17:36 ` [PATCH v3 11/11] net/bnxt: set RSS config based on RSS mode Ajit Khaparde
2023-05-10 17:16 ` [PATCH v3 00/11] sync Truflow support with latest release Ajit Khaparde

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=20230504173612.17696-2-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=kishore.padmanabha@broadcom.com \
    --cc=peter.spreadborough@broadcom.com \
    --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).