get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/129060/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 129060,
    "url": "http://patchwork.dpdk.org/api/patches/129060/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230628162927.92858-2-ajit.khaparde@broadcom.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20230628162927.92858-2-ajit.khaparde@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230628162927.92858-2-ajit.khaparde@broadcom.com",
    "date": "2023-06-28T16:29:17",
    "name": "[v4,01/11] net/bnxt: remove deprecated features",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "acbe07ee933d2d217e9d86e83494afdfa592b31f",
    "submitter": {
        "id": 501,
        "url": "http://patchwork.dpdk.org/api/people/501/?format=api",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "http://patchwork.dpdk.org/api/users/1766/?format=api",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230628162927.92858-2-ajit.khaparde@broadcom.com/mbox/",
    "series": [
        {
            "id": 28693,
            "url": "http://patchwork.dpdk.org/api/series/28693/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28693",
            "date": "2023-06-28T16:29:16",
            "name": "sync Truflow support with latest release",
            "version": 4,
            "mbox": "http://patchwork.dpdk.org/series/28693/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/129060/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/129060/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B118842D82;\n\tWed, 28 Jun 2023 18:30:45 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2279442BAC;\n\tWed, 28 Jun 2023 18:30:40 +0200 (CEST)",
            "from mail-pl1-f173.google.com (mail-pl1-f173.google.com\n [209.85.214.173])\n by mails.dpdk.org (Postfix) with ESMTP id 64BB942C4D\n for <dev@dpdk.org>; Wed, 28 Jun 2023 18:30:38 +0200 (CEST)",
            "by mail-pl1-f173.google.com with SMTP id\n d9443c01a7336-1b7ffab7ff1so883985ad.2\n for <dev@dpdk.org>; Wed, 28 Jun 2023 09:30:38 -0700 (PDT)",
            "from localhost.localdomain ([192.19.252.250])\n by smtp.gmail.com with ESMTPSA id\n h12-20020a170902f7cc00b001b8229942a0sm3092403plw.34.2023.06.28.09.30.31\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 28 Jun 2023 09:30:34 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=broadcom.com; s=google; t=1687969837; x=1690561837;\n h=mime-version:references:in-reply-to:message-id:date:subject:cc:to\n :from:from:to:cc:subject:date:message-id:reply-to;\n bh=n5P9193DaUOuyd48Z9gV84io36mjNL+fEfdGqtX28vo=;\n b=NeI/xvQhyTLxX1JXw9IBhZKsxgCcC5X/IC4Zg/izxLEPHJ4Q462R5mHNekFgTS4Erz\n lNfCyQFoHLXqeZiLBrA9PSgpMl/Whrbk1YRKASN7gy3VVqpqiYbagdSSlXWAR2CDtmWt\n +6i7W/g3vsEOQOTud5EyLD6Bf55iWc6qEsIIg=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20221208; t=1687969837; x=1690561837;\n h=mime-version:references:in-reply-to:message-id:date:subject:cc:to\n :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n bh=n5P9193DaUOuyd48Z9gV84io36mjNL+fEfdGqtX28vo=;\n b=ds2+8raGtt+P1DuC7B+fCCy2kjh0Rba3ShNZadOX73JpNVptnUSChhEglr5EqKdjV1\n rm+jrAol18hhqlVzmhQvKqDXJFUqh2qgj5rlAVN2xzLP8QMfrq5ZUSqw0yUTYmnfsqK4\n zSbEyXo1T7qJgcVlDTqb4EV6/TVvPixqueGyjXaQjurdK5nRx2Ne/FOLOkpPkE77OhUY\n lM0ofR+DpW6wgIQO23tNbZSUzbj7V0a1ybP5rWw0b569UyxJg1dHM2CRJ79l1GZv8OBs\n 0l1vorWmVDMDue0m4l0pJusMHROR/U8DgbnBPQfvSBEAtd+LufIfx+SAorPHEBFn+2Sh\n bHzA==",
        "X-Gm-Message-State": "AC+VfDzc99D3IYYYHFemcAtPXwy404faCqRdjGvD70iD+XIqqzqGEPux\n /OsAPyLYvURVl3ZZ3FCNNcXHQ2loMMj0SYFzriuu3oaqskUzKAxxAYPMwhUfynsB9qIu+72NBs4\n ALmqLS1w53C4vg0vyxRMSpsOLEHtBt8vTljuR8F9yqwP5OWYvy/NLLTblVUI3RtjbgmW+CQ0=",
        "X-Google-Smtp-Source": "\n ACHHUZ59QmDX9rN9xEnNOZouIiBu576aIHZGmVFIDsUtVUKvs4Z4adJKEjxaYeLazvROT6sLxOuPSg==",
        "X-Received": "by 2002:a17:902:da85:b0:1b2:5ade:9ebb with SMTP id\n j5-20020a170902da8500b001b25ade9ebbmr10423785plx.2.1687969835121;\n Wed, 28 Jun 2023 09:30:35 -0700 (PDT)",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com, thomas@monjalon.net,\n Randy Schacher <stuart.schacher@broadcom.com>,\n Kishore Padmanabha <kishore.padmanabha@broadcom.com>,\n Peter Spreadborough <peter.spreadborough@broadcom.com>",
        "Subject": "[PATCH v4 01/11] net/bnxt: remove deprecated features",
        "Date": "Wed, 28 Jun 2023 09:29:17 -0700",
        "Message-Id": "<20230628162927.92858-2-ajit.khaparde@broadcom.com>",
        "X-Mailer": "git-send-email 2.39.2 (Apple Git-143)",
        "In-Reply-To": "<20230628162927.92858-1-ajit.khaparde@broadcom.com>",
        "References": "<1826961.atdPhlSkOF@thomas>\n <20230628162927.92858-1-ajit.khaparde@broadcom.com>",
        "MIME-Version": "1.0",
        "Content-Type": "multipart/signed; protocol=\"application/pkcs7-signature\";\n micalg=sha-256; boundary=\"0000000000008f4c6c05ff331a3b\"",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "From: Randy Schacher <stuart.schacher@broadcom.com>\n\n- Deprecate shadow identifier\n- Deprecate shadow TCAM\n- Remove files which are not needed anymore.\n\nSigned-off-by: Randy Schacher <stuart.schacher@broadcom.com>\nSigned-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nReviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/bnxt_hwrm.c                  |  53 --\n drivers/net/bnxt/bnxt_hwrm.h                  |  10 -\n drivers/net/bnxt/tf_core/meson.build          |   2 -\n drivers/net/bnxt/tf_core/tf_core.c            |   2 -\n drivers/net/bnxt/tf_core/tf_core.h            |  91 +-\n drivers/net/bnxt/tf_core/tf_device.c          |  35 -\n drivers/net/bnxt/tf_core/tf_device.h          |   6 -\n drivers/net/bnxt/tf_core/tf_device_p4.c       |  10 -\n drivers/net/bnxt/tf_core/tf_device_p58.c      |  10 -\n drivers/net/bnxt/tf_core/tf_identifier.c      | 108 ---\n drivers/net/bnxt/tf_core/tf_identifier.h      |   4 -\n drivers/net/bnxt/tf_core/tf_if_tbl.h          |   8 -\n drivers/net/bnxt/tf_core/tf_session.c         |   9 +-\n drivers/net/bnxt/tf_core/tf_session.h         |  18 +-\n .../net/bnxt/tf_core/tf_shadow_identifier.c   | 190 ----\n .../net/bnxt/tf_core/tf_shadow_identifier.h   | 229 -----\n drivers/net/bnxt/tf_core/tf_shadow_tcam.c     | 837 ------------------\n drivers/net/bnxt/tf_core/tf_shadow_tcam.h     | 195 ----\n drivers/net/bnxt/tf_core/tf_tcam.c            | 243 -----\n drivers/net/bnxt/tf_core/tf_tcam.h            |  38 +-\n drivers/net/bnxt/tf_core/tf_util.c            |   2 -\n drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |   3 -\n 22 files changed, 8 insertions(+), 2095 deletions(-)\n delete mode 100644 drivers/net/bnxt/tf_core/tf_shadow_identifier.c\n delete mode 100644 drivers/net/bnxt/tf_core/tf_shadow_identifier.h\n delete mode 100644 drivers/net/bnxt/tf_core/tf_shadow_tcam.c\n delete mode 100644 drivers/net/bnxt/tf_core/tf_shadow_tcam.h",
    "diff": "diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c\nindex d86ac73293..3f273df6f3 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -407,59 +407,6 @@ int bnxt_hwrm_tf_message_direct(struct bnxt *bp,\n \treturn rc;\n }\n \n-int bnxt_hwrm_tf_message_tunneled(struct bnxt *bp,\n-\t\t\t\t  bool use_kong_mb,\n-\t\t\t\t  uint16_t tf_type,\n-\t\t\t\t  uint16_t tf_subtype,\n-\t\t\t\t  uint32_t *tf_response_code,\n-\t\t\t\t  void *msg,\n-\t\t\t\t  uint32_t msg_len,\n-\t\t\t\t  void *response,\n-\t\t\t\t  uint32_t response_len)\n-{\n-\tint rc = 0;\n-\tstruct hwrm_cfa_tflib_input req = { .req_type = 0 };\n-\tstruct hwrm_cfa_tflib_output *resp = bp->hwrm_cmd_resp_addr;\n-\tbool mailbox = BNXT_USE_CHIMP_MB;\n-\n-\tif (msg_len > sizeof(req.tf_req))\n-\t\treturn -ENOMEM;\n-\n-\tif (use_kong_mb)\n-\t\tmailbox = BNXT_USE_KONG(bp);\n-\n-\tHWRM_PREP(&req, HWRM_TF, mailbox);\n-\t/* Build request using the user supplied request payload.\n-\t * TLV request size is checked at build time against HWRM\n-\t * request max size, thus no checking required.\n-\t */\n-\treq.tf_type = tf_type;\n-\treq.tf_subtype = tf_subtype;\n-\tmemcpy(req.tf_req, msg, msg_len);\n-\n-\trc = bnxt_hwrm_send_message(bp, &req, sizeof(req), mailbox);\n-\tHWRM_CHECK_RESULT();\n-\n-\t/* Copy the resp to user provided response buffer */\n-\tif (response != NULL)\n-\t\t/* Post process response data. We need to copy only\n-\t\t * the 'payload' as the HWRM data structure really is\n-\t\t * HWRM header + msg header + payload and the TFLIB\n-\t\t * only provided a payload place holder.\n-\t\t */\n-\t\tif (response_len != 0) {\n-\t\t\tmemcpy(response,\n-\t\t\t       resp->tf_resp,\n-\t\t\t       response_len);\n-\t\t}\n-\n-\t/* Extract the internal tflib response code */\n-\t*tf_response_code = resp->tf_resp_code;\n-\tHWRM_UNLOCK();\n-\n-\treturn rc;\n-}\n-\n int bnxt_hwrm_cfa_l2_clear_rx_mask(struct bnxt *bp, struct bnxt_vnic_info *vnic)\n {\n \tint rc = 0;\ndiff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h\nindex a82d9fb3ef..f9d9fe0ef2 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.h\n+++ b/drivers/net/bnxt/bnxt_hwrm.h\n@@ -79,16 +79,6 @@ struct hwrm_func_qstats_output;\n \tbp->rx_cos_queue[x].profile =\t\\\n \t\tresp->queue_id##x##_service_profile\n \n-int bnxt_hwrm_tf_message_tunneled(struct bnxt *bp,\n-\t\t\t\t  bool use_kong_mb,\n-\t\t\t\t  uint16_t tf_type,\n-\t\t\t\t  uint16_t tf_subtype,\n-\t\t\t\t  uint32_t *tf_response_code,\n-\t\t\t\t  void *msg,\n-\t\t\t\t  uint32_t msg_len,\n-\t\t\t\t  void *response,\n-\t\t\t\t  uint32_t response_len);\n-\n int bnxt_hwrm_tf_message_direct(struct bnxt *bp,\n \t\t\t\tbool use_kong_mb,\n \t\t\t\tuint16_t msg_type,\ndiff --git a/drivers/net/bnxt/tf_core/meson.build b/drivers/net/bnxt/tf_core/meson.build\nindex 206935d18a..f812e471d1 100644\n--- a/drivers/net/bnxt/tf_core/meson.build\n+++ b/drivers/net/bnxt/tf_core/meson.build\n@@ -30,9 +30,7 @@ sources += files(\n         'tf_identifier.c',\n         'tf_if_tbl.c',\n         'tf_session.c',\n-        'tf_shadow_tcam.c',\n         'tf_tcam.c',\n         'tf_tcam_shared.c',\n-        'tf_shadow_identifier.c',\n         'tf_hash.c',\n         'tf_device_p58.c')\ndiff --git a/drivers/net/bnxt/tf_core/tf_core.c b/drivers/net/bnxt/tf_core/tf_core.c\nindex 90ff93946b..038e439101 100644\n--- a/drivers/net/bnxt/tf_core/tf_core.c\n+++ b/drivers/net/bnxt/tf_core/tf_core.c\n@@ -917,7 +917,6 @@ tf_free_tcam_entry(struct tf *tfp,\n \treturn 0;\n }\n \n-#ifdef TF_TCAM_SHARED\n int\n tf_move_tcam_shared_entries(struct tf *tfp,\n \t\t\t    struct tf_move_tcam_shared_entries_parms *parms)\n@@ -1019,7 +1018,6 @@ tf_clear_tcam_shared_entries(struct tf *tfp,\n \n \treturn 0;\n }\n-#endif /* TF_TCAM_SHARED */\n \n int\n tf_alloc_tbl_entry(struct tf *tfp,\ndiff --git a/drivers/net/bnxt/tf_core/tf_core.h b/drivers/net/bnxt/tf_core/tf_core.h\nindex f891d7a48f..814eff68da 100644\n--- a/drivers/net/bnxt/tf_core/tf_core.h\n+++ b/drivers/net/bnxt/tf_core/tf_core.h\n@@ -337,41 +337,6 @@ enum tf_tbl_type {\n \tTF_TBL_TYPE_MAX\n };\n \n-/** Enable Shared TCAM Management\n- *\n- *  This feature allows for management of high and low pools within\n- *  the WC TCAM.  These pools are only valid when this feature is enabled.\n- *\n- *  For normal OVS-DPDK operation, this feature is not required and can\n- *  be disabled by commenting out TF_TCAM_SHARED in this header file.\n- *\n- *  Operation:\n- *\n- *  When a shared session is created with WC TCAM entries allocated during\n- *  tf_open_session(), the TF_TCAM_TBL_TYPE_WC_TCAM pool entries will be divided\n- *  into 2 equal pools - TF_TCAM_TBL_TYPE_WC_TCAM_HIGH and\n- *  TF_TCAM_TBL_TYPE_WC_TCAM_LOW.\n- *\n- *  The user will allocate and free entries from either of these pools to obtain\n- *  WC_TCAM entry offsets.  For the WC_TCAM_HI/LO management, alloc/free is done\n- *  using the tf_alloc_tcam_entry()/tf_free_tcam_entry() APIs for the shared\n- *  session.\n- *\n- *  The use case for this feature is so that applications can have a shared\n- *  session and use the TF core to allocate/set/free entries within a given\n- *  region of the WC_TCAM within the shared session.  Application A only writes\n- *  to the LOW region for example and Application B only writes to the HIGH\n- *  region during normal operation.  After Application A goes down, Application\n- *  B may decide to overwrite the LOW region with the HIGH region's entries\n- *  and switch to the low region.\n- *\n- *  For other TCAM types in the  shared session, no alloc/free operations are\n- *  permitted. Only set should be used for other TCAM table types after getting\n- *  the range as provided by the tf_get_resource_info() API.\n- *\n- */\n-#define TF_TCAM_SHARED 1\n-\n /**\n  * TCAM table type\n  */\n@@ -390,12 +355,10 @@ enum tf_tcam_tbl_type {\n \tTF_TCAM_TBL_TYPE_CT_RULE_TCAM,\n \t/** Virtual Edge Bridge TCAM */\n \tTF_TCAM_TBL_TYPE_VEB_TCAM,\n-#ifdef TF_TCAM_SHARED\n \t/** Wildcard TCAM HI Priority */\n \tTF_TCAM_TBL_TYPE_WC_TCAM_HIGH,\n \t/** Wildcard TCAM Low Priority */\n \tTF_TCAM_TBL_TYPE_WC_TCAM_LOW,\n-#endif /* TF_TCAM_SHARED */\n \tTF_TCAM_TBL_TYPE_MAX\n };\n \n@@ -626,20 +589,6 @@ struct tf_open_session_parms {\n \t * 0000:02:00.0. The name for shared session is 0000:02:00.0-tf_shared.\n \t */\n \tchar ctrl_chan_name[TF_SESSION_NAME_MAX];\n-\t/**\n-\t * [in] shadow_copy\n-\t *\n-\t * Boolean controlling the use and availability of shadow\n-\t * copy. Shadow copy will allow the TruFlow to keep track of\n-\t * resource content on the firmware side without having to\n-\t * query firmware. Additional private session core_data will\n-\t * be allocated if this boolean is set to 'true', default\n-\t * 'false'.\n-\t *\n-\t * Size of memory depends on the NVM Resource settings for the\n-\t * control channel.\n-\t */\n-\tbool shadow_copy;\n \t/**\n \t * [in/out] session_id\n \t *\n@@ -1045,9 +994,6 @@ struct tf_search_identifier_parms {\n  * TruFlow core will allocate a free id from the per identifier resource type\n  * pool reserved for the session during tf_open().  No firmware is involved.\n  *\n- * If shadow copy is enabled, the internal ref_cnt is set to 1 in the\n- * shadow table for a newly allocated resource.\n- *\n  * Returns success or failure code.\n  */\n int tf_alloc_identifier(struct tf *tfp,\n@@ -1061,8 +1007,7 @@ int tf_alloc_identifier(struct tf *tfp,\n  * complete pool is returned to the firmware.\n  *\n  * additional operation (experimental)\n- * Decrement reference count.  Only release resource once refcnt goes to 0 if\n- * shadow copy is enabled.\n+ * Decrement reference count.\n  *\n  * Returns success or failure code.\n  */\n@@ -1072,19 +1017,6 @@ int tf_free_identifier(struct tf *tfp,\n /**\n  * Search identifier resource (experimental)\n  *\n- * If the shadow copy is enabled search_id is used to search for a matching\n- * entry in the shadow table.  The shadow table consists of an array of\n- * reference counts indexed by identifier.  If a matching entry is found hit is\n- * set to TRUE, refcnt is increased by 1 and returned.  Otherwise, hit is\n- * set to false and refcnt is set to 0.\n- *\n- * TODO: we may need a per table internal shadow copy enable flag to stage\n- * the shadow table implementation.  We do not need the shadow table for other\n- * tables at this time so we may only want to enable the identifier shadow.\n- *\n- * TODO: remove this pseudocode below added to show that if search fails\n- * we shouldn't allocate a new entry but return.\n- *\n  * identifier alloc (search_en=1)\n  * if (ident is allocated and ref_cnt >=1)\n  *      return ident - hit is set, incr refcnt\n@@ -1262,11 +1194,9 @@ int tf_free_tbl_scope(struct tf *tfp,\n  *\n  * @ref tf_free_tcam_entry\n  *\n-#ifdef TF_TCAM_SHARED\n  * @ref tf_move_tcam_shared_entries\n  *\n  * @ref tf_clear_tcam_shared_entries\n-#endif\n  */\n \n /**\n@@ -1332,14 +1262,9 @@ struct tf_search_tcam_entry_parms {\n  *\n  * Search for a TCAM entry\n  *\n- * This function searches the shadow copy of the TCAM table for a matching\n- * entry.  Key and mask must match for hit to be set.  Only TruFlow core data\n- * is accessed.  If shadow_copy is not enabled, an error is returned.\n- *\n  * Implementation:\n  *\n- * A hash is performed on the key/mask data and mapped to a shadow copy entry\n- * where the full key/mask is populated.  If the full key/mask matches the\n+ * If the full key/mask matches the\n  * entry, hit is set, ref_cnt is incremented, and search_status indicates what\n  * action the caller can take regarding setting the entry.\n  *\n@@ -1416,8 +1341,7 @@ struct tf_alloc_tcam_entry_parms {\n  *\n  * This function allocates a TCAM table record.\t This function\n  * will attempt to allocate a TCAM table entry from the session\n- * owned TCAM entries or search a shadow copy of the TCAM table for a\n- * matching entry if search is enabled.\t Key, mask and result must match for\n+ * owned TCAM entries.  Key, mask and result must match for\n  * hit to be set.  Only TruFlow core data is accessed.\n  * A hash table to entry mapping is maintained for search purposes.  If\n  * search is not enabled, the first available free entry is returned based\n@@ -1568,7 +1492,6 @@ struct tf_free_tcam_entry_parms {\n int tf_free_tcam_entry(struct tf *tfp,\n \t\t       struct tf_free_tcam_entry_parms *parms);\n \n-#ifdef TF_TCAM_SHARED\n /**\n  * tf_move_tcam_shared_entries parameter definition\n  */\n@@ -1633,7 +1556,6 @@ struct tf_clear_tcam_shared_entries_parms {\n int tf_clear_tcam_shared_entries(struct tf *tfp,\n \t\t\t      struct tf_clear_tcam_shared_entries_parms *parms);\n \n-#endif /* TF_TCAM_SHARED */\n /**\n  * @page table Table Access\n  *\n@@ -1854,9 +1776,6 @@ struct tf_get_tbl_entry_parms {\n  *\n  * Used to retrieve a previous set index table entry.\n  *\n- * Reads and compares with the shadow table copy (if enabled) (only\n- * for internal objects).\n- *\n  * Returns success or failure code. Failure will be returned if the\n  * provided data buffer is too small for the data type requested.\n  */\n@@ -2165,9 +2084,7 @@ int tf_delete_em_entry(struct tf *tfp,\n  * succeeds, a pointer to the matching entry and the result record associated\n  * with the matching entry will be provided.\n  *\n- * If flow_handle is set, search shadow copy.\n- *\n- * Otherwise, query the fw with key to get result.\n+ * Query the fw with key to get result.\n  *\n  * External:\n  *\ndiff --git a/drivers/net/bnxt/tf_core/tf_device.c b/drivers/net/bnxt/tf_core/tf_device.c\nindex a35d22841c..1c97218b5b 100644\n--- a/drivers/net/bnxt/tf_core/tf_device.c\n+++ b/drivers/net/bnxt/tf_core/tf_device.c\n@@ -9,10 +9,8 @@\n #include \"tfp.h\"\n #include \"tf_em.h\"\n #include \"tf_rm.h\"\n-#ifdef TF_TCAM_SHARED\n #include \"tf_tcam_shared.h\"\n #include \"tf_tbl_sram.h\"\n-#endif /* TF_TCAM_SHARED */\n \n struct tf;\n \n@@ -67,9 +65,6 @@ tf_dev_reservation_check(uint16_t count,\n  * [in] tfp\n  *   Pointer to TF handle\n  *\n- * [in] shadow_copy\n- *   Flag controlling shadow copy DB creation\n- *\n  * [in] resources\n  *   Pointer to resource allocation information\n  *\n@@ -82,7 +77,6 @@ tf_dev_reservation_check(uint16_t count,\n  */\n static int\n tf_dev_bind_p4(struct tf *tfp,\n-\t       bool shadow_copy,\n \t       struct tf_session_resources *resources,\n \t       struct tf_dev_info *dev_handle,\n \t       enum tf_wc_num_slice wc_num_slices)\n@@ -115,7 +109,6 @@ tf_dev_bind_p4(struct tf *tfp,\n \tif (rsv_cnt) {\n \t\tident_cfg.num_elements = TF_IDENT_TYPE_MAX;\n \t\tident_cfg.cfg = tf_ident_p4;\n-\t\tident_cfg.shadow_copy = shadow_copy;\n \t\tident_cfg.resources = resources;\n \t\trc = tf_ident_bind(tfp, &ident_cfg);\n \t\tif (rc) {\n@@ -150,14 +143,9 @@ tf_dev_bind_p4(struct tf *tfp,\n \tif (rsv_cnt) {\n \t\ttcam_cfg.num_elements = TF_TCAM_TBL_TYPE_MAX;\n \t\ttcam_cfg.cfg = tf_tcam_p4;\n-\t\ttcam_cfg.shadow_copy = shadow_copy;\n \t\ttcam_cfg.resources = resources;\n \t\ttcam_cfg.wc_num_slices = wc_num_slices;\n-#ifdef TF_TCAM_SHARED\n \t\trc = tf_tcam_shared_bind(tfp, &tcam_cfg);\n-#else /* !TF_TCAM_SHARED */\n-\t\trc = tf_tcam_bind(tfp, &tcam_cfg);\n-#endif\n \t\tif (rc) {\n \t\t\tTFP_DRV_LOG(ERR,\n \t\t\t\t    \"TCAM initialization failure\\n\");\n@@ -223,7 +211,6 @@ tf_dev_bind_p4(struct tf *tfp,\n \t */\n \tif_tbl_cfg.num_elements = TF_IF_TBL_TYPE_MAX;\n \tif_tbl_cfg.cfg = tf_if_tbl_p4;\n-\tif_tbl_cfg.shadow_copy = shadow_copy;\n \trc = tf_if_tbl_bind(tfp, &if_tbl_cfg);\n \tif (rc) {\n \t\tTFP_DRV_LOG(ERR,\n@@ -287,11 +274,7 @@ tf_dev_unbind_p4(struct tf *tfp)\n \t * In case of residuals TCAMs are cleaned up first as to\n \t * invalidate the pipeline in a clean manner.\n \t */\n-#ifdef TF_TCAM_SHARED\n \trc = tf_tcam_shared_unbind(tfp);\n-#else /* !TF_TCAM_SHARED */\n-\trc = tf_tcam_unbind(tfp);\n-#endif /* TF_TCAM_SHARED */\n \tif (rc) {\n \t\tTFP_DRV_LOG(INFO,\n \t\t\t    \"Device unbind failed, TCAM\\n\");\n@@ -354,9 +337,6 @@ tf_dev_unbind_p4(struct tf *tfp)\n  * [in] tfp\n  *   Pointer to TF handle\n  *\n- * [in] shadow_copy\n- *   Flag controlling shadow copy DB creation\n- *\n  * [in] resources\n  *   Pointer to resource allocation information\n  *\n@@ -369,7 +349,6 @@ tf_dev_unbind_p4(struct tf *tfp)\n  */\n static int\n tf_dev_bind_p58(struct tf *tfp,\n-\t\tbool shadow_copy,\n \t\tstruct tf_session_resources *resources,\n \t\tstruct tf_dev_info *dev_handle,\n \t\tenum tf_wc_num_slice wc_num_slices)\n@@ -400,7 +379,6 @@ tf_dev_bind_p58(struct tf *tfp,\n \tif (rsv_cnt) {\n \t\tident_cfg.num_elements = TF_IDENT_TYPE_MAX;\n \t\tident_cfg.cfg = tf_ident_p58;\n-\t\tident_cfg.shadow_copy = shadow_copy;\n \t\tident_cfg.resources = resources;\n \t\trc = tf_ident_bind(tfp, &ident_cfg);\n \t\tif (rc) {\n@@ -443,14 +421,9 @@ tf_dev_bind_p58(struct tf *tfp,\n \tif (rsv_cnt) {\n \t\ttcam_cfg.num_elements = TF_TCAM_TBL_TYPE_MAX;\n \t\ttcam_cfg.cfg = tf_tcam_p58;\n-\t\ttcam_cfg.shadow_copy = shadow_copy;\n \t\ttcam_cfg.resources = resources;\n \t\ttcam_cfg.wc_num_slices = wc_num_slices;\n-#ifdef TF_TCAM_SHARED\n \t\trc = tf_tcam_shared_bind(tfp, &tcam_cfg);\n-#else /* !TF_TCAM_SHARED */\n-\t\trc = tf_tcam_bind(tfp, &tcam_cfg);\n-#endif\n \t\tif (rc) {\n \t\t\tTFP_DRV_LOG(ERR,\n \t\t\t\t    \"TCAM initialization failure\\n\");\n@@ -495,7 +468,6 @@ tf_dev_bind_p58(struct tf *tfp,\n \t */\n \tif_tbl_cfg.num_elements = TF_IF_TBL_TYPE_MAX;\n \tif_tbl_cfg.cfg = tf_if_tbl_p58;\n-\tif_tbl_cfg.shadow_copy = shadow_copy;\n \trc = tf_if_tbl_bind(tfp, &if_tbl_cfg);\n \tif (rc) {\n \t\tTFP_DRV_LOG(ERR,\n@@ -560,11 +532,7 @@ tf_dev_unbind_p58(struct tf *tfp)\n \t * In case of residuals TCAMs are cleaned up first as to\n \t * invalidate the pipeline in a clean manner.\n \t */\n-#ifdef TF_TCAM_SHARED\n \trc = tf_tcam_shared_unbind(tfp);\n-#else /* !TF_TCAM_SHARED */\n-\trc = tf_tcam_unbind(tfp);\n-#endif /* TF_TCAM_SHARED */\n \tif (rc) {\n \t\tTFP_DRV_LOG(INFO,\n \t\t\t    \"Device unbind failed, TCAM\\n\");\n@@ -629,7 +597,6 @@ tf_dev_unbind_p58(struct tf *tfp)\n int\n tf_dev_bind(struct tf *tfp __rte_unused,\n \t    enum tf_device_type type,\n-\t    bool shadow_copy,\n \t    struct tf_session_resources *resources,\n \t    uint16_t wc_num_slices,\n \t    struct tf_dev_info *dev_handle)\n@@ -639,14 +606,12 @@ tf_dev_bind(struct tf *tfp __rte_unused,\n \tcase TF_DEVICE_TYPE_SR:\n \t\tdev_handle->type = type;\n \t\treturn tf_dev_bind_p4(tfp,\n-\t\t\t\t      shadow_copy,\n \t\t\t\t      resources,\n \t\t\t\t      dev_handle,\n \t\t\t\t      wc_num_slices);\n \tcase TF_DEVICE_TYPE_THOR:\n \t\tdev_handle->type = type;\n \t\treturn tf_dev_bind_p58(tfp,\n-\t\t\t\t       shadow_copy,\n \t\t\t\t       resources,\n \t\t\t\t       dev_handle,\n \t\t\t\t       wc_num_slices);\ndiff --git a/drivers/net/bnxt/tf_core/tf_device.h b/drivers/net/bnxt/tf_core/tf_device.h\nindex bfb5de4370..bc6de60423 100644\n--- a/drivers/net/bnxt/tf_core/tf_device.h\n+++ b/drivers/net/bnxt/tf_core/tf_device.h\n@@ -11,9 +11,7 @@\n #include \"tf_identifier.h\"\n #include \"tf_tbl.h\"\n #include \"tf_tcam.h\"\n-#ifdef TF_TCAM_SHARED\n #include \"tf_tcam_shared.h\"\n-#endif\n #include \"tf_if_tbl.h\"\n #include \"tf_global_cfg.h\"\n \n@@ -86,7 +84,6 @@ struct tf_hcapi_resource_map {\n  */\n int tf_dev_bind(struct tf *tfp,\n \t\tenum tf_device_type type,\n-\t\tbool shadow_copy,\n \t\tstruct tf_session_resources *resources,\n \t\tuint16_t wc_num_slices,\n \t\tstruct tf_dev_info *dev_handle);\n@@ -705,7 +702,6 @@ struct tf_dev_ops {\n \tint (*tf_dev_get_tcam)(struct tf *tfp,\n \t\t\t       struct tf_tcam_get_parms *parms);\n \n-#ifdef TF_TCAM_SHARED\n \t/**\n \t * Move TCAM shared entries\n \t *\n@@ -738,8 +734,6 @@ struct tf_dev_ops {\n \tint (*tf_dev_clear_tcam)(struct tf *tfp,\n \t\t\t      struct tf_clear_tcam_shared_entries_parms *parms);\n \n-#endif /* TF_TCAM_SHARED */\n-\n \t/**\n \t * Retrieves the tcam resource info.\n \t *\ndiff --git a/drivers/net/bnxt/tf_core/tf_device_p4.c b/drivers/net/bnxt/tf_core/tf_device_p4.c\nindex b8b3dcbb3f..72c6b1cde8 100644\n--- a/drivers/net/bnxt/tf_core/tf_device_p4.c\n+++ b/drivers/net/bnxt/tf_core/tf_device_p4.c\n@@ -10,9 +10,7 @@\n #include \"tf_identifier.h\"\n #include \"tf_tbl.h\"\n #include \"tf_tcam.h\"\n-#ifdef TF_TCAM_SHARED\n #include \"tf_tcam_shared.h\"\n-#endif /* TF_TCAM_SHARED */\n #include \"tf_em.h\"\n #include \"tf_if_tbl.h\"\n #include \"tfp.h\"\n@@ -540,20 +538,12 @@ const struct tf_dev_ops tf_dev_ops_p4 = {\n \t.tf_dev_get_bulk_sram_tbl = NULL,\n \t.tf_dev_get_shared_tbl_increment = tf_dev_p4_get_shared_tbl_increment,\n \t.tf_dev_get_tbl_resc_info = tf_tbl_get_resc_info,\n-#ifdef TF_TCAM_SHARED\n \t.tf_dev_alloc_tcam = tf_tcam_shared_alloc,\n \t.tf_dev_free_tcam = tf_tcam_shared_free,\n \t.tf_dev_set_tcam = tf_tcam_shared_set,\n \t.tf_dev_get_tcam = tf_tcam_shared_get,\n \t.tf_dev_move_tcam = tf_tcam_shared_move_p4,\n \t.tf_dev_clear_tcam = tf_tcam_shared_clear,\n-#else /* !TF_TCAM_SHARED */\n-\t.tf_dev_alloc_tcam = tf_tcam_alloc,\n-\t.tf_dev_free_tcam = tf_tcam_free,\n-\t.tf_dev_set_tcam = tf_tcam_set,\n-\t.tf_dev_get_tcam = tf_tcam_get,\n-#endif\n-\t.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,\n \t.tf_dev_get_tcam_resc_info = tf_tcam_get_resc_info,\n \t.tf_dev_insert_int_em_entry = tf_em_insert_int_entry,\n \t.tf_dev_delete_int_em_entry = tf_em_delete_int_entry,\ndiff --git a/drivers/net/bnxt/tf_core/tf_device_p58.c b/drivers/net/bnxt/tf_core/tf_device_p58.c\nindex 8179287e46..f8b424ebc9 100644\n--- a/drivers/net/bnxt/tf_core/tf_device_p58.c\n+++ b/drivers/net/bnxt/tf_core/tf_device_p58.c\n@@ -10,9 +10,7 @@\n #include \"tf_identifier.h\"\n #include \"tf_tbl.h\"\n #include \"tf_tcam.h\"\n-#ifdef TF_TCAM_SHARED\n #include \"tf_tcam_shared.h\"\n-#endif /* TF_TCAM_SHARED */\n #include \"tf_em.h\"\n #include \"tf_if_tbl.h\"\n #include \"tfp.h\"\n@@ -848,20 +846,12 @@ const struct tf_dev_ops tf_dev_ops_p58 = {\n \t.tf_dev_get_bulk_sram_tbl = tf_tbl_sram_bulk_get,\n \t.tf_dev_get_shared_tbl_increment = tf_dev_p58_get_shared_tbl_increment,\n \t.tf_dev_get_tbl_resc_info = tf_tbl_get_resc_info,\n-#ifdef TF_TCAM_SHARED\n \t.tf_dev_alloc_tcam = tf_tcam_shared_alloc,\n \t.tf_dev_free_tcam = tf_tcam_shared_free,\n \t.tf_dev_set_tcam = tf_tcam_shared_set,\n \t.tf_dev_get_tcam = tf_tcam_shared_get,\n \t.tf_dev_move_tcam = tf_tcam_shared_move_p58,\n \t.tf_dev_clear_tcam = tf_tcam_shared_clear,\n-#else /* !TF_TCAM_SHARED */\n-\t.tf_dev_alloc_tcam = tf_tcam_alloc,\n-\t.tf_dev_free_tcam = tf_tcam_free,\n-\t.tf_dev_set_tcam = tf_tcam_set,\n-\t.tf_dev_get_tcam = tf_tcam_get,\n-#endif\n-\t.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,\n \t.tf_dev_get_tcam_resc_info = tf_tcam_get_resc_info,\n \t.tf_dev_insert_int_em_entry = tf_em_hash_insert_int_entry,\n \t.tf_dev_delete_int_em_entry = tf_em_hash_delete_int_entry,\ndiff --git a/drivers/net/bnxt/tf_core/tf_identifier.c b/drivers/net/bnxt/tf_core/tf_identifier.c\nindex c491f77a2b..8131d8754d 100644\n--- a/drivers/net/bnxt/tf_core/tf_identifier.c\n+++ b/drivers/net/bnxt/tf_core/tf_identifier.c\n@@ -6,7 +6,6 @@\n #include <rte_common.h>\n \n #include \"tf_identifier.h\"\n-#include \"tf_shadow_identifier.h\"\n #include \"tf_common.h\"\n #include \"tf_rm.h\"\n #include \"tf_util.h\"\n@@ -15,16 +14,6 @@\n \n struct tf;\n \n-/**\n- * Identifier shadow DBs.\n- */\n-static void *ident_shadow_db[TF_DIR_MAX];\n-\n-/**\n- * Shadow DB Init flag, set on bind and cleared on unbind\n- */\n-static uint8_t shadow_init;\n-\n int\n tf_ident_bind(struct tf *tfp,\n \t      struct tf_ident_cfg_parms *parms)\n@@ -33,8 +22,6 @@ tf_ident_bind(struct tf *tfp,\n \tint db_rc[TF_DIR_MAX] = { 0 };\n \tint i;\n \tstruct tf_rm_create_db_parms db_cfg = { 0 };\n-\tstruct tf_shadow_ident_cfg_parms shadow_cfg = { 0 };\n-\tstruct tf_shadow_ident_create_db_parms shadow_cdb = { 0 };\n \tstruct ident_rm_db *ident_db;\n \tstruct tfp_calloc_parms cparms;\n \tstruct tf_session *tfs;\n@@ -74,23 +61,6 @@ tf_ident_bind(struct tf *tfp,\n \t\t\tdb_rc[i] = tf_rm_create_db_no_reservation(tfp, &db_cfg);\n \t\telse\n \t\t\tdb_rc[i] = tf_rm_create_db(tfp, &db_cfg);\n-\n-\t\tif (parms->shadow_copy) {\n-\t\t\tshadow_cfg.alloc_cnt =\n-\t\t\t\tparms->resources->ident_cnt[i].cnt;\n-\t\t\tshadow_cdb.num_elements = parms->num_elements;\n-\t\t\tshadow_cdb.tf_shadow_ident_db = &ident_shadow_db[i];\n-\t\t\tshadow_cdb.cfg = &shadow_cfg;\n-\t\t\trc = tf_shadow_ident_create_db(&shadow_cdb);\n-\t\t\tif (rc) {\n-\t\t\t\tTFP_DRV_LOG(ERR,\n-\t\t\t\t    \"%s: Ident shadow DB creation failed\\n\",\n-\t\t\t\t    tf_dir_2_str(i));\n-\n-\t\t\t\treturn rc;\n-\t\t\t}\n-\t\t\tshadow_init = 1;\n-\t\t}\n \t}\n \n \t/* No db created */\n@@ -111,7 +81,6 @@ tf_ident_unbind(struct tf *tfp)\n \tint rc = 0;\n \tint i;\n \tstruct tf_rm_free_db_parms fparms = { 0 };\n-\tstruct tf_shadow_ident_free_db_parms sparms = { 0 };\n \tstruct ident_rm_db *ident_db;\n \tvoid *ident_db_ptr = NULL;\n \n@@ -132,22 +101,8 @@ tf_ident_unbind(struct tf *tfp)\n \t\t\tTFP_DRV_LOG(ERR,\n \t\t\t\t    \"rm free failed on unbind\\n\");\n \t\t}\n-\t\tif (shadow_init) {\n-\t\t\tsparms.tf_shadow_ident_db = ident_shadow_db[i];\n-\t\t\trc = tf_shadow_ident_free_db(&sparms);\n-\t\t\tif (rc) {\n-\t\t\t\t/* TODO: If there are failures on unbind we\n-\t\t\t\t * really just have to try until all DBs are\n-\t\t\t\t * attempted to be cleared.\n-\t\t\t\t */\n-\t\t\t}\n-\t\t\tident_shadow_db[i] = NULL;\n-\t\t}\n \t\tident_db->ident_db[i] = NULL;\n \t}\n-\n-\tshadow_init = 0;\n-\n \treturn 0;\n }\n \n@@ -159,7 +114,6 @@ tf_ident_alloc(struct tf *tfp __rte_unused,\n \tuint32_t id;\n \tuint32_t base_id;\n \tstruct tf_rm_allocate_parms aparms = { 0 };\n-\tstruct tf_shadow_ident_insert_parms iparms = { 0 };\n \tstruct ident_rm_db *ident_db;\n \tvoid *ident_db_ptr = NULL;\n \n@@ -187,23 +141,7 @@ tf_ident_alloc(struct tf *tfp __rte_unused,\n \t\treturn rc;\n \t}\n \n-\tif (shadow_init) {\n-\t\tiparms.tf_shadow_ident_db = ident_shadow_db[parms->dir];\n-\t\tiparms.type = parms->type;\n-\t\tiparms.id = base_id;\n-\n-\t\trc = tf_shadow_ident_insert(&iparms);\n-\t\tif (rc) {\n-\t\t\tTFP_DRV_LOG(ERR,\n-\t\t\t\t    \"%s: Failed insert shadow DB, type:%d\\n\",\n-\t\t\t\t    tf_dir_2_str(parms->dir),\n-\t\t\t\t    parms->type);\n-\t\t\treturn rc;\n-\t\t}\n-\t}\n-\n \t*parms->id = id;\n-\n \treturn 0;\n }\n \n@@ -214,7 +152,6 @@ tf_ident_free(struct tf *tfp __rte_unused,\n \tint rc;\n \tstruct tf_rm_is_allocated_parms aparms = { 0 };\n \tstruct tf_rm_free_parms fparms = { 0 };\n-\tstruct tf_shadow_ident_remove_parms rparms = { 0 };\n \tint allocated = 0;\n \tuint32_t base_id;\n \tstruct ident_rm_db *ident_db;\n@@ -250,27 +187,6 @@ tf_ident_free(struct tf *tfp __rte_unused,\n \t\treturn -EINVAL;\n \t}\n \n-\tif (shadow_init) {\n-\t\trparms.tf_shadow_ident_db = ident_shadow_db[parms->dir];\n-\t\trparms.type = parms->type;\n-\t\trparms.id = base_id;\n-\t\trparms.ref_cnt = parms->ref_cnt;\n-\n-\t\trc = tf_shadow_ident_remove(&rparms);\n-\t\tif (rc) {\n-\t\t\tTFP_DRV_LOG(ERR,\n-\t\t\t\t    \"%s: ref_cnt was 0 in shadow DB,\"\n-\t\t\t\t    \" type:%d, index:%d\\n\",\n-\t\t\t\t    tf_dir_2_str(parms->dir),\n-\t\t\t\t    parms->type,\n-\t\t\t\t    parms->id);\n-\t\t\treturn rc;\n-\t\t}\n-\n-\t\tif (*rparms.ref_cnt > 0)\n-\t\t\treturn 0;\n-\t}\n-\n \t/* Free requested element */\n \tfparms.rm_db = ident_db->ident_db[parms->dir];\n \tfparms.subtype = parms->type;\n@@ -294,7 +210,6 @@ tf_ident_search(struct tf *tfp __rte_unused,\n {\n \tint rc;\n \tstruct tf_rm_is_allocated_parms aparms = { 0 };\n-\tstruct tf_shadow_ident_search_parms sparms = { 0 };\n \tint allocated = 0;\n \tuint32_t base_id;\n \tstruct ident_rm_db *ident_db;\n@@ -302,13 +217,6 @@ tf_ident_search(struct tf *tfp __rte_unused,\n \n \tTF_CHECK_PARMS2(tfp, parms);\n \n-\tif (!shadow_init) {\n-\t\tTFP_DRV_LOG(ERR,\n-\t\t\t    \"%s: Identifier Shadow copy is not enabled\\n\",\n-\t\t\t    tf_dir_2_str(parms->dir));\n-\t\treturn -EINVAL;\n-\t}\n-\n \trc = tf_session_get_db(tfp, TF_MODULE_TYPE_IDENTIFIER, &ident_db_ptr);\n \tif (rc) {\n \t\tTFP_DRV_LOG(ERR,\n@@ -336,22 +244,6 @@ tf_ident_search(struct tf *tfp __rte_unused,\n \t\t\t    parms->search_id);\n \t\treturn -EINVAL;\n \t}\n-\n-\tsparms.tf_shadow_ident_db = ident_shadow_db[parms->dir];\n-\tsparms.type = parms->type;\n-\tsparms.search_id = base_id;\n-\tsparms.hit = parms->hit;\n-\tsparms.ref_cnt = parms->ref_cnt;\n-\n-\trc = tf_shadow_ident_search(&sparms);\n-\tif (rc) {\n-\t\tTFP_DRV_LOG(ERR,\n-\t\t\t    \"%s: Failed search shadow DB, type:%d\\n\",\n-\t\t\t    tf_dir_2_str(parms->dir),\n-\t\t\t    parms->type);\n-\t\treturn rc;\n-\t}\n-\n \treturn 0;\n }\n \ndiff --git a/drivers/net/bnxt/tf_core/tf_identifier.h b/drivers/net/bnxt/tf_core/tf_identifier.h\nindex 55c093802e..285ff11ce2 100644\n--- a/drivers/net/bnxt/tf_core/tf_identifier.h\n+++ b/drivers/net/bnxt/tf_core/tf_identifier.h\n@@ -22,10 +22,6 @@ struct tf_ident_cfg_parms {\n \t * [in] Identifier configuration array\n \t */\n \tstruct tf_rm_element_cfg *cfg;\n-\t/**\n-\t * [in] Boolean controlling the request shadow copy.\n-\t */\n-\tbool shadow_copy;\n \t/**\n \t * [in] Session resource allocations\n \t */\ndiff --git a/drivers/net/bnxt/tf_core/tf_if_tbl.h b/drivers/net/bnxt/tf_core/tf_if_tbl.h\nindex 9f081c8196..bea2f07324 100644\n--- a/drivers/net/bnxt/tf_core/tf_if_tbl.h\n+++ b/drivers/net/bnxt/tf_core/tf_if_tbl.h\n@@ -84,14 +84,6 @@ struct tf_if_tbl_cfg_parms {\n \t * Table Type element configuration array\n \t */\n \tstruct tf_if_tbl_cfg *cfg;\n-\t/**\n-\t * Shadow table type configuration array\n-\t */\n-\tstruct tf_shadow_if_tbl_cfg *shadow_cfg;\n-\t/**\n-\t * Boolean controlling the request shadow copy.\n-\t */\n-\tbool shadow_copy;\n };\n \n /**\ndiff --git a/drivers/net/bnxt/tf_core/tf_session.c b/drivers/net/bnxt/tf_core/tf_session.c\nindex c30c0e7029..d0a0916c6a 100644\n--- a/drivers/net/bnxt/tf_core/tf_session.c\n+++ b/drivers/net/bnxt/tf_core/tf_session.c\n@@ -141,8 +141,6 @@ tf_session_create(struct tf *tfp,\n \t/* Return the allocated session id */\n \tsession_id->id = session->session_id.id;\n \n-\tsession->shadow_copy = parms->open_cfg->shadow_copy;\n-\n \t/* Init session client list */\n \tll_init(&session->client_ll);\n \n@@ -200,7 +198,6 @@ tf_session_create(struct tf *tfp,\n \n \trc = tf_dev_bind(tfp,\n \t\t\t parms->open_cfg->device_type,\n-\t\t\t session->shadow_copy,\n \t\t\t &parms->open_cfg->resources,\n \t\t\t parms->open_cfg->wc_num_slices,\n \t\t\t &session->dev);\n@@ -360,7 +357,7 @@ tf_session_client_create(struct tf *tfp,\n  *   - (-EINVAL) on failure.\n  *   - (-ENOTFOUND) error, client not owned by the session.\n  *   - (-ENOTSUPP) error, unable to destroy client as its the last\n- *                 client. Please use the tf_session_close().\n+ *\t\t client. Please use the tf_session_close().\n  */\n static int\n tf_session_client_destroy(struct tf *tfp,\n@@ -992,8 +989,6 @@ tf_session_set_db(struct tf *tfp,\n \treturn rc;\n }\n \n-#ifdef TF_TCAM_SHARED\n-\n int\n tf_session_get_tcam_shared_db(struct tf *tfp,\n \t\t\t      void **tcam_shared_db_handle)\n@@ -1070,8 +1065,6 @@ tf_session_set_sram_db(struct tf *tfp,\n \treturn rc;\n }\n \n-#endif /* TF_TCAM_SHARED */\n-\n int\n tf_session_get_global_db(struct tf *tfp,\n \t\t\t void **global_handle)\ndiff --git a/drivers/net/bnxt/tf_core/tf_session.h b/drivers/net/bnxt/tf_core/tf_session.h\nindex 19a96c28b1..a6716dfff4 100644\n--- a/drivers/net/bnxt/tf_core/tf_session.h\n+++ b/drivers/net/bnxt/tf_core/tf_session.h\n@@ -48,8 +48,7 @@\n  *\n  * Shared memory containing private TruFlow session information.\n  * Through this structure the session can keep track of resource\n- * allocations and (if so configured) any shadow copy of flow\n- * information. It also holds info about Session Clients.\n+ * allocations.  It also holds info about Session Clients.\n  *\n  * Memory is assigned to the Truflow instance by way of\n  * tf_open_session. Memory is allocated and owned by i.e. ULP.\n@@ -86,19 +85,6 @@ struct tf_session {\n \t */\n \tbool shared_session_creator;\n \n-\t/**\n-\t * Boolean controlling the use and availability of shadow\n-\t * copy. Shadow copy will allow the TruFlow Core to keep track\n-\t * of resource content on the firmware side without having to\n-\t * query firmware. Additional private session core_data will\n-\t * be allocated if this boolean is set to 'true', default\n-\t * 'false'.\n-\t *\n-\t * Size of memory depends on the NVM Resource settings for the\n-\t * control channel.\n-\t */\n-\tbool shadow_copy;\n-\n \t/**\n \t * Session Reference Count. To keep track of functions per\n \t * session the ref_count is updated. There is also a\n@@ -159,12 +145,10 @@ struct tf_session {\n \t */\n \tvoid *em_pool[TF_DIR_MAX];\n \n-#ifdef TF_TCAM_SHARED\n \t/**\n \t * tcam db reference for the session\n \t */\n \tvoid *tcam_shared_db_handle;\n-#endif /* TF_TCAM_SHARED */\n \n \t/**\n \t * SRAM db reference for the session\ndiff --git a/drivers/net/bnxt/tf_core/tf_shadow_identifier.c b/drivers/net/bnxt/tf_core/tf_shadow_identifier.c\ndeleted file mode 100644\nindex dc9606712c..0000000000\n--- a/drivers/net/bnxt/tf_core/tf_shadow_identifier.c\n+++ /dev/null\n@@ -1,190 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2019-2021 Broadcom\n- * All rights reserved.\n- */\n-\n-#include <rte_common.h>\n-\n-#include \"tf_shadow_identifier.h\"\n-#include \"tf_common.h\"\n-#include \"tf_util.h\"\n-#include \"tfp.h\"\n-\n-/**\n- * Shadow identifier DB element\n- */\n-struct tf_shadow_ident_element {\n-\t/**\n-\t * Identifier\n-\t */\n-\tuint32_t *id;\n-\n-\t/**\n-\t * Reference count, array of number of identifier type entries\n-\t */\n-\tuint32_t *ref_count;\n-};\n-\n-/**\n- * Shadow identifier DB definition\n- */\n-struct tf_shadow_ident_db {\n-\t/**\n-\t * Number of elements in the DB\n-\t */\n-\tuint16_t num_entries;\n-\n-\t/**\n-\t * The DB consists of an array of elements\n-\t */\n-\tstruct tf_shadow_ident_element *db;\n-};\n-\n-int\n-tf_shadow_ident_create_db(struct tf_shadow_ident_create_db_parms *parms)\n-{\n-\tint rc;\n-\tint i;\n-\tstruct tfp_calloc_parms cparms;\n-\tstruct tf_shadow_ident_db *shadow_db;\n-\tstruct tf_shadow_ident_element *db;\n-\n-\tTF_CHECK_PARMS1(parms);\n-\n-\t/* Build the shadow DB per the request */\n-\tcparms.nitems = 1;\n-\tcparms.size = sizeof(struct tf_shadow_ident_db);\n-\tcparms.alignment = 0;\n-\trc = tfp_calloc(&cparms);\n-\tif (rc)\n-\t\treturn rc;\n-\tshadow_db = (void *)cparms.mem_va;\n-\n-\t/* Build the DB within shadow DB */\n-\tcparms.nitems = parms->num_elements;\n-\tcparms.size = sizeof(struct tf_shadow_ident_element);\n-\trc = tfp_calloc(&cparms);\n-\tif (rc)\n-\t\treturn rc;\n-\tshadow_db->db = (struct tf_shadow_ident_element *)cparms.mem_va;\n-\tshadow_db->num_entries = parms->num_elements;\n-\n-\tdb = shadow_db->db;\n-\tfor (i = 0; i < parms->num_elements; i++) {\n-\t\t/* If the element didn't request an allocation no need\n-\t\t * to create a pool nor verify if we got a reservation.\n-\t\t */\n-\t\tif (parms->cfg->alloc_cnt[i] == 0)\n-\t\t\tcontinue;\n-\n-\t\t/* Create array */\n-\t\tcparms.nitems = parms->cfg->alloc_cnt[i];\n-\t\tcparms.size = sizeof(uint32_t);\n-\t\trc = tfp_calloc(&cparms);\n-\t\tif (rc) {\n-\t\t\tTFP_DRV_LOG(ERR,\n-\t\t\t\t    \"%s: Array alloc failed, type:%d\\n\",\n-\t\t\t\t    tf_dir_2_str(parms->dir),\n-\t\t\t\t    i);\n-\t\t\tgoto fail;\n-\t\t}\n-\t\tdb[i].ref_count = (uint32_t *)cparms.mem_va;\n-\t}\n-\n-\t*parms->tf_shadow_ident_db = (void *)shadow_db;\n-\n-\treturn 0;\n-fail:\n-\ttfp_free((void *)db->ref_count);\n-\ttfp_free((void *)db);\n-\ttfp_free((void *)shadow_db);\n-\tparms->tf_shadow_ident_db = NULL;\n-\n-\treturn -EINVAL;\n-}\n-\n-int\n-tf_shadow_ident_free_db(struct tf_shadow_ident_free_db_parms *parms)\n-{\n-\tint i;\n-\tstruct tf_shadow_ident_db *shadow_db;\n-\n-\tTF_CHECK_PARMS1(parms);\n-\n-\tshadow_db = (struct tf_shadow_ident_db *)parms->tf_shadow_ident_db;\n-\tfor (i = 0; i < shadow_db->num_entries; i++)\n-\t\ttfp_free((void *)shadow_db->db[i].ref_count);\n-\n-\ttfp_free((void *)shadow_db->db);\n-\ttfp_free((void *)parms->tf_shadow_ident_db);\n-\n-\treturn 0;\n-}\n-\n-int\n-tf_shadow_ident_search(struct tf_shadow_ident_search_parms *parms)\n-{\n-\tstruct tf_shadow_ident_db *shadow_db;\n-\tuint32_t ref_cnt = 0;\n-\n-\tTF_CHECK_PARMS1(parms);\n-\n-\tshadow_db = (struct tf_shadow_ident_db *)parms->tf_shadow_ident_db;\n-\tref_cnt = shadow_db->db[parms->type].ref_count[parms->search_id];\n-\tif (ref_cnt > 0) {\n-\t\t*parms->hit = 1;\n-\t\t*parms->ref_cnt = ++ref_cnt;\n-\t\tshadow_db->db[parms->type].ref_count[parms->search_id] =\n-\t\t\t\t\t\t\t\tref_cnt;\n-\t} else {\n-\t\t*parms->hit = 0;\n-\t\t*parms->ref_cnt = 0;\n-\t}\n-\n-\n-\treturn 0;\n-}\n-\n-#define ID_REF_CNT_MAX 0xffffffff\n-int\n-tf_shadow_ident_insert(struct tf_shadow_ident_insert_parms *parms)\n-{\n-\tstruct tf_shadow_ident_db *shadow_db;\n-\n-\tTF_CHECK_PARMS1(parms);\n-\n-\tshadow_db = (struct tf_shadow_ident_db *)parms->tf_shadow_ident_db;\n-\n-\t/* In case of overflow, ref count keeps the max value */\n-\tif (shadow_db->db[parms->type].ref_count[parms->id] < ID_REF_CNT_MAX)\n-\t\tshadow_db->db[parms->type].ref_count[parms->id]++;\n-\telse\n-\t\tTFP_DRV_LOG(ERR,\n-\t\t\t    \"Identifier %d in type %d reaches the max ref_cnt\\n\",\n-\t\t\t    parms->type,\n-\t\t\t    parms->id);\n-\n-\tparms->ref_cnt = shadow_db->db[parms->type].ref_count[parms->id];\n-\n-\treturn 0;\n-}\n-\n-int\n-tf_shadow_ident_remove(struct tf_shadow_ident_remove_parms *parms)\n-{\n-\tstruct tf_shadow_ident_db *shadow_db;\n-\tuint32_t ref_cnt = 0;\n-\n-\tTF_CHECK_PARMS1(parms);\n-\n-\tshadow_db = (struct tf_shadow_ident_db *)parms->tf_shadow_ident_db;\n-\tref_cnt = shadow_db->db[parms->type].ref_count[parms->id];\n-\tif (ref_cnt > 0)\n-\t\tshadow_db->db[parms->type].ref_count[parms->id]--;\n-\telse\n-\t\treturn -EINVAL;\n-\n-\t*parms->ref_cnt = shadow_db->db[parms->type].ref_count[parms->id];\n-\n-\treturn 0;\n-}\ndiff --git a/drivers/net/bnxt/tf_core/tf_shadow_identifier.h b/drivers/net/bnxt/tf_core/tf_shadow_identifier.h\ndeleted file mode 100644\nindex ff41eaad9f..0000000000\n--- a/drivers/net/bnxt/tf_core/tf_shadow_identifier.h\n+++ /dev/null\n@@ -1,229 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2019-2021 Broadcom\n- * All rights reserved.\n- */\n-\n-#ifndef _TF_SHADOW_IDENTIFIER_H_\n-#define _TF_SHADOW_IDENTIFIER_H_\n-\n-#include \"tf_core.h\"\n-\n-struct tf;\n-\n-/**\n- * The Shadow Identifier module provides shadow DB handling for identifier based\n- * TF types. A shadow DB provides the capability that allows for reuse\n- * of TF resources.\n- *\n- * A Shadow identifier DB is intended to be used by the Identifier Type module\n- * only.\n- */\n-\n-/**\n- * Shadow DB configuration information for a single identifier type.\n- *\n- * It is used in an array of identifier types. The array must be ordered\n- * by the TF type is represents.\n- */\n-struct tf_shadow_ident_cfg_parms {\n-\t/**\n-\t * TF Identifier type\n-\t */\n-\tenum tf_identifier_type type;\n-\n-\t/**\n-\t * Number of entries the Shadow DB needs to hold\n-\t */\n-\tint num_entries;\n-\n-\t/**\n-\t * Resource allocation count array. This array content\n-\t * originates from the tf_session_resources that is passed in\n-\t * on session open.\n-\t * Array size is num_elements.\n-\t */\n-\tuint16_t *alloc_cnt;\n-};\n-\n-/**\n- * Shadow identifier DB creation parameters\n- */\n-struct tf_shadow_ident_create_db_parms {\n-\t/**\n-\t * [in] Receive or transmit direction.\n-\t */\n-\tenum tf_dir dir;\n-\t/**\n-\t * [in] Configuration information for the shadow db\n-\t */\n-\tstruct tf_shadow_ident_cfg_parms *cfg;\n-\t/**\n-\t * [in] Number of elements in the parms structure\n-\t */\n-\tuint16_t num_elements;\n-\t/**\n-\t * [out] Shadow identifier DB handle\n-\t */\n-\tvoid **tf_shadow_ident_db;\n-};\n-\n-/**\n- * Shadow identifier DB free parameters\n- */\n-struct tf_shadow_ident_free_db_parms {\n-\t/**\n-\t * Shadow identifier DB handle\n-\t */\n-\tvoid *tf_shadow_ident_db;\n-};\n-\n-/**\n- * Shadow identifier search parameters\n- */\n-struct tf_shadow_ident_search_parms {\n-\t/**\n-\t * [in] Shadow identifier DB handle\n-\t */\n-\tvoid *tf_shadow_ident_db;\n-\t/**\n-\t * [in] Identifier type\n-\t */\n-\tenum tf_identifier_type type;\n-\t/**\n-\t * [in] id to search\n-\t */\n-\tuint16_t search_id;\n-\t/**\n-\t * [out] Index of the found element returned if hit\n-\t */\n-\tbool *hit;\n-\t/**\n-\t * [out] Reference count incremented if hit\n-\t */\n-\tuint32_t *ref_cnt;\n-};\n-\n-/**\n- * Shadow identifier insert parameters\n- */\n-struct tf_shadow_ident_insert_parms {\n-\t/**\n-\t * [in] Shadow identifier DB handle\n-\t */\n-\tvoid *tf_shadow_ident_db;\n-\t/**\n-\t * [in] Tbl type\n-\t */\n-\tenum tf_identifier_type type;\n-\t/**\n-\t * [in] Entry to update\n-\t */\n-\tuint16_t id;\n-\t/**\n-\t * [out] Reference count after insert\n-\t */\n-\tuint32_t ref_cnt;\n-};\n-\n-/**\n- * Shadow identifier remove parameters\n- */\n-struct tf_shadow_ident_remove_parms {\n-\t/**\n-\t * [in] Shadow identifier DB handle\n-\t */\n-\tvoid *tf_shadow_ident_db;\n-\t/**\n-\t * [in] Tbl type\n-\t */\n-\tenum tf_identifier_type type;\n-\t/**\n-\t * [in] Entry to update\n-\t */\n-\tuint16_t id;\n-\t/**\n-\t * [out] Reference count after removal\n-\t */\n-\tuint32_t *ref_cnt;\n-};\n-\n-/**\n- * @page shadow_ident Shadow identifier DB\n- *\n- * @ref tf_shadow_ident_create_db\n- *\n- * @ref tf_shadow_ident_free_db\n- *\n- * @reg tf_shadow_ident_search\n- *\n- * @reg tf_shadow_ident_insert\n- *\n- * @reg tf_shadow_ident_remove\n- */\n-\n-/**\n- * Creates and fills a Shadow identifier DB. The DB is indexed per the\n- * parms structure.\n- *\n- * [in] parms\n- *   Pointer to create db parameters\n- *\n- * Returns\n- *   - (0) if successful.\n- *   - (-EINVAL) on failure.\n- */\n-int tf_shadow_ident_create_db(struct tf_shadow_ident_create_db_parms *parms);\n-\n-/**\n- * Closes the Shadow identifier DB and frees all allocated\n- * resources per the associated database.\n- *\n- * [in] parms\n- *   Pointer to the free DB parameters\n- *\n- * Returns\n- *   - (0) if successful.\n- *   - (-EINVAL) on failure.\n- */\n-int tf_shadow_ident_free_db(struct tf_shadow_ident_free_db_parms *parms);\n-\n-/**\n- * Search Shadow identifier db for matching result\n- *\n- * [in] parms\n- *   Pointer to the search parameters\n- *\n- * Returns\n- *   - (0) if successful, element was found.\n- *   - (-EINVAL) on failure.\n- */\n-int tf_shadow_ident_search(struct tf_shadow_ident_search_parms *parms);\n-\n-/**\n- * Inserts an element into the Shadow identifier DB. Ref_count after insert\n- * will be incremented.\n- *\n- * [in] parms\n- *   Pointer to insert parameters\n- *\n- * Returns\n- *   - (0) if successful.\n- *   - (-EINVAL) on failure.\n- */\n-int tf_shadow_ident_insert(struct tf_shadow_ident_insert_parms *parms);\n-\n-/**\n- * Removes an element from the Shadow identifier DB. Will fail if the\n- * elements ref_count is 0. Ref_count after removal will be\n- * decremented.\n- *\n- * [in] parms\n- *   Pointer to remove parameter\n- *\n- * Returns\n- *   - (0) if successful.\n- *   - (-EINVAL) on failure.\n- */\n-int tf_shadow_ident_remove(struct tf_shadow_ident_remove_parms *parms);\n-\n-#endif /* _TF_SHADOW_IDENTIFIER_H_ */\ndiff --git a/drivers/net/bnxt/tf_core/tf_shadow_tcam.c b/drivers/net/bnxt/tf_core/tf_shadow_tcam.c\ndeleted file mode 100644\nindex 5fcd1f9107..0000000000\n--- a/drivers/net/bnxt/tf_core/tf_shadow_tcam.c\n+++ /dev/null\n@@ -1,837 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2019-2021 Broadcom\n- * All rights reserved.\n- */\n-\n-#include \"tf_common.h\"\n-#include \"tf_util.h\"\n-#include \"tfp.h\"\n-#include \"tf_tcam.h\"\n-#include \"tf_shadow_tcam.h\"\n-#include \"tf_hash.h\"\n-\n-/**\n- * The implementation includes 3 tables per tcam table type.\n- * - hash table\n- *   - sized so that a minimum of 4 slots per shadow entry are available to\n- *   minimize the likelihood of collisions.\n- * - shadow key table\n- *   - sized to the number of entries requested and is directly indexed\n- *   - the index is zero based and is the tcam index - the base address\n- *   - the key and mask are stored in the key table.\n- *   - The stored key is the AND of the key/mask in order to eliminate the need\n- *   to compare both the key and mask.\n- * - shadow result table\n- *   - the result table is stored separately since it only needs to be accessed\n- *   when the key matches.\n- *   - the result has a back pointer to the hash table via the hb handle.  The\n- *   hb handle is a 32 bit representation of the hash with a valid bit, bucket\n- *   element index, and the hash index.  It is necessary to store the hb handle\n- *   with the result since subsequent removes only provide the tcam index.\n- *\n- * - Max entries is limited in the current implementation since bit 15 is the\n- *   valid bit in the hash table.\n- * - A 16bit hash is calculated and masked based on the number of entries\n- * - 64b wide bucket is used and broken into 4x16bit elements.\n- *   This decision is based on quicker bucket scanning to determine if any\n- *   elements are in use.\n- * - bit 15 of each bucket element is the valid, this is done to prevent having\n- *   to read the larger key/result data for determining VALID.  It also aids\n- *   in the more efficient scanning of the bucket for slot usage.\n- */\n-\n-/*\n- * The maximum number of shadow entries supported.  The value also doubles as\n- * the maximum number of hash buckets.  There are only 15 bits of data per\n- * bucket to point to the shadow tables.\n- */\n-#define TF_SHADOW_TCAM_ENTRIES_MAX (1 << 15)\n-\n-/* The number of elements(BE) per hash bucket (HB) */\n-#define TF_SHADOW_TCAM_HB_NUM_ELEM (4)\n-#define TF_SHADOW_TCAM_BE_VALID (1 << 15)\n-#define TF_SHADOW_TCAM_BE_IS_VALID(be) (((be) & TF_SHADOW_TCAM_BE_VALID) != 0)\n-\n-/**\n- * The hash bucket handle is 32b\n- * - bit 31, the Valid bit\n- * - bit 29-30, the element\n- * - bits 0-15, the hash idx (is masked based on the allocated size)\n- */\n-#define TF_SHADOW_TCAM_HB_HANDLE_IS_VALID(hndl) (((hndl) & (1 << 31)) != 0)\n-#define TF_SHADOW_TCAM_HB_HANDLE_CREATE(idx, be) ((1 << 31) | \\\n-\t\t\t\t\t\t  ((be) << 29) | (idx))\n-\n-#define TF_SHADOW_TCAM_HB_HANDLE_BE_GET(hdl) (((hdl) >> 29) & \\\n-\t\t\t\t\t      (TF_SHADOW_TCAM_HB_NUM_ELEM - 1))\n-\n-#define TF_SHADOW_TCAM_HB_HANDLE_HASH_GET(ctxt, hdl)((hdl) & \\\n-\t\t\t\t\t\t     (ctxt)->hash_ctxt.hid_mask)\n-\n-/**\n- * The idx provided by the caller is within a region, so currently the base is\n- * either added or subtracted from the idx to ensure it can be used as a\n- * compressed index\n- */\n-\n-/* Convert the tcam index to a shadow index */\n-#define TF_SHADOW_TCAM_IDX_TO_SHIDX(ctxt, idx) ((idx) - \\\n-\t\t\t\t\t\t(ctxt)->shadow_ctxt.base_addr)\n-\n-/* Convert the shadow index to a tcam index */\n-#define TF_SHADOW_TCAM_SHIDX_TO_IDX(ctxt, idx) ((idx) + \\\n-\t\t\t\t\t\t(ctxt)->shadow_ctxt.base_addr)\n-\n-/* Simple helper masks for clearing en element from the bucket */\n-#define TF_SHADOW_TCAM_BE0_MASK_CLEAR(hb) ((hb) & 0xffffffffffff0000ull)\n-#define TF_SHADOW_TCAM_BE1_MASK_CLEAR(hb) ((hb) & 0xffffffff0000ffffull)\n-#define TF_SHADOW_TCAM_BE2_MASK_CLEAR(hb) ((hb) & 0xffff0000ffffffffull)\n-#define TF_SHADOW_TCAM_BE3_MASK_CLEAR(hb) ((hb) & 0x0000ffffffffffffull)\n-\n-/**\n- * This should be coming from external, but for now it is assumed that no key\n- * is greater than 1K bits and no result is bigger than 128 bits.  This makes\n- * allocation of the hash table easier without having to allocate on the fly.\n- */\n-#define TF_SHADOW_TCAM_MAX_KEY_SZ 128\n-#define TF_SHADOW_TCAM_MAX_RESULT_SZ 16\n-\n-/*\n- * Local only defines for the internal data.\n- */\n-\n-/**\n- * tf_shadow_tcam_shadow_key_entry is the key/mask entry of the key table.\n- * The key stored in the table is the masked version of the key.  This is done\n- * to eliminate the need of comparing both the key and mask.\n- */\n-struct tf_shadow_tcam_shadow_key_entry {\n-\tuint8_t key[TF_SHADOW_TCAM_MAX_KEY_SZ];\n-\tuint8_t mask[TF_SHADOW_TCAM_MAX_KEY_SZ];\n-};\n-\n-/**\n- * tf_shadow_tcam_shadow_result_entry is the result table entry.\n- * The result table writes are broken into two phases:\n- * - The search phase, which stores the hb_handle and key size and\n- * - The set phase, which writes the result, refcnt, and result size\n- */\n-struct tf_shadow_tcam_shadow_result_entry {\n-\tuint8_t result[TF_SHADOW_TCAM_MAX_RESULT_SZ];\n-\tuint16_t result_size;\n-\tuint16_t key_size;\n-\tuint32_t refcnt;\n-\tuint32_t hb_handle;\n-};\n-\n-/**\n- * tf_shadow_tcam_shadow_ctxt holds all information for accessing the key and\n- * result tables.\n- */\n-struct tf_shadow_tcam_shadow_ctxt {\n-\tstruct tf_shadow_tcam_shadow_key_entry *sh_key_tbl;\n-\tstruct tf_shadow_tcam_shadow_result_entry *sh_res_tbl;\n-\tuint32_t base_addr;\n-\tuint16_t num_entries;\n-\tuint16_t alloc_idx;\n-};\n-\n-/**\n- * tf_shadow_tcam_hash_ctxt holds all information related to accessing the hash\n- * table.\n- */\n-struct tf_shadow_tcam_hash_ctxt {\n-\tuint64_t *hashtbl;\n-\tuint16_t hid_mask;\n-\tuint16_t hash_entries;\n-};\n-\n-/**\n- * tf_shadow_tcam_ctxt holds the hash and shadow tables for the current shadow\n- * tcam db.  This structure is per tcam table type as each tcam table has it's\n- * own shadow and hash table.\n- */\n-struct tf_shadow_tcam_ctxt {\n-\tstruct tf_shadow_tcam_shadow_ctxt shadow_ctxt;\n-\tstruct tf_shadow_tcam_hash_ctxt hash_ctxt;\n-};\n-\n-/**\n- * tf_shadow_tcam_db is the allocated db structure returned as an opaque\n- * void * pointer to the caller during create db.  It holds the pointers for\n- * each tcam associated with the db.\n- */\n-struct tf_shadow_tcam_db {\n-\t/* Each context holds the shadow and hash table information */\n-\tstruct tf_shadow_tcam_ctxt *ctxt[TF_TCAM_TBL_TYPE_MAX];\n-};\n-\n-/**\n- * Returns the number of entries in the contexts shadow table.\n- */\n-static inline uint16_t\n-tf_shadow_tcam_sh_num_entries_get(struct tf_shadow_tcam_ctxt *ctxt)\n-{\n-\treturn ctxt->shadow_ctxt.num_entries;\n-}\n-\n-/**\n- * Compare the give key with the key in the shadow table.\n- *\n- * Returns 0 if the keys match\n- */\n-static int\n-tf_shadow_tcam_key_cmp(struct tf_shadow_tcam_ctxt *ctxt,\n-\t\t       uint8_t *key,\n-\t\t       uint8_t *mask,\n-\t\t       uint16_t sh_idx,\n-\t\t       uint16_t size)\n-{\n-\tif (size != ctxt->shadow_ctxt.sh_res_tbl[sh_idx].key_size ||\n-\t    sh_idx >= tf_shadow_tcam_sh_num_entries_get(ctxt) || !key || !mask)\n-\t\treturn -1;\n-\n-\treturn memcmp(key, ctxt->shadow_ctxt.sh_key_tbl[sh_idx].key, size);\n-}\n-\n-/**\n- * Copies the shadow result to the result.\n- *\n- * Returns 0 on failure\n- */\n-static void *\n-tf_shadow_tcam_res_cpy(struct tf_shadow_tcam_ctxt *ctxt,\n-\t\t       uint8_t *result,\n-\t\t       uint16_t sh_idx,\n-\t\t       uint16_t size)\n-{\n-\tif (sh_idx >= tf_shadow_tcam_sh_num_entries_get(ctxt) || !result)\n-\t\treturn 0;\n-\n-\tif (ctxt->shadow_ctxt.sh_res_tbl[sh_idx].result_size != size)\n-\t\treturn 0;\n-\n-\treturn memcpy(result,\n-\t\t      ctxt->shadow_ctxt.sh_res_tbl[sh_idx].result,\n-\t\t      size);\n-}\n-\n-/**\n- * Using a software based CRC function for now, but will look into using hw\n- * assisted in the future.\n- */\n-static uint32_t\n-tf_shadow_tcam_crc32_calc(uint8_t *key, uint32_t len)\n-{\n-\treturn tf_hash_calc_crc32(key, len);\n-}\n-\n-/**\n- * Free the memory associated with the context.\n- */\n-static void\n-tf_shadow_tcam_ctxt_delete(struct tf_shadow_tcam_ctxt *ctxt)\n-{\n-\tif (!ctxt)\n-\t\treturn;\n-\n-\ttfp_free(ctxt->hash_ctxt.hashtbl);\n-\ttfp_free(ctxt->shadow_ctxt.sh_key_tbl);\n-\ttfp_free(ctxt->shadow_ctxt.sh_res_tbl);\n-}\n-\n-/**\n- * The TF Shadow TCAM context is per TCAM and holds all information relating to\n- * managing the shadow and search capability.  This routine allocated data that\n- * needs to be deallocated by the tf_shadow_tcam_ctxt_delete prior when deleting\n- * the shadow db.\n- */\n-static int\n-tf_shadow_tcam_ctxt_create(struct tf_shadow_tcam_ctxt *ctxt,\n-\t\t\t   uint16_t num_entries,\n-\t\t\t   uint16_t base_addr)\n-{\n-\tstruct tfp_calloc_parms cparms;\n-\tuint16_t hash_size = 1;\n-\tuint16_t hash_mask;\n-\tint rc;\n-\n-\t/* Hash table is a power of two that holds the number of entries */\n-\tif (num_entries > TF_SHADOW_TCAM_ENTRIES_MAX) {\n-\t\tTFP_DRV_LOG(ERR, \"Too many entries for shadow %d > %d\\n\",\n-\t\t\t    num_entries,\n-\t\t\t    TF_SHADOW_TCAM_ENTRIES_MAX);\n-\t\treturn -ENOMEM;\n-\t}\n-\n-\twhile (hash_size < num_entries)\n-\t\thash_size = hash_size << 1;\n-\n-\thash_mask = hash_size - 1;\n-\n-\t/* Allocate the hash table */\n-\tcparms.nitems = hash_size;\n-\tcparms.size = sizeof(uint64_t);\n-\tcparms.alignment = 0;\n-\trc = tfp_calloc(&cparms);\n-\tif (rc)\n-\t\tgoto error;\n-\tctxt->hash_ctxt.hashtbl = cparms.mem_va;\n-\tctxt->hash_ctxt.hid_mask = hash_mask;\n-\tctxt->hash_ctxt.hash_entries = hash_size;\n-\n-\t/* allocate the shadow tables */\n-\t/* allocate the shadow key table */\n-\tcparms.nitems = num_entries;\n-\tcparms.size = sizeof(struct tf_shadow_tcam_shadow_key_entry);\n-\tcparms.alignment = 0;\n-\trc = tfp_calloc(&cparms);\n-\tif (rc)\n-\t\tgoto error;\n-\tctxt->shadow_ctxt.sh_key_tbl = cparms.mem_va;\n-\n-\t/* allocate the shadow result table */\n-\tcparms.nitems = num_entries;\n-\tcparms.size = sizeof(struct tf_shadow_tcam_shadow_result_entry);\n-\tcparms.alignment = 0;\n-\trc = tfp_calloc(&cparms);\n-\tif (rc)\n-\t\tgoto error;\n-\tctxt->shadow_ctxt.sh_res_tbl = cparms.mem_va;\n-\n-\tctxt->shadow_ctxt.num_entries = num_entries;\n-\tctxt->shadow_ctxt.base_addr = base_addr;\n-\n-\treturn 0;\n-error:\n-\ttf_shadow_tcam_ctxt_delete(ctxt);\n-\n-\treturn -ENOMEM;\n-}\n-\n-/**\n- * Get a shadow TCAM context given the db and the TCAM type\n- */\n-static struct tf_shadow_tcam_ctxt *\n-tf_shadow_tcam_ctxt_get(struct tf_shadow_tcam_db *shadow_db,\n-\t\t\tenum tf_tcam_tbl_type type)\n-{\n-\tif (type >= TF_TCAM_TBL_TYPE_MAX ||\n-\t    !shadow_db ||\n-\t    !shadow_db->ctxt[type])\n-\t\treturn NULL;\n-\n-\treturn shadow_db->ctxt[type];\n-}\n-\n-/**\n- * Sets the hash entry into the table given the TCAM context, hash bucket\n- * handle, and shadow index.\n- */\n-static inline int\n-tf_shadow_tcam_set_hash_entry(struct tf_shadow_tcam_ctxt *ctxt,\n-\t\t\t      uint32_t hb_handle,\n-\t\t\t      uint16_t sh_idx)\n-{\n-\tuint16_t hid = TF_SHADOW_TCAM_HB_HANDLE_HASH_GET(ctxt, hb_handle);\n-\tuint16_t be = TF_SHADOW_TCAM_HB_HANDLE_BE_GET(hb_handle);\n-\tuint64_t entry = sh_idx | TF_SHADOW_TCAM_BE_VALID;\n-\n-\tif (hid >= ctxt->hash_ctxt.hash_entries)\n-\t\treturn -EINVAL;\n-\n-\tctxt->hash_ctxt.hashtbl[hid] |= entry << (be * 16);\n-\treturn 0;\n-}\n-\n-/**\n- * Clears the hash entry given the TCAM context and hash bucket handle.\n- */\n-static inline void\n-tf_shadow_tcam_clear_hash_entry(struct tf_shadow_tcam_ctxt *ctxt,\n-\t\t\t\tuint32_t hb_handle)\n-{\n-\tuint16_t hid, be;\n-\tuint64_t *bucket;\n-\n-\tif (!TF_SHADOW_TCAM_HB_HANDLE_IS_VALID(hb_handle))\n-\t\treturn;\n-\n-\thid = TF_SHADOW_TCAM_HB_HANDLE_HASH_GET(ctxt, hb_handle);\n-\tbe = TF_SHADOW_TCAM_HB_HANDLE_BE_GET(hb_handle);\n-\tbucket = &ctxt->hash_ctxt.hashtbl[hid];\n-\n-\tswitch (be) {\n-\tcase 0:\n-\t\t*bucket = TF_SHADOW_TCAM_BE0_MASK_CLEAR(*bucket);\n-\t\tbreak;\n-\tcase 1:\n-\t\t*bucket = TF_SHADOW_TCAM_BE1_MASK_CLEAR(*bucket);\n-\t\tbreak;\n-\tcase 2:\n-\t\t*bucket = TF_SHADOW_TCAM_BE2_MASK_CLEAR(*bucket);\n-\t\tbreak;\n-\tcase 3:\n-\t\t*bucket = TF_SHADOW_TCAM_BE2_MASK_CLEAR(*bucket);\n-\t\tbreak;\n-\tdefault:\n-\t\t/*\n-\t\t * Since the BE_GET masks non-inclusive bits, this will not\n-\t\t * happen.\n-\t\t */\n-\t\tbreak;\n-\t}\n-}\n-\n-/**\n- * Clears the shadow key and result entries given the TCAM context and\n- * shadow index.\n- */\n-static void\n-tf_shadow_tcam_clear_sh_entry(struct tf_shadow_tcam_ctxt *ctxt,\n-\t\t\t      uint16_t sh_idx)\n-{\n-\tstruct tf_shadow_tcam_shadow_key_entry *sk_entry;\n-\tstruct tf_shadow_tcam_shadow_result_entry *sr_entry;\n-\n-\tif (sh_idx >= tf_shadow_tcam_sh_num_entries_get(ctxt))\n-\t\treturn;\n-\n-\tsk_entry = &ctxt->shadow_ctxt.sh_key_tbl[sh_idx];\n-\tsr_entry = &ctxt->shadow_ctxt.sh_res_tbl[sh_idx];\n-\n-\t/*\n-\t * memset key/result to zero for now, possibly leave the data alone\n-\t * in the future and rely on the valid bit in the hash table.\n-\t */\n-\tmemset(sk_entry, 0, sizeof(struct tf_shadow_tcam_shadow_key_entry));\n-\tmemset(sr_entry, 0, sizeof(struct tf_shadow_tcam_shadow_result_entry));\n-}\n-\n-/**\n- * Binds the allocated tcam index with the hash and shadow tables.\n- * The entry will be incomplete until the set has happened with the result\n- * data.\n- */\n-int\n-tf_shadow_tcam_bind_index(struct tf_shadow_tcam_bind_index_parms *parms)\n-{\n-\tint rc;\n-\tint i;\n-\tuint16_t idx, klen;\n-\tstruct tf_shadow_tcam_ctxt *ctxt;\n-\tstruct tf_shadow_tcam_db *shadow_db;\n-\tstruct tf_shadow_tcam_shadow_key_entry *sk_entry;\n-\tstruct tf_shadow_tcam_shadow_result_entry *sr_entry;\n-\tuint8_t tkey[TF_SHADOW_TCAM_MAX_KEY_SZ];\n-\n-\tif (!parms || !TF_SHADOW_TCAM_HB_HANDLE_IS_VALID(parms->hb_handle) ||\n-\t    !parms->key || !parms->mask) {\n-\t\tTFP_DRV_LOG(ERR, \"Invalid parms\\n\");\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tshadow_db = (struct tf_shadow_tcam_db *)parms->shadow_db;\n-\tctxt = tf_shadow_tcam_ctxt_get(shadow_db, parms->type);\n-\tif (!ctxt) {\n-\t\tTFP_DRV_LOG(DEBUG, \"%s no ctxt for table\\n\",\n-\t\t\t    tf_tcam_tbl_2_str(parms->type));\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tmemset(tkey, 0, sizeof(tkey));\n-\tidx = TF_SHADOW_TCAM_IDX_TO_SHIDX(ctxt, parms->idx);\n-\tklen = parms->key_size;\n-\tif (idx >= tf_shadow_tcam_sh_num_entries_get(ctxt) ||\n-\t    klen > TF_SHADOW_TCAM_MAX_KEY_SZ) {\n-\t\tTFP_DRV_LOG(ERR, \"%s:%s Invalid len (%d) > %d || oob idx %d\\n\",\n-\t\t\t    tf_dir_2_str(parms->dir),\n-\t\t\t    tf_tcam_tbl_2_str(parms->type),\n-\t\t\t    klen,\n-\t\t\t    TF_SHADOW_TCAM_MAX_KEY_SZ, idx);\n-\n-\t\treturn -EINVAL;\n-\t}\n-\n-\trc = tf_shadow_tcam_set_hash_entry(ctxt, parms->hb_handle, idx);\n-\tif (rc)\n-\t\treturn -EINVAL;\n-\n-\tsk_entry = &ctxt->shadow_ctxt.sh_key_tbl[idx];\n-\tsr_entry = &ctxt->shadow_ctxt.sh_res_tbl[idx];\n-\n-\t/*\n-\t * Write the masked key to the table for more efficient comparisons\n-\t * later.\n-\t */\n-\tfor (i = 0; i < klen; i++)\n-\t\ttkey[i] = parms->key[i] & parms->mask[i];\n-\n-\tmemcpy(sk_entry->key, tkey, klen);\n-\tmemcpy(sk_entry->mask, parms->mask, klen);\n-\n-\t/* Write the result table */\n-\tsr_entry->key_size = parms->key_size;\n-\tsr_entry->hb_handle = parms->hb_handle;\n-\tsr_entry->refcnt = 1;\n-\n-\treturn 0;\n-}\n-\n-/**\n- * Deletes hash/shadow information if no more references.\n- *\n- * Returns 0 - The caller should delete the tcam entry in hardware.\n- * Returns non-zero - The number of references to the entry\n- */\n-int\n-tf_shadow_tcam_remove(struct tf_shadow_tcam_remove_parms *parms)\n-{\n-\tuint16_t idx;\n-\tuint32_t hb_handle;\n-\tstruct tf_shadow_tcam_ctxt *ctxt;\n-\tstruct tf_shadow_tcam_db *shadow_db;\n-\tstruct tf_tcam_free_parms *fparms;\n-\tstruct tf_shadow_tcam_shadow_result_entry *sr_entry;\n-\n-\tif (!parms || !parms->fparms) {\n-\t\tTFP_DRV_LOG(ERR, \"Invalid parms\\n\");\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tfparms = parms->fparms;\n-\n-\t/*\n-\t * Initialize the reference count to zero.  It will only be changed if\n-\t * non-zero.\n-\t */\n-\tfparms->ref_cnt = 0;\n-\n-\tshadow_db = (struct tf_shadow_tcam_db *)parms->shadow_db;\n-\tctxt = tf_shadow_tcam_ctxt_get(shadow_db, fparms->type);\n-\tif (!ctxt) {\n-\t\tTFP_DRV_LOG(DEBUG, \"%s no ctxt for table\\n\",\n-\t\t\t    tf_tcam_tbl_2_str(fparms->type));\n-\t\treturn 0;\n-\t}\n-\n-\tidx = TF_SHADOW_TCAM_IDX_TO_SHIDX(ctxt, fparms->idx);\n-\tif (idx >= tf_shadow_tcam_sh_num_entries_get(ctxt)) {\n-\t\tTFP_DRV_LOG(DEBUG, \"%s %d >= %d\\n\",\n-\t\t\t    tf_tcam_tbl_2_str(fparms->type),\n-\t\t\t    fparms->idx,\n-\t\t\t    tf_shadow_tcam_sh_num_entries_get(ctxt));\n-\t\treturn 0;\n-\t}\n-\n-\tsr_entry = &ctxt->shadow_ctxt.sh_res_tbl[idx];\n-\tif (sr_entry->refcnt <= 1) {\n-\t\thb_handle = sr_entry->hb_handle;\n-\t\ttf_shadow_tcam_clear_hash_entry(ctxt, hb_handle);\n-\t\ttf_shadow_tcam_clear_sh_entry(ctxt, idx);\n-\t} else {\n-\t\tsr_entry->refcnt--;\n-\t\tfparms->ref_cnt = sr_entry->refcnt;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-int\n-tf_shadow_tcam_search(struct tf_shadow_tcam_search_parms *parms)\n-{\n-\tuint16_t len;\n-\tuint8_t rcopy;\n-\tuint64_t bucket;\n-\tuint32_t i, hid32;\n-\tstruct tf_shadow_tcam_ctxt *ctxt;\n-\tstruct tf_shadow_tcam_db *shadow_db;\n-\tuint16_t hid16, hb_idx, hid_mask, shtbl_idx, shtbl_key, be_valid;\n-\tstruct tf_tcam_alloc_search_parms *sparms;\n-\tuint8_t tkey[TF_SHADOW_TCAM_MAX_KEY_SZ];\n-\tuint32_t be_avail = TF_SHADOW_TCAM_HB_NUM_ELEM;\n-\n-\tif (!parms || !parms->sparms) {\n-\t\tTFP_DRV_LOG(ERR, \"tcam search with invalid parms\\n\");\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tmemset(tkey, 0, sizeof(tkey));\n-\tsparms = parms->sparms;\n-\n-\t/* Initialize return values to invalid */\n-\tsparms->hit = 0;\n-\tsparms->search_status = REJECT;\n-\tparms->hb_handle = 0;\n-\tsparms->ref_cnt = 0;\n-\t/* see if caller wanted the result */\n-\trcopy = sparms->result && sparms->result_size;\n-\n-\tshadow_db = (struct tf_shadow_tcam_db *)parms->shadow_db;\n-\tctxt = tf_shadow_tcam_ctxt_get(shadow_db, sparms->type);\n-\tif (!ctxt) {\n-\t\tTFP_DRV_LOG(ERR, \"%s Unable to get tcam mgr context\\n\",\n-\t\t\t    tf_tcam_tbl_2_str(sparms->type));\n-\t\treturn -EINVAL;\n-\t}\n-\n-\thid_mask = ctxt->hash_ctxt.hid_mask;\n-\n-\tlen = sparms->key_size;\n-\n-\tif (len > TF_SHADOW_TCAM_MAX_KEY_SZ ||\n-\t    !sparms->key || !sparms->mask || !len) {\n-\t\tTFP_DRV_LOG(ERR, \"%s:%s Invalid parms %d : %p : %p\\n\",\n-\t\t\t    tf_dir_2_str(sparms->dir),\n-\t\t\t    tf_tcam_tbl_2_str(sparms->type),\n-\t\t\t    len,\n-\t\t\t    sparms->key,\n-\t\t\t    sparms->mask);\n-\t\treturn -EINVAL;\n-\t}\n-\n-\t/* Combine the key and mask */\n-\tfor (i = 0; i < len; i++)\n-\t\ttkey[i] = sparms->key[i] & sparms->mask[i];\n-\n-\t/*\n-\t * Calculate the crc32\n-\t * Fold it to create a 16b value\n-\t * Reduce it to fit the table\n-\t */\n-\thid32 = tf_shadow_tcam_crc32_calc(tkey, len);\n-\thid16 = (uint16_t)(((hid32 >> 16) & 0xffff) ^ (hid32 & 0xffff));\n-\thb_idx = hid16 & hid_mask;\n-\n-\tbucket = ctxt->hash_ctxt.hashtbl[hb_idx];\n-\n-\tif (!bucket) {\n-\t\t/* empty bucket means a miss and available entry */\n-\t\tsparms->search_status = MISS;\n-\t\tparms->hb_handle = TF_SHADOW_TCAM_HB_HANDLE_CREATE(hb_idx, 0);\n-\t\tsparms->idx = 0;\n-\t\treturn 0;\n-\t}\n-\n-\t/* Set the avail to max so we can detect when there is an avail entry */\n-\tbe_avail = TF_SHADOW_TCAM_HB_NUM_ELEM;\n-\tfor (i = 0; i < TF_SHADOW_TCAM_HB_NUM_ELEM; i++) {\n-\t\tshtbl_idx = (uint16_t)((bucket >> (i * 16)) & 0xffff);\n-\t\tbe_valid = TF_SHADOW_TCAM_BE_IS_VALID(shtbl_idx);\n-\t\tif (!be_valid) {\n-\t\t\t/* The element is avail, keep going */\n-\t\t\tbe_avail = i;\n-\t\t\tcontinue;\n-\t\t}\n-\t\t/* There is a valid entry, compare it */\n-\t\tshtbl_key = shtbl_idx & ~TF_SHADOW_TCAM_BE_VALID;\n-\t\tif (!tf_shadow_tcam_key_cmp(ctxt,\n-\t\t\t\t\t    sparms->key,\n-\t\t\t\t\t    sparms->mask,\n-\t\t\t\t\t    shtbl_key,\n-\t\t\t\t\t    sparms->key_size)) {\n-\t\t\t/*\n-\t\t\t * It matches, increment the ref count if the caller\n-\t\t\t * requested allocation and return the info\n-\t\t\t */\n-\t\t\tif (sparms->alloc)\n-\t\t\t\tctxt->shadow_ctxt.sh_res_tbl[shtbl_key].refcnt++;\n-\n-\t\t\tsparms->hit = 1;\n-\t\t\tsparms->search_status = HIT;\n-\t\t\tparms->hb_handle =\n-\t\t\t\tTF_SHADOW_TCAM_HB_HANDLE_CREATE(hb_idx, i);\n-\t\t\tsparms->idx = TF_SHADOW_TCAM_SHIDX_TO_IDX(ctxt,\n-\t\t\t\t\t\t\t\t  shtbl_key);\n-\t\t\tsparms->ref_cnt =\n-\t\t\t\tctxt->shadow_ctxt.sh_res_tbl[shtbl_key].refcnt;\n-\n-\t\t\t/* copy the result, if caller wanted it. */\n-\t\t\tif (rcopy &&\n-\t\t\t    !tf_shadow_tcam_res_cpy(ctxt,\n-\t\t\t\t\t\t    sparms->result,\n-\t\t\t\t\t\t    shtbl_key,\n-\t\t\t\t\t\t    sparms->result_size)) {\n-\t\t\t\t/*\n-\t\t\t\t * Should never get here, possible memory\n-\t\t\t\t * corruption or something unexpected.\n-\t\t\t\t */\n-\t\t\t\tTFP_DRV_LOG(ERR, \"Error copying result\\n\");\n-\t\t\t\treturn -EINVAL;\n-\t\t\t}\n-\n-\t\t\treturn 0;\n-\t\t}\n-\t}\n-\n-\t/* No hits, return avail entry if exists */\n-\tif (be_avail < TF_SHADOW_TCAM_HB_NUM_ELEM) {\n-\t\tparms->hb_handle =\n-\t\t\tTF_SHADOW_TCAM_HB_HANDLE_CREATE(hb_idx, be_avail);\n-\t\tsparms->search_status = MISS;\n-\t\tsparms->hit = 0;\n-\t\tsparms->idx = 0;\n-\t} else {\n-\t\tsparms->search_status = REJECT;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-int\n-tf_shadow_tcam_insert(struct tf_shadow_tcam_insert_parms *parms)\n-{\n-\tuint16_t idx;\n-\tstruct tf_shadow_tcam_ctxt *ctxt;\n-\tstruct tf_tcam_set_parms *sparms;\n-\tstruct tf_shadow_tcam_db *shadow_db;\n-\tstruct tf_shadow_tcam_shadow_result_entry *sr_entry;\n-\n-\tif (!parms || !parms->sparms) {\n-\t\tTFP_DRV_LOG(ERR, \"Null parms\\n\");\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tsparms = parms->sparms;\n-\tif (!sparms->result || !sparms->result_size) {\n-\t\tTFP_DRV_LOG(ERR, \"%s:%s No result to set.\\n\",\n-\t\t\t    tf_dir_2_str(sparms->dir),\n-\t\t\t    tf_tcam_tbl_2_str(sparms->type));\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tshadow_db = (struct tf_shadow_tcam_db *)parms->shadow_db;\n-\tctxt = tf_shadow_tcam_ctxt_get(shadow_db, sparms->type);\n-\tif (!ctxt) {\n-\t\t/* We aren't tracking this table, so return success */\n-\t\tTFP_DRV_LOG(DEBUG, \"%s Unable to get tcam mgr context\\n\",\n-\t\t\t    tf_tcam_tbl_2_str(sparms->type));\n-\t\treturn 0;\n-\t}\n-\n-\tidx = TF_SHADOW_TCAM_IDX_TO_SHIDX(ctxt, sparms->idx);\n-\tif (idx >= tf_shadow_tcam_sh_num_entries_get(ctxt)) {\n-\t\tTFP_DRV_LOG(ERR, \"%s:%s Invalid idx(0x%x)\\n\",\n-\t\t\t    tf_dir_2_str(sparms->dir),\n-\t\t\t    tf_tcam_tbl_2_str(sparms->type),\n-\t\t\t    sparms->idx);\n-\t\treturn -EINVAL;\n-\t}\n-\n-\t/* Write the result table, the key/hash has been written already */\n-\tsr_entry = &ctxt->shadow_ctxt.sh_res_tbl[idx];\n-\n-\t/*\n-\t * If the handle is not valid, the bind was never called.  We aren't\n-\t * tracking this entry.\n-\t */\n-\tif (!TF_SHADOW_TCAM_HB_HANDLE_IS_VALID(sr_entry->hb_handle))\n-\t\treturn 0;\n-\n-\tif (sparms->result_size > TF_SHADOW_TCAM_MAX_RESULT_SZ) {\n-\t\tTFP_DRV_LOG(ERR, \"%s:%s Result length %d > %d\\n\",\n-\t\t\t    tf_dir_2_str(sparms->dir),\n-\t\t\t    tf_tcam_tbl_2_str(sparms->type),\n-\t\t\t    sparms->result_size,\n-\t\t\t    TF_SHADOW_TCAM_MAX_RESULT_SZ);\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tmemcpy(sr_entry->result, sparms->result, sparms->result_size);\n-\tsr_entry->result_size = sparms->result_size;\n-\n-\treturn 0;\n-}\n-\n-int\n-tf_shadow_tcam_free_db(struct tf_shadow_tcam_free_db_parms *parms)\n-{\n-\tstruct tf_shadow_tcam_db *shadow_db;\n-\tint i;\n-\n-\tTF_CHECK_PARMS1(parms);\n-\n-\tshadow_db = (struct tf_shadow_tcam_db *)parms->shadow_db;\n-\tif (!shadow_db) {\n-\t\tTFP_DRV_LOG(DEBUG, \"Shadow db is NULL cannot be freed\\n\");\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tfor (i = 0; i < TF_TCAM_TBL_TYPE_MAX; i++) {\n-\t\tif (shadow_db->ctxt[i]) {\n-\t\t\ttf_shadow_tcam_ctxt_delete(shadow_db->ctxt[i]);\n-\t\t\ttfp_free(shadow_db->ctxt[i]);\n-\t\t}\n-\t}\n-\n-\ttfp_free(shadow_db);\n-\n-\treturn 0;\n-}\n-\n-/**\n- * Allocate the TCAM resources for search and allocate\n- *\n- */\n-int tf_shadow_tcam_create_db(struct tf_shadow_tcam_create_db_parms *parms)\n-{\n-\tint rc;\n-\tint i;\n-\tuint16_t base;\n-\tstruct tfp_calloc_parms cparms;\n-\tstruct tf_shadow_tcam_db *shadow_db = NULL;\n-\n-\tTF_CHECK_PARMS1(parms);\n-\n-\t/* Build the shadow DB per the request */\n-\tcparms.nitems = 1;\n-\tcparms.size = sizeof(struct tf_shadow_tcam_db);\n-\tcparms.alignment = 0;\n-\trc = tfp_calloc(&cparms);\n-\tif (rc)\n-\t\treturn rc;\n-\tshadow_db = (void *)cparms.mem_va;\n-\n-\tfor (i = 0; i < TF_TCAM_TBL_TYPE_MAX; i++) {\n-\t\t/* If the element didn't request an allocation no need\n-\t\t * to create a pool nor verify if we got a reservation.\n-\t\t */\n-\t\tif (!parms->cfg->alloc_cnt[i]) {\n-\t\t\tshadow_db->ctxt[i] = NULL;\n-\t\t\tcontinue;\n-\t\t}\n-\n-\t\tcparms.nitems = 1;\n-\t\tcparms.size = sizeof(struct tf_shadow_tcam_ctxt);\n-\t\tcparms.alignment = 0;\n-\t\trc = tfp_calloc(&cparms);\n-\t\tif (rc)\n-\t\t\tgoto error;\n-\n-\t\tshadow_db->ctxt[i] = cparms.mem_va;\n-\t\tbase = parms->cfg->base_addr[i];\n-\t\trc = tf_shadow_tcam_ctxt_create(shadow_db->ctxt[i],\n-\t\t\t\t\t\tparms->cfg->alloc_cnt[i],\n-\t\t\t\t\t\tbase);\n-\t\tif (rc)\n-\t\t\tgoto error;\n-\t}\n-\n-\t*parms->shadow_db = (void *)shadow_db;\n-\n-\tTFP_DRV_LOG(INFO,\n-\t\t    \"TF SHADOW TCAM - initialized\\n\");\n-\n-\treturn 0;\n-error:\n-\tfor (i = 0; i < TF_TCAM_TBL_TYPE_MAX; i++) {\n-\t\tif (shadow_db->ctxt[i]) {\n-\t\t\ttf_shadow_tcam_ctxt_delete(shadow_db->ctxt[i]);\n-\t\t\ttfp_free(shadow_db->ctxt[i]);\n-\t\t}\n-\t}\n-\n-\ttfp_free(shadow_db);\n-\n-\treturn -ENOMEM;\n-}\ndiff --git a/drivers/net/bnxt/tf_core/tf_shadow_tcam.h b/drivers/net/bnxt/tf_core/tf_shadow_tcam.h\ndeleted file mode 100644\nindex d6506b219a..0000000000\n--- a/drivers/net/bnxt/tf_core/tf_shadow_tcam.h\n+++ /dev/null\n@@ -1,195 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2019-2021 Broadcom\n- * All rights reserved.\n- */\n-\n-#ifndef _TF_SHADOW_TCAM_H_\n-#define _TF_SHADOW_TCAM_H_\n-\n-#include \"tf_core.h\"\n-\n-/**\n- * Shadow DB configuration information\n- *\n- * The shadow configuration is for all tcam table types for a direction\n- */\n-struct tf_shadow_tcam_cfg_parms {\n-\t/**\n-\t * [in] The number of elements in the alloc_cnt and base_addr\n-\t * For now, it should always be equal to TF_TCAM_TBL_TYPE_MAX\n-\t */\n-\tint num_entries;\n-\t/**\n-\t * [in] Resource allocation count array\n-\t * This array content originates from the tf_session_resources\n-\t * that is passed in on session open\n-\t * Array size is TF_TCAM_TBL_TYPE_MAX\n-\t */\n-\tuint16_t *alloc_cnt;\n-\t/**\n-\t * [in] The base index for each tcam table\n-\t */\n-\tuint16_t base_addr[TF_TCAM_TBL_TYPE_MAX];\n-};\n-\n-/**\n- * Shadow TCAM  DB creation parameters.  The shadow db for this direction\n- * is returned\n- */\n-struct tf_shadow_tcam_create_db_parms {\n-\t/**\n-\t * [in] Receive or transmit direction\n-\t */\n-\tenum tf_dir dir;\n-\t/**\n-\t * [in] Configuration information for the shadow db\n-\t */\n-\tstruct tf_shadow_tcam_cfg_parms *cfg;\n-\t/**\n-\t * [out] Shadow tcam DB handle\n-\t */\n-\tvoid **shadow_db;\n-};\n-\n-/**\n- * Create the shadow db for a single direction\n- *\n- * The returned shadow db must be free using the free db API when no longer\n- * needed\n- */\n-int\n-tf_shadow_tcam_create_db(struct tf_shadow_tcam_create_db_parms *parms);\n-\n-/**\n- * Shadow TCAM free parameters\n- */\n-struct tf_shadow_tcam_free_db_parms {\n-\t/**\n-\t * [in] Shadow tcam DB handle\n-\t */\n-\tvoid *shadow_db;\n-};\n-\n-/**\n- * Free all resources associated with the shadow db\n- */\n-int\n-tf_shadow_tcam_free_db(struct tf_shadow_tcam_free_db_parms *parms);\n-\n-/**\n- * Shadow TCAM bind index parameters\n- */\n-struct tf_shadow_tcam_bind_index_parms {\n-\t/**\n-\t * [in] Shadow tcam DB handle\n-\t */\n-\tvoid *shadow_db;\n-\t/**\n-\t * [in] receive or transmit direction\n-\t */\n-\tenum tf_dir dir;\n-\t/**\n-\t * [in] TCAM table type\n-\t */\n-\tenum tf_tcam_tbl_type type;\n-\t/**\n-\t * [in] index of the entry to program\n-\t */\n-\tuint16_t idx;\n-\t/**\n-\t * [in] struct containing key\n-\t */\n-\tuint8_t *key;\n-\t/**\n-\t * [in] struct containing mask fields\n-\t */\n-\tuint8_t *mask;\n-\t/**\n-\t * [in] key size in bits (if search)\n-\t */\n-\tuint16_t key_size;\n-\t/**\n-\t * [in] The hash bucket handled returned from the search\n-\t */\n-\tuint32_t hb_handle;\n-};\n-\n-/**\n- * Binds the allocated tcam index with the hash and shadow tables\n- */\n-int\n-tf_shadow_tcam_bind_index(struct tf_shadow_tcam_bind_index_parms *parms);\n-\n-/**\n- * Shadow TCAM insert parameters\n- */\n-struct\ttf_shadow_tcam_insert_parms {\n-\t/**\n-\t * [in] Shadow tcam DB handle\n-\t */\n-\tvoid *shadow_db;\n-\t/**\n-\t * [in] The set parms from tf core\n-\t */\n-\tstruct tf_tcam_set_parms *sparms;\n-};\n-\n-/**\n- * Set the entry into the tcam manager hash and shadow tables\n- *\n- * The search must have been used prior to setting the entry so that the\n- * hash has been calculated and duplicate entries will not be added\n- */\n-int\n-tf_shadow_tcam_insert(struct tf_shadow_tcam_insert_parms *parms);\n-\n-/**\n- * Shadow TCAM remove parameters\n- */\n-struct tf_shadow_tcam_remove_parms {\n-\t/**\n-\t * [in] Shadow tcam DB handle\n-\t */\n-\tvoid *shadow_db;\n-\t/**\n-\t * [in,out] The set parms from tf core\n-\t */\n-\tstruct tf_tcam_free_parms *fparms;\n-};\n-\n-/**\n- * Remove the entry from the tcam hash and shadow tables\n- *\n- * The search must have been used prior to setting the entry so that the\n- * hash has been calculated and duplicate entries will not be added\n- */\n-int\n-tf_shadow_tcam_remove(struct tf_shadow_tcam_remove_parms *parms);\n-\n-/**\n- * Shadow TCAM search parameters\n- */\n-struct tf_shadow_tcam_search_parms {\n-\t/**\n-\t * [in] Shadow tcam DB handle\n-\t */\n-\tvoid *shadow_db;\n-\t/**\n-\t * [in,out] The search parameters from tf core\n-\t */\n-\tstruct tf_tcam_alloc_search_parms *sparms;\n-\t/**\n-\t * [out] The hash handle to use for the set\n-\t */\n-\tuint32_t hb_handle;\n-};\n-\n-/**\n- * Search for an entry in the tcam hash/shadow tables\n- *\n- * If there is a miss, but there is room for insertion, the hb_handle returned\n- * is used for insertion during the bind index API\n- */\n-int\n-tf_shadow_tcam_search(struct tf_shadow_tcam_search_parms *parms);\n-#endif\ndiff --git a/drivers/net/bnxt/tf_core/tf_tcam.c b/drivers/net/bnxt/tf_core/tf_tcam.c\nindex 273f20858b..1c42a6adc7 100644\n--- a/drivers/net/bnxt/tf_core/tf_tcam.c\n+++ b/drivers/net/bnxt/tf_core/tf_tcam.c\n@@ -14,20 +14,9 @@\n #include \"tfp.h\"\n #include \"tf_session.h\"\n #include \"tf_msg.h\"\n-#include \"tf_shadow_tcam.h\"\n \n struct tf;\n \n-/**\n- * TCAM Shadow DBs\n- */\n-static void *shadow_tcam_db[TF_DIR_MAX];\n-\n-/**\n- * Shadow init flag, set on bind and cleared on unbind\n- */\n-static uint8_t shadow_init;\n-\n int\n tf_tcam_bind(struct tf *tfp,\n \t     struct tf_tcam_cfg_parms *parms)\n@@ -40,9 +29,6 @@ tf_tcam_bind(struct tf *tfp,\n \tstruct tf_rm_create_db_parms db_cfg;\n \tstruct tf_tcam_resources *tcam_cnt;\n \tstruct tf_rm_get_alloc_info_parms ainfo;\n-\tstruct tf_shadow_tcam_free_db_parms fshadow;\n-\tstruct tf_shadow_tcam_cfg_parms shadow_cfg;\n-\tstruct tf_shadow_tcam_create_db_parms shadow_cdb;\n \tuint16_t num_slices = parms->wc_num_slices;\n \tstruct tf_session *tfs;\n \tstruct tf_dev_info *dev;\n@@ -144,44 +130,6 @@ tf_tcam_bind(struct tf *tfp,\n \t}\n \n \t/* Initialize the TCAM manager. */\n-\tif (parms->shadow_copy) {\n-\t\tfor (d = 0; d < TF_DIR_MAX; d++) {\n-\t\t\tmemset(&shadow_cfg, 0, sizeof(shadow_cfg));\n-\t\t\tmemset(&shadow_cdb, 0, sizeof(shadow_cdb));\n-\t\t\t/* Get the base addresses of the tcams for tcam mgr */\n-\t\t\tfor (i = 0; i < TF_TCAM_TBL_TYPE_MAX; i++) {\n-\t\t\t\tmemset(&info, 0, sizeof(info));\n-\n-\t\t\t\tif (!parms->resources->tcam_cnt[d].cnt[i])\n-\t\t\t\t\tcontinue;\n-\t\t\t\tainfo.rm_db = tcam_db->tcam_db[d];\n-\t\t\t\tainfo.subtype = i;\n-\t\t\t\tainfo.info = &info;\n-\t\t\t\trc = tf_rm_get_info(&ainfo);\n-\t\t\t\tif (rc)\n-\t\t\t\t\tgoto error;\n-\n-\t\t\t\tshadow_cfg.base_addr[i] = info.entry.start;\n-\t\t\t}\n-\n-\t\t\t/* Create the shadow db */\n-\t\t\tshadow_cfg.alloc_cnt =\n-\t\t\t\tparms->resources->tcam_cnt[d].cnt;\n-\t\t\tshadow_cfg.num_entries = parms->num_elements;\n-\n-\t\t\tshadow_cdb.shadow_db = &shadow_tcam_db[d];\n-\t\t\tshadow_cdb.cfg = &shadow_cfg;\n-\t\t\trc = tf_shadow_tcam_create_db(&shadow_cdb);\n-\t\t\tif (rc) {\n-\t\t\t\tTFP_DRV_LOG(ERR,\n-\t\t\t\t\t    \"TCAM MGR DB creation failed \"\n-\t\t\t\t\t    \"rc=%d\\n\", rc);\n-\t\t\t\tgoto error;\n-\t\t\t}\n-\t\t}\n-\t\tshadow_init = 1;\n-\t}\n-\n \tTFP_DRV_LOG(INFO,\n \t\t    \"TCAM - initialized\\n\");\n \n@@ -193,19 +141,10 @@ tf_tcam_bind(struct tf *tfp,\n \t\tfparms.rm_db = tcam_db->tcam_db[i];\n \t\t/* Ignoring return here since we are in the error case */\n \t\t(void)tf_rm_free_db(tfp, &fparms);\n-\n-\t\tif (parms->shadow_copy) {\n-\t\t\tfshadow.shadow_db = shadow_tcam_db[i];\n-\t\t\ttf_shadow_tcam_free_db(&fshadow);\n-\t\t\tshadow_tcam_db[i] = NULL;\n-\t\t}\n-\n \t\ttcam_db->tcam_db[i] = NULL;\n \t\ttf_session_set_db(tfp, TF_MODULE_TYPE_TCAM, NULL);\n \t}\n \n-\tshadow_init = 0;\n-\n \treturn rc;\n }\n \n@@ -217,7 +156,6 @@ tf_tcam_unbind(struct tf *tfp)\n \tstruct tf_rm_free_db_parms fparms;\n \tstruct tcam_rm_db *tcam_db;\n \tvoid *tcam_db_ptr = NULL;\n-\tstruct tf_shadow_tcam_free_db_parms fshadow;\n \tTF_CHECK_PARMS1(tfp);\n \n \trc = tf_session_get_db(tfp, TF_MODULE_TYPE_TCAM, &tcam_db_ptr);\n@@ -237,18 +175,8 @@ tf_tcam_unbind(struct tf *tfp)\n \t\t\treturn rc;\n \n \t\ttcam_db->tcam_db[i] = NULL;\n-\n-\t\tif (shadow_init) {\n-\t\t\tmemset(&fshadow, 0, sizeof(fshadow));\n-\n-\t\t\tfshadow.shadow_db = shadow_tcam_db[i];\n-\t\t\ttf_shadow_tcam_free_db(&fshadow);\n-\t\t\tshadow_tcam_db[i] = NULL;\n-\t\t}\n \t}\n \n-\tshadow_init = 0;\n-\n \treturn 0;\n }\n \n@@ -346,7 +274,6 @@ tf_tcam_free(struct tf *tfp,\n \tstruct tf_rm_get_hcapi_parms hparms;\n \tuint16_t num_slices = 1;\n \tint allocated = 0;\n-\tstruct tf_shadow_tcam_remove_parms shparms;\n \tint i;\n \tstruct tcam_rm_db *tcam_db;\n \tvoid *tcam_db_ptr = NULL;\n@@ -416,35 +343,6 @@ tf_tcam_free(struct tf *tfp,\n \t\treturn -EINVAL;\n \t}\n \n-\t/*\n-\t * The Shadow mgmt, if enabled, determines if the entry needs\n-\t * to be deleted.\n-\t */\n-\tif (shadow_init) {\n-\t\tshparms.shadow_db = shadow_tcam_db[parms->dir];\n-\t\tshparms.fparms = parms;\n-\t\trc = tf_shadow_tcam_remove(&shparms);\n-\t\tif (rc) {\n-\t\t\t/*\n-\t\t\t * Should not get here, log it and let the entry be\n-\t\t\t * deleted.\n-\t\t\t */\n-\t\t\tTFP_DRV_LOG(ERR, \"%s: Shadow free fail, \"\n-\t\t\t\t    \"type:%d index:%d deleting the entry.\\n\",\n-\t\t\t\t    tf_dir_2_str(parms->dir),\n-\t\t\t\t    parms->type,\n-\t\t\t\t    parms->idx);\n-\t\t} else {\n-\t\t\t/*\n-\t\t\t * If the entry still has references, just return the\n-\t\t\t * ref count to the caller.  No need to remove entry\n-\t\t\t * from rm or hw\n-\t\t\t */\n-\t\t\tif (parms->ref_cnt >= 1)\n-\t\t\t\treturn rc;\n-\t\t}\n-\t}\n-\n \tfor (i = 0; i < num_slices; i++) {\n \t\t/* Free requested element */\n \t\tmemset(&fparms, 0, sizeof(fparms));\n@@ -488,128 +386,6 @@ tf_tcam_free(struct tf *tfp,\n \treturn 0;\n }\n \n-int\n-tf_tcam_alloc_search(struct tf *tfp,\n-\t\t     struct tf_tcam_alloc_search_parms *parms)\n-{\n-\tstruct tf_shadow_tcam_search_parms sparms;\n-\tstruct tf_shadow_tcam_bind_index_parms bparms;\n-\tstruct tf_tcam_free_parms fparms;\n-\tstruct tf_tcam_alloc_parms aparms;\n-\tuint16_t num_slice_per_row = 1;\n-\tstruct tf_session *tfs;\n-\tstruct tf_dev_info *dev;\n-\tint rc;\n-\n-\tTF_CHECK_PARMS2(tfp, parms);\n-\n-\tif (!shadow_init || !shadow_tcam_db[parms->dir]) {\n-\t\tTFP_DRV_LOG(ERR, \"%s: TCAM Shadow not initialized for %s\\n\",\n-\t\t\t    tf_dir_2_str(parms->dir),\n-\t\t\t    tf_tcam_tbl_2_str(parms->type));\n-\t\treturn -EINVAL;\n-\t}\n-\n-\t/* Retrieve the session information */\n-\trc = tf_session_get_session_internal(tfp, &tfs);\n-\tif (rc)\n-\t\treturn rc;\n-\n-\t/* Retrieve the device information */\n-\trc = tf_session_get_device(tfs, &dev);\n-\tif (rc)\n-\t\treturn rc;\n-\n-\tif (dev->ops->tf_dev_get_tcam_slice_info == NULL) {\n-\t\trc = -EOPNOTSUPP;\n-\t\tTFP_DRV_LOG(ERR,\n-\t\t\t    \"%s: Operation not supported, rc:%s\\n\",\n-\t\t\t    tf_dir_2_str(parms->dir),\n-\t\t\t    strerror(-rc));\n-\t\treturn rc;\n-\t}\n-\n-\t/* Need to retrieve row size etc */\n-\trc = dev->ops->tf_dev_get_tcam_slice_info(tfp,\n-\t\t\t\t\t\t  parms->type,\n-\t\t\t\t\t\t  parms->key_size,\n-\t\t\t\t\t\t  &num_slice_per_row);\n-\tif (rc)\n-\t\treturn rc;\n-\n-\t/*\n-\t * Prep the shadow search, reusing the parms from original search\n-\t * instead of copying them.  Shadow will update output in there.\n-\t */\n-\tmemset(&sparms, 0, sizeof(sparms));\n-\tsparms.sparms = parms;\n-\tsparms.shadow_db = shadow_tcam_db[parms->dir];\n-\n-\trc = tf_shadow_tcam_search(&sparms);\n-\tif (rc)\n-\t\treturn rc;\n-\n-\t/*\n-\t * The app didn't request us to alloc the entry, so return now.\n-\t * The hit should have been updated in the original search parm.\n-\t */\n-\tif (!parms->alloc || parms->search_status != MISS)\n-\t\treturn rc;\n-\n-\t/* Caller desires an allocate on miss */\n-\tif (dev->ops->tf_dev_alloc_tcam == NULL) {\n-\t\trc = -EOPNOTSUPP;\n-\t\tTFP_DRV_LOG(ERR,\n-\t\t\t    \"%s: Operation not supported, rc:%s\\n\",\n-\t\t\t    tf_dir_2_str(parms->dir),\n-\t\t\t    strerror(-rc));\n-\t\treturn rc;\n-\t}\n-\tmemset(&aparms, 0, sizeof(aparms));\n-\taparms.dir = parms->dir;\n-\taparms.type = parms->type;\n-\taparms.key_size = parms->key_size;\n-\taparms.priority = parms->priority;\n-\trc = dev->ops->tf_dev_alloc_tcam(tfp, &aparms);\n-\tif (rc)\n-\t\treturn rc;\n-\n-\t/* Successful allocation, attempt to add it to the shadow */\n-\tmemset(&bparms, 0, sizeof(bparms));\n-\tbparms.dir = parms->dir;\n-\tbparms.shadow_db = shadow_tcam_db[parms->dir];\n-\tbparms.type = parms->type;\n-\tbparms.key = parms->key;\n-\tbparms.mask = parms->mask;\n-\tbparms.key_size = parms->key_size;\n-\tbparms.idx = aparms.idx;\n-\tbparms.hb_handle = sparms.hb_handle;\n-\trc = tf_shadow_tcam_bind_index(&bparms);\n-\tif (rc) {\n-\t\t/* Error binding entry, need to free the allocated idx */\n-\t\tif (dev->ops->tf_dev_free_tcam == NULL) {\n-\t\t\trc = -EOPNOTSUPP;\n-\t\t\tTFP_DRV_LOG(ERR,\n-\t\t\t\t    \"%s: Operation not supported, rc:%s\\n\",\n-\t\t\t\t    tf_dir_2_str(parms->dir),\n-\t\t\t\t    strerror(-rc));\n-\t\t\treturn rc;\n-\t\t}\n-\n-\t\tfparms.dir = parms->dir;\n-\t\tfparms.type = parms->type;\n-\t\tfparms.idx = aparms.idx;\n-\t\trc = dev->ops->tf_dev_free_tcam(tfp, &fparms);\n-\t\tif (rc)\n-\t\t\treturn rc;\n-\t}\n-\n-\t/* Add the allocated index to output and done */\n-\tparms->idx = aparms.idx;\n-\n-\treturn 0;\n-}\n-\n int\n tf_tcam_set(struct tf *tfp __rte_unused,\n \t    struct tf_tcam_set_parms *parms __rte_unused)\n@@ -619,7 +395,6 @@ tf_tcam_set(struct tf *tfp __rte_unused,\n \tstruct tf_dev_info *dev;\n \tstruct tf_rm_is_allocated_parms aparms;\n \tstruct tf_rm_get_hcapi_parms hparms;\n-\tstruct tf_shadow_tcam_insert_parms iparms;\n \tuint16_t num_slice_per_row = 1;\n \tint allocated = 0;\n \tstruct tcam_rm_db *tcam_db;\n@@ -705,24 +480,6 @@ tf_tcam_set(struct tf *tfp __rte_unused,\n \t\t\t    strerror(-rc));\n \t\treturn rc;\n \t}\n-\n-\t/* Successfully added to hw, now for shadow if enabled. */\n-\tif (!shadow_init || !shadow_tcam_db[parms->dir])\n-\t\treturn 0;\n-\n-\tiparms.shadow_db = shadow_tcam_db[parms->dir];\n-\tiparms.sparms = parms;\n-\trc = tf_shadow_tcam_insert(&iparms);\n-\tif (rc) {\n-\t\tTFP_DRV_LOG(ERR,\n-\t\t\t    \"%s: %s: Entry %d set failed, rc:%s\",\n-\t\t\t    tf_dir_2_str(parms->dir),\n-\t\t\t    tf_tcam_tbl_2_str(parms->type),\n-\t\t\t    parms->idx,\n-\t\t\t    strerror(-rc));\n-\t\treturn rc;\n-\t}\n-\n \treturn 0;\n }\n \ndiff --git a/drivers/net/bnxt/tf_core/tf_tcam.h b/drivers/net/bnxt/tf_core/tf_tcam.h\nindex b1e7a92b0b..0ed2250464 100644\n--- a/drivers/net/bnxt/tf_core/tf_tcam.h\n+++ b/drivers/net/bnxt/tf_core/tf_tcam.h\n@@ -27,14 +27,6 @@ struct tf_tcam_cfg_parms {\n \t * TCAM configuration array\n \t */\n \tstruct tf_rm_element_cfg *cfg;\n-\t/**\n-\t * Shadow table type configuration array\n-\t */\n-\tstruct tf_shadow_tcam_cfg *shadow_cfg;\n-\t/**\n-\t * Boolean controlling the request shadow copy.\n-\t */\n-\tbool shadow_copy;\n \t/**\n \t * Session resource allocations\n \t */\n@@ -91,11 +83,6 @@ struct tf_tcam_free_parms {\n \t * [in] Index to free\n \t */\n \tuint16_t idx;\n-\t/**\n-\t * [out] Reference count after free, only valid if session has been\n-\t * created with shadow_copy.\n-\t */\n-\tuint16_t ref_cnt;\n };\n \n /**\n@@ -322,10 +309,8 @@ int tf_tcam_alloc(struct tf *tfp,\n \t\t  struct tf_tcam_alloc_parms *parms);\n \n /**\n- * Free's the requested table type and returns it to the DB. If shadow\n- * DB is enabled its searched first and if found the element refcount\n- * is decremented. If refcount goes to 0 then its returned to the\n- * table type DB.\n+ * Free's the requested table type and returns it to the DB.\n+ * If refcount goes to 0 then its returned to the table type DB.\n  *\n  * [in] tfp\n  *   Pointer to TF handle, used for HCAPI communication\n@@ -340,25 +325,6 @@ int tf_tcam_alloc(struct tf *tfp,\n int tf_tcam_free(struct tf *tfp,\n \t\t struct tf_tcam_free_parms *parms);\n \n-/**\n- * Supported if Shadow DB is configured. Searches the Shadow DB for\n- * any matching element. If found the refcount in the shadow DB is\n- * updated accordingly. If not found a new element is allocated and\n- * installed into the shadow DB.\n- *\n- * [in] tfp\n- *   Pointer to TF handle, used for HCAPI communication\n- *\n- * [in] parms\n- *   Pointer to parameters\n- *\n- * Returns\n- *   - (0) if successful.\n- *   - (-EINVAL) on failure.\n- */\n-int tf_tcam_alloc_search(struct tf *tfp,\n-\t\t\t struct tf_tcam_alloc_search_parms *parms);\n-\n /**\n  * Configures the requested element by sending a firmware request which\n  * then installs it into the device internal structures.\ndiff --git a/drivers/net/bnxt/tf_core/tf_util.c b/drivers/net/bnxt/tf_core/tf_util.c\nindex c1b9be0755..7d9de7c764 100644\n--- a/drivers/net/bnxt/tf_core/tf_util.c\n+++ b/drivers/net/bnxt/tf_core/tf_util.c\n@@ -59,12 +59,10 @@ tf_tcam_tbl_2_str(enum tf_tcam_tbl_type tcam_type)\n \t\treturn \"sp_tcam\";\n \tcase TF_TCAM_TBL_TYPE_CT_RULE_TCAM:\n \t\treturn \"ct_rule_tcam\";\n-#ifdef TF_TCAM_SHARED\n \tcase TF_TCAM_TBL_TYPE_WC_TCAM_HIGH:\n \t\treturn \"wc_tcam_hi\";\n \tcase TF_TCAM_TBL_TYPE_WC_TCAM_LOW:\n \t\treturn \"wc_tcam_lo\";\n-#endif\n \tdefault:\n \t\treturn \"Invalid tcam table type\";\n \t}\ndiff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\nindex 1ee21fceef..1bb38399e4 100644\n--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\n+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\n@@ -461,7 +461,6 @@ ulp_ctx_shared_session_open(struct bnxt *bp,\n \t\treturn rc;\n \t}\n \n-\tparms.shadow_copy = true;\n \tparms.bp = bp;\n \tif (app_id == 0)\n \t\tparms.wc_num_slices = TF_WC_TCAM_2_SLICE_PER_ROW;\n@@ -550,8 +549,6 @@ ulp_ctx_session_open(struct bnxt *bp,\n \t\treturn rc;\n \t}\n \n-\tparams.shadow_copy = true;\n-\n \trc = bnxt_ulp_cntxt_app_id_get(bp->ulp_ctx, &app_id);\n \tif (rc) {\n \t\tBNXT_TF_DBG(ERR, \"Unable to get the app id from ulp.\\n\");\n",
    "prefixes": [
        "v4",
        "01/11"
    ]
}