Show a patch.

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

{
    "id": 74679,
    "url": "https://patches.dpdk.org/api/patches/74679/",
    "web_url": "https://patches.dpdk.org/patch/74679/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20200723115639.22357-18-somnath.kotur@broadcom.com>",
    "date": "2020-07-23T11:56:36",
    "name": "[v2,17/20] net/bnxt: tcam table processing support for search and alloc",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a97657f16ff4bad82b5c99ca5b87a4a826d5cb76",
    "submitter": {
        "id": 908,
        "url": "https://patches.dpdk.org/api/people/908/",
        "name": "Somnath Kotur",
        "email": "somnath.kotur@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "https://patches.dpdk.org/api/users/1766/",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "https://patches.dpdk.org/patch/74679/mbox/",
    "series": [
        {
            "id": 11254,
            "url": "https://patches.dpdk.org/api/series/11254/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11254",
            "date": "2020-07-23T11:56:19",
            "name": "bnxt patches",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/11254/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74679/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74679/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "References": "<20200723111329.21855-1-somnath.kotur@broadcom.com>\n <20200723115639.22357-1-somnath.kotur@broadcom.com>",
        "X-BeenThere": "dev@dpdk.org",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com A044329AD66",
        "Subject": "[dpdk-dev] [PATCH v2 17/20] net/bnxt: tcam table processing support\n\tfor search and alloc",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id E9747A0521;\n\tThu, 23 Jul 2020 14:05:34 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 07E731C126;\n\tThu, 23 Jul 2020 14:02:44 +0200 (CEST)",
            "from relay.smtp.broadcom.com (unknown [192.19.211.62])\n by dpdk.org (Postfix) with ESMTP id 13AEA1BFD7\n for <dev@dpdk.org>; Thu, 23 Jul 2020 14:02:07 +0200 (CEST)",
            "from dhcp-10-123-153-55.dhcp.broadcom.net\n (bgccx-dev-host-lnx35.bec.broadcom.net [10.123.153.55])\n by relay.smtp.broadcom.com (Postfix) with ESMTP id A044329AD66;\n Thu, 23 Jul 2020 05:02:06 -0700 (PDT)"
        ],
        "To": "dev@dpdk.org",
        "X-Mailer": "git-send-email 2.10.1.613.g2cc2e70",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1595505726;\n bh=6mOBqC3peAlL+fa2J5Ew1Rbo2a95jBbqGiX9KJJkm48=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=YoWFEOIXdDC6F8Im8Qmw8ef+EUEpc0+QX53L6hjrYEYrM31UcraSB+F8S7dkogY2o\n bA6VRbbJF2gApfFQswLSPdkt2gLU1BtW+D7651ucvCvUMbh6efB3kbW2oeXWwXTnnY\n gc7VO4CFJOMS1nlRs8SQCH65lNs7sr8pCKnT04pQ=",
        "Date": "Thu, 23 Jul 2020 17:26:36 +0530",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "From": "Somnath Kotur <somnath.kotur@broadcom.com>",
        "In-Reply-To": "<20200723115639.22357-1-somnath.kotur@broadcom.com>",
        "Cc": "ferruh.yigit@intel.com",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200723115639.22357-18-somnath.kotur@broadcom.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\n\nAdded support for tcam table processing to enable the search\nand allocate support. This also includes the tcam entry update\nsupport.\n\nSigned-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nReviewed-by: Michael Baucom <michael.baucom@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/ulp_mapper.c           | 317 ++++++++++++++++---------\n drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h |   5 +-\n drivers/net/bnxt/tf_ulp/ulp_template_struct.h  |   8 +-\n 3 files changed, 213 insertions(+), 117 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\nindex 4dee659..6ac4b0f 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n@@ -1317,20 +1317,177 @@ ulp_mapper_mark_vfr_idx_process(struct bnxt_ulp_mapper_parms *parms,\n \treturn rc;\n }\n \n+/*\n+ * Tcam table - create the result blob.\n+ * data [out] - the result blob data\n+ */\n+static int32_t\n+ulp_mapper_tcam_tbl_result_create(struct bnxt_ulp_mapper_parms *parms,\n+\t\t\t\t  struct bnxt_ulp_mapper_tbl_info *tbl,\n+\t\t\t\t  struct ulp_blob *data)\n+{\n+\tstruct bnxt_ulp_mapper_result_field_info *dflds;\n+\tuint32_t num_dflds;\n+\tuint32_t encap_flds = 0;\n+\tuint32_t i;\n+\tint32_t rc = 0;\n+\n+\t/* Create the result data blob */\n+\tdflds = ulp_mapper_result_fields_get(tbl, &num_dflds,\n+\t\t\t\t\t     &encap_flds);\n+\tif (!dflds || !num_dflds || encap_flds) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to get data fields.\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tfor (i = 0; i < num_dflds; i++) {\n+\t\trc = ulp_mapper_result_field_process(parms,\n+\t\t\t\t\t\t     tbl->direction,\n+\t\t\t\t\t\t     &dflds[i],\n+\t\t\t\t\t\t     data,\n+\t\t\t\t\t\t     \"TCAM Result\");\n+\t\tif (rc) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Failed to set data fields\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\treturn rc;\n+}\n+\n+/* Tcam table scan the identifier list and allocate each identifier */\n+static int32_t\n+ulp_mapper_tcam_tbl_scan_ident_alloc(struct bnxt_ulp_mapper_parms *parms,\n+\t\t\t\t     struct bnxt_ulp_mapper_tbl_info *tbl)\n+{\n+\tstruct bnxt_ulp_mapper_ident_info *idents;\n+\tuint32_t num_idents;\n+\tuint32_t i;\n+\n+\t/*\n+\t * Since the cache entry is responsible for allocating\n+\t * identifiers when in use, allocate the identifiers only\n+\t * during normal processing.\n+\t */\n+\tif (parms->tcam_tbl_opc ==\n+\t    BNXT_ULP_MAPPER_TCAM_TBL_OPC_NORMAL) {\n+\t\tidents = ulp_mapper_ident_fields_get(tbl, &num_idents);\n+\n+\t\tfor (i = 0; i < num_idents; i++) {\n+\t\t\tif (ulp_mapper_ident_process(parms, tbl,\n+\t\t\t\t\t\t     &idents[i], NULL))\n+\t\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n+/*\n+ * Tcam table scan the identifier list and extract the identifier from\n+ * the result blob.\n+ */\n+static int32_t\n+ulp_mapper_tcam_tbl_scan_ident_extract(struct bnxt_ulp_mapper_parms *parms,\n+\t\t\t\t       struct bnxt_ulp_mapper_tbl_info *tbl,\n+\t\t\t\t       struct ulp_blob *data)\n+{\n+\tstruct bnxt_ulp_mapper_ident_info *idents;\n+\tuint32_t num_idents = 0, i;\n+\tint32_t rc = 0;\n+\n+\t/*\n+\t * Extract the listed identifiers from the result field,\n+\t * no need to allocate them.\n+\t */\n+\tidents = ulp_mapper_ident_fields_get(tbl, &num_idents);\n+\tfor (i = 0; i < num_idents; i++) {\n+\t\trc = ulp_mapper_ident_extract(parms, tbl, &idents[i], data);\n+\t\tif (rc) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Error in identifier extraction\\n\");\n+\t\t\treturn rc;\n+\t\t}\n+\t}\n+\treturn rc;\n+}\n+\n+/* Internal function to write the tcam entry */\n+static int32_t\n+ulp_mapper_tcam_tbl_entry_write(struct bnxt_ulp_mapper_parms *parms,\n+\t\t\t\tstruct bnxt_ulp_mapper_tbl_info *tbl,\n+\t\t\t\tstruct ulp_blob *key,\n+\t\t\t\tstruct ulp_blob *mask,\n+\t\t\t\tstruct ulp_blob *data,\n+\t\t\t\tuint16_t idx)\n+{\n+\tstruct tf_set_tcam_entry_parms sparms = { 0 };\n+\tstruct tf *tfp;\n+\tuint16_t tmplen;\n+\tint32_t rc;\n+\n+\ttfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);\n+\tif (!tfp) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to get truflow pointer\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tsparms.dir\t\t= tbl->direction;\n+\tsparms.tcam_tbl_type\t= tbl->resource_type;\n+\tsparms.idx\t\t= idx;\n+\t/* Already verified the key/mask lengths */\n+\tsparms.key\t\t= ulp_blob_data_get(key, &tmplen);\n+\tsparms.mask\t\t= ulp_blob_data_get(mask, &tmplen);\n+\tsparms.key_sz_in_bits\t= tbl->key_bit_size;\n+\tsparms.result\t\t= ulp_blob_data_get(data, &tmplen);\n+\n+\tif (tbl->result_bit_size != tmplen) {\n+\t\tBNXT_TF_DBG(ERR, \"Result len (%d) != Expected (%d)\\n\",\n+\t\t\t    tmplen, tbl->result_bit_size);\n+\t\treturn -EINVAL;\n+\t}\n+\tsparms.result_sz_in_bits = tbl->result_bit_size;\n+\tif (tf_set_tcam_entry(tfp, &sparms)) {\n+\t\tBNXT_TF_DBG(ERR, \"tcam[%s][%s][%x] write failed.\\n\",\n+\t\t\t    tf_tcam_tbl_2_str(sparms.tcam_tbl_type),\n+\t\t\t    tf_dir_2_str(sparms.dir), sparms.idx);\n+\t\treturn -EIO;\n+\t}\n+\tBNXT_TF_DBG(INFO, \"tcam[%s][%s][%x] write success.\\n\",\n+\t\t    tf_tcam_tbl_2_str(sparms.tcam_tbl_type),\n+\t\t    tf_dir_2_str(sparms.dir), sparms.idx);\n+\n+\t/* Update cache with TCAM index if the was cache allocated. */\n+\tif (parms->tcam_tbl_opc ==\n+\t    BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_ALLOC) {\n+\t\tif (!parms->cache_ptr) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Unable to update cache\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\tparms->cache_ptr->tcam_idx = idx;\n+\t}\n+\n+\t/* Mark action */\n+\trc = ulp_mapper_mark_act_ptr_process(parms, tbl);\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"failed mark action processing\\n\");\n+\t\treturn rc;\n+\t}\n+\n+\treturn rc;\n+}\n+\n static int32_t\n ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t\t\t    struct bnxt_ulp_mapper_tbl_info *tbl)\n {\n \tstruct bnxt_ulp_mapper_class_key_field_info\t*kflds;\n-\tstruct ulp_blob key, mask, data;\n+\tstruct ulp_blob key, mask, data, update_data;\n \tuint32_t i, num_kflds;\n \tstruct tf *tfp;\n \tint32_t rc, trc;\n \tstruct tf_alloc_tcam_entry_parms aparms\t\t= { 0 };\n \tstruct tf_search_tcam_entry_parms searchparms   = { 0 };\n-\tstruct tf_set_tcam_entry_parms sparms\t\t= { 0 };\n \tstruct ulp_flow_db_res_params\tfid_parms\t= { 0 };\n \tstruct tf_free_tcam_entry_parms free_parms\t= { 0 };\n+\tenum bnxt_ulp_search_before_alloc search_flag;\n \tuint32_t hit = 0;\n \tuint16_t tmplen = 0;\n \tuint16_t idx;\n@@ -1358,6 +1515,8 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t    !ulp_blob_init(&mask, tbl->key_bit_size,\n \t\t\t   parms->device_params->byte_order) ||\n \t    !ulp_blob_init(&data, tbl->result_bit_size,\n+\t\t\t   parms->device_params->byte_order) ||\n+\t    !ulp_blob_init(&update_data, tbl->result_bit_size,\n \t\t\t   parms->device_params->byte_order)) {\n \t\tBNXT_TF_DBG(ERR, \"blob inits failed.\\n\");\n \t\treturn -EINVAL;\n@@ -1388,7 +1547,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t\t}\n \t}\n \n-\tif (!tbl->srch_b4_alloc) {\n+\tif (tbl->srch_b4_alloc == BNXT_ULP_SEARCH_BEFORE_ALLOC_NO) {\n \t\t/*\n \t\t * No search for re-use is requested, so simply allocate the\n \t\t * tcam index.\n@@ -1455,113 +1614,49 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t\thit = searchparms.hit;\n \t}\n \n-\t/* Build the result */\n-\tif (!tbl->srch_b4_alloc || !hit) {\n-\t\tstruct bnxt_ulp_mapper_result_field_info *dflds;\n-\t\tstruct bnxt_ulp_mapper_ident_info *idents;\n-\t\tuint32_t num_dflds, num_idents;\n-\t\tuint32_t encap_flds = 0;\n-\n-\t\t/*\n-\t\t * Since the cache entry is responsible for allocating\n-\t\t * identifiers when in use, allocate the identifiers only\n-\t\t * during normal processing.\n-\t\t */\n-\t\tif (parms->tcam_tbl_opc ==\n-\t\t    BNXT_ULP_MAPPER_TCAM_TBL_OPC_NORMAL) {\n-\t\t\tidents = ulp_mapper_ident_fields_get(tbl, &num_idents);\n-\n-\t\t\tfor (i = 0; i < num_idents; i++) {\n-\t\t\t\trc = ulp_mapper_ident_process(parms, tbl,\n-\t\t\t\t\t\t\t      &idents[i], NULL);\n-\t\t\t\t/* Already logged the error, just return */\n-\t\t\t\tif (rc)\n-\t\t\t\t\tgoto error;\n-\t\t\t}\n-\t\t}\n-\n-\t\t/* Create the result data blob */\n-\t\tdflds = ulp_mapper_result_fields_get(tbl, &num_dflds,\n-\t\t\t\t\t\t     &encap_flds);\n-\t\tif (!dflds || !num_dflds || encap_flds) {\n-\t\t\tBNXT_TF_DBG(ERR, \"Failed to get data fields.\\n\");\n-\t\t\trc = -EINVAL;\n-\t\t\tgoto error;\n-\t\t}\n-\n-\t\tfor (i = 0; i < num_dflds; i++) {\n-\t\t\trc = ulp_mapper_result_field_process(parms,\n-\t\t\t\t\t\t\t     tbl->direction,\n-\t\t\t\t\t\t\t     &dflds[i],\n-\t\t\t\t\t\t\t     &data,\n-\t\t\t\t\t\t\t     \"TCAM Result\");\n-\t\t\tif (rc) {\n-\t\t\t\tBNXT_TF_DBG(ERR, \"Failed to set data fields\\n\");\n-\t\t\t\tgoto error;\n-\t\t\t}\n-\t\t}\n-\n-\t\tsparms.dir\t\t= tbl->direction;\n-\t\tsparms.tcam_tbl_type\t= tbl->resource_type;\n-\t\tsparms.idx\t\t= idx;\n-\t\t/* Already verified the key/mask lengths */\n-\t\tsparms.key\t\t= ulp_blob_data_get(&key, &tmplen);\n-\t\tsparms.mask\t\t= ulp_blob_data_get(&mask, &tmplen);\n-\t\tsparms.key_sz_in_bits\t= tbl->key_bit_size;\n-\t\tsparms.result\t\t= ulp_blob_data_get(&data, &tmplen);\n-\n-\t\tif (tbl->result_bit_size != tmplen) {\n-\t\t\tBNXT_TF_DBG(ERR, \"Result len (%d) != Expected (%d)\\n\",\n-\t\t\t\t    tmplen, tbl->result_bit_size);\n-\t\t\trc = -EINVAL;\n-\t\t\tgoto error;\n-\t\t}\n-\t\tsparms.result_sz_in_bits = tbl->result_bit_size;\n-\n-\t\trc = tf_set_tcam_entry(tfp, &sparms);\n-\t\tif (rc) {\n-\t\t\tBNXT_TF_DBG(ERR, \"tcam[%d][%s][%d] write failed.\\n\",\n-\t\t\t\t    sparms.tcam_tbl_type,\n-\t\t\t\t    (sparms.dir == TF_DIR_RX) ? \"RX\" : \"TX\",\n-\t\t\t\t    sparms.idx);\n-\t\t\tgoto error;\n-\t\t}\n-\n-\t\t/* Update cache with TCAM index if the was cache allocated. */\n-\t\tif (parms->tcam_tbl_opc ==\n-\t\t    BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_ALLOC) {\n-\t\t\tif (!parms->cache_ptr) {\n-\t\t\t\tBNXT_TF_DBG(ERR, \"Unable to update cache\");\n-\t\t\t\trc = -EINVAL;\n-\t\t\t\tgoto error;\n-\t\t\t}\n-\t\t\tparms->cache_ptr->tcam_idx = idx;\n-\t\t}\n-\n-\t\t/* Mark action */\n-\t\trc = ulp_mapper_mark_act_ptr_process(parms, tbl);\n-\t\tif (rc)\n-\t\t\tgoto error;\n-\n-\t} else {\n-\t\tstruct bnxt_ulp_mapper_ident_info *idents;\n-\t\tuint32_t num_idents;\n-\n-\t\t/*\n-\t\t * Extract the listed identifiers from the result field,\n-\t\t * no need to allocate them.\n-\t\t */\n-\t\tidents = ulp_mapper_ident_fields_get(tbl, &num_idents);\n-\t\tfor (i = 0; i < num_idents; i++) {\n-\t\t\trc = ulp_mapper_ident_extract(parms, tbl,\n-\t\t\t\t\t\t      &idents[i], &data);\n-\t\t\tif (rc) {\n-\t\t\t\tBNXT_TF_DBG(ERR,\n-\t\t\t\t\t    \"Error in ident extraction\\n\");\n-\t\t\t\tgoto error;\n-\t\t\t}\n-\t\t}\n+\t/* if it is miss then it is same as no search before alloc */\n+\tif (!hit)\n+\t\tsearch_flag = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO;\n+\telse\n+\t\tsearch_flag = tbl->srch_b4_alloc;\n+\n+\tswitch (search_flag) {\n+\tcase BNXT_ULP_SEARCH_BEFORE_ALLOC_NO:\n+\t\t/*Scan identifier list, allocate identifier and update regfile*/\n+\t\trc = ulp_mapper_tcam_tbl_scan_ident_alloc(parms, tbl);\n+\t\t/* Create the result blob */\n+\t\tif (!rc)\n+\t\t\trc = ulp_mapper_tcam_tbl_result_create(parms, tbl,\n+\t\t\t\t\t\t\t       &data);\n+\t\t/* write the tcam entry */\n+\t\tif (!rc)\n+\t\t\trc = ulp_mapper_tcam_tbl_entry_write(parms, tbl, &key,\n+\t\t\t\t\t\t\t     &mask, &data, idx);\n+\t\tbreak;\n+\tcase BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP:\n+\t\t/*Scan identifier list, extract identifier and update regfile*/\n+\t\trc = ulp_mapper_tcam_tbl_scan_ident_extract(parms, tbl, &data);\n+\t\tbreak;\n+\tcase BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_UPDATE:\n+\t\t/*Scan identifier list, extract identifier and update regfile*/\n+\t\trc = ulp_mapper_tcam_tbl_scan_ident_extract(parms, tbl, &data);\n+\t\t/* Create the result blob */\n+\t\tif (!rc)\n+\t\t\trc = ulp_mapper_tcam_tbl_result_create(parms, tbl,\n+\t\t\t\t\t\t\t       &update_data);\n+\t\t/* Update/overwrite the tcam entry */\n+\t\tif (!rc)\n+\t\t\trc = ulp_mapper_tcam_tbl_entry_write(parms, tbl, &key,\n+\t\t\t\t\t\t\t     &mask,\n+\t\t\t\t\t\t\t     &update_data, idx);\n+\t\tbreak;\n+\tdefault:\n+\t\tBNXT_TF_DBG(ERR, \"invalid search opcode\\n\");\n+\t\trc =  -EINVAL;\n+\t\tbreak;\n \t}\n+\tif (rc)\n+\t\tgoto error;\n \n \t/*\n \t * Only link the entry to the flow db in the event that cache was not\n@@ -1598,11 +1693,11 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \tparms->tcam_tbl_opc = BNXT_ULP_MAPPER_TCAM_TBL_OPC_NORMAL;\n \tfree_parms.dir\t\t\t= tbl->direction;\n \tfree_parms.tcam_tbl_type\t= tbl->resource_type;\n-\tfree_parms.idx\t\t\t= aparms.idx;\n+\tfree_parms.idx\t\t\t= idx;\n \ttrc = tf_free_tcam_entry(tfp, &free_parms);\n \tif (trc)\n \t\tBNXT_TF_DBG(ERR, \"Failed to free tcam[%d][%d][%d] on failure\\n\",\n-\t\t\t    tbl->resource_type, tbl->direction, aparms.idx);\n+\t\t\t    tbl->resource_type, tbl->direction, idx);\n \n \treturn rc;\n }\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h\nindex ac651f6..9855918 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h\n@@ -271,8 +271,9 @@ enum bnxt_ulp_regfile_index {\n \n enum bnxt_ulp_search_before_alloc {\n \tBNXT_ULP_SEARCH_BEFORE_ALLOC_NO = 0,\n-\tBNXT_ULP_SEARCH_BEFORE_ALLOC_YES = 1,\n-\tBNXT_ULP_SEARCH_BEFORE_ALLOC_LAST = 2\n+\tBNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP = 1,\n+\tBNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_UPDATE = 2,\n+\tBNXT_ULP_SEARCH_BEFORE_ALLOC_LAST = 3\n };\n \n enum bnxt_ulp_fdb_resource_flags {\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\nindex b9a25b0..6617ab9 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\n@@ -173,10 +173,10 @@ struct bnxt_ulp_mapper_tbl_info {\n \tenum bnxt_ulp_resource_sub_type\tresource_sub_type;\n \tenum bnxt_ulp_cond_opcode\tcond_opcode;\n \tuint32_t\t\t\tcond_operand;\n-\tuint8_t\t\tdirection;\n-\tuint32_t\tpriority;\n-\tuint8_t\t\tsrch_b4_alloc;\n-\tenum bnxt_ulp_critical_resource\tcritical_resource;\n+\tuint8_t\t\t\t\tdirection;\n+\tuint32_t\t\t\tpriority;\n+\tenum bnxt_ulp_search_before_alloc\tsrch_b4_alloc;\n+\tenum bnxt_ulp_critical_resource\t\tcritical_resource;\n \n \t/* Information for accessing the ulp_key_field_list */\n \tuint32_t\tkey_start_idx;\n",
    "prefixes": [
        "v2",
        "17/20"
    ]
}