Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/74657/?format=api
http://patches.dpdk.org/api/patches/74657/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200723111329.21855-18-somnath.kotur@broadcom.com/", "project": { "id": 1, "url": "http://patches.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": "<20200723111329.21855-18-somnath.kotur@broadcom.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200723111329.21855-18-somnath.kotur@broadcom.com", "date": "2020-07-23T11:13:26", "name": "[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": "http://patches.dpdk.org/api/people/908/?format=api", "name": "Somnath Kotur", "email": "somnath.kotur@broadcom.com" }, "delegate": { "id": 1766, "url": "http://patches.dpdk.org/api/users/1766/?format=api", "username": "ajitkhaparde", "first_name": "Ajit", "last_name": "Khaparde", "email": "ajit.khaparde@broadcom.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200723111329.21855-18-somnath.kotur@broadcom.com/mbox/", "series": [ { "id": 11252, "url": "http://patches.dpdk.org/api/series/11252/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11252", "date": "2020-07-23T11:13:09", "name": "bnxt patches", "version": 1, "mbox": "http://patches.dpdk.org/series/11252/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/74657/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/74657/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 77FCEA0521;\n\tThu, 23 Jul 2020 13:22:06 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DF9C51C0D1;\n\tThu, 23 Jul 2020 13:20:10 +0200 (CEST)", "from relay.smtp.broadcom.com (relay.smtp.broadcom.com\n [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id BA2661C033\n for <dev@dpdk.org>; Thu, 23 Jul 2020 13:19:16 +0200 (CEST)", "from dhcp-10-123-153-55.dhcp.broadcom.net\n (dhcp-10-123-153-55.dhcp.broadcom.net [10.123.153.55])\n by relay.smtp.broadcom.com (Postfix) with ESMTP id 1A0F21BD9BA;\n Thu, 23 Jul 2020 04:19:15 -0700 (PDT)" ], "DKIM-Filter": "OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 1A0F21BD9BA", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1595503156;\n bh=6mOBqC3peAlL+fa2J5Ew1Rbo2a95jBbqGiX9KJJkm48=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=hKvJ3Ni+LAqtiEknjRdai5waDRaPRIBgEyjOS7CjjziPzXSUeOjhK/cipaZhrP/n2\n SxgGQW9tTRDxkZgOkCmjJ4/qRhV6WY4X8XXGCxk0doxAV3HkeFgZ86riKZKrDlDeuW\n TC1L6S312GMHhFENqCCzbRwruBH4CxXjsVV9NzpQ=", "From": "Somnath Kotur <somnath.kotur@broadcom.com>", "To": "dev@dpdk.org", "Cc": "ferruh.yigit@intel.com", "Date": "Thu, 23 Jul 2020 16:43:26 +0530", "Message-Id": "<20200723111329.21855-18-somnath.kotur@broadcom.com>", "X-Mailer": "git-send-email 2.10.1.613.g2cc2e70", "In-Reply-To": "<20200723111329.21855-1-somnath.kotur@broadcom.com>", "References": "<20200723111329.21855-1-somnath.kotur@broadcom.com>", "Subject": "[dpdk-dev] [PATCH 17/20] net/bnxt: tcam table processing support\n\tfor search and alloc", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "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", "Sender": "\"dev\" <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": [ "17/20" ] }{ "id": 74657, "url": "