get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 94126,
    "url": "https://patches.dpdk.org/api/patches/94126/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210613000652.28191-33-ajit.khaparde@broadcom.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20210613000652.28191-33-ajit.khaparde@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210613000652.28191-33-ajit.khaparde@broadcom.com",
    "date": "2021-06-13T00:06:26",
    "name": "[v2,32/58] net/bnxt: modify table processing",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "739fd35abea7e582516d873b1d8e9addf0830c15",
    "submitter": {
        "id": 501,
        "url": "https://patches.dpdk.org/api/people/501/?format=api",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "https://patches.dpdk.org/api/users/1766/?format=api",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210613000652.28191-33-ajit.khaparde@broadcom.com/mbox/",
    "series": [
        {
            "id": 17305,
            "url": "https://patches.dpdk.org/api/series/17305/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=17305",
            "date": "2021-06-13T00:05:54",
            "name": "enhancements to host based flow table management",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/17305/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/94126/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/94126/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 9A19AA0C41;\n\tSun, 13 Jun 2021 02:11:43 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2D32641137;\n\tSun, 13 Jun 2021 02:07:53 +0200 (CEST)",
            "from mail-pl1-f177.google.com (mail-pl1-f177.google.com\n [209.85.214.177])\n by mails.dpdk.org (Postfix) with ESMTP id 20772411EE\n for <dev@dpdk.org>; Sun, 13 Jun 2021 02:07:50 +0200 (CEST)",
            "by mail-pl1-f177.google.com with SMTP id h12so4686565plf.4\n for <dev@dpdk.org>; Sat, 12 Jun 2021 17:07:50 -0700 (PDT)",
            "from localhost.localdomain ([192.19.223.252])\n by smtp.gmail.com with ESMTPSA id gg22sm12774609pjb.17.2021.06.12.17.07.46\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Sat, 12 Jun 2021 17:07:47 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com;\n s=google;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version; bh=oRqlmmiwVh5kgNZumJkVEGcnv6jhVAGFSh87c6ua0oQ=;\n b=XolAahvPxpppmKXLLe+D8Ta2+UerBlf5KwZPa/rPIbJXRj39UR21MaNWDD7Icng2rY\n ju7HEG+lVUKtF32bvR21TwGXlbSzfrpbpYOFpSnbmbczuGJMQ8rX7UhggGAhmCVVoVYn\n aj2VPi/I4QDAM73K5TOUV5ijsljEWdcDGVHco=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version;\n bh=oRqlmmiwVh5kgNZumJkVEGcnv6jhVAGFSh87c6ua0oQ=;\n b=SW8gTVDomWxEli1VDFt9NuzR8CHhZoaLSJEZVSBnVvnzZePEPET1/3K/3aCZHptKmm\n 6me7YsXYx0AHfb0yqWvby6NY5K+Ue3aQv9EHwCR/4cIXSbTItTjTufNPOX+qPD4uUAun\n FzT5XB5rD9oDFEHRdHlLQSkEQrS7N80l8/Wg5lAKlVPT6xbFM4L2yiIenH5oic3U0BXV\n RJ6A5G6CpNbGdUdcnJYsNW+iAUxKYUfSDlb4F7v5+bAtVwGE2GbGTLDrg8UgKUBGB9c9\n QaO6b8VrCbsD7MjZZKCXNWD7q2LXmVbURoMyHemsJSZfF9eg1wfj6nKahDs32hA0c2cU\n MYqg==",
        "X-Gm-Message-State": "AOAM531D0Y9MRXL9kTsyUL9uSwTul7n7LC5F4meWJpI+e6E3AoBn5Rlq\n RA+nM/AVr/VLNtPbaEgVRaDnnGEuRt8WjYg/POtAT24F8yKDFmsqmBl/f1pjaOq8MUeLWZqpp8x\n BX/Aa67Vp4jQoELHyhBi5IQI5ALHPFCENny41aIWzX/gcLd+IMRj3ykMSr3FZ78A=",
        "X-Google-Smtp-Source": "\n ABdhPJyvOxlg2hbbNd4e4WJywl5/WnieC9OCb9Aen1lW0pLCxl9rCQoC9HjrFOOGKmMQll4gPyKSGA==",
        "X-Received": "by 2002:a17:90a:f995:: with SMTP id\n cq21mr11535544pjb.232.1623542868099;\n Sat, 12 Jun 2021 17:07:48 -0700 (PDT)",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "Kishore Padmanabha <kishore.padmanabha@broadcom.com>,\n Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>,\n Mike Baucom <michael.baucom@broadcom.com>",
        "Date": "Sat, 12 Jun 2021 17:06:26 -0700",
        "Message-Id": "<20210613000652.28191-33-ajit.khaparde@broadcom.com>",
        "X-Mailer": "git-send-email 2.21.1 (Apple Git-122.3)",
        "In-Reply-To": "<20210613000652.28191-1-ajit.khaparde@broadcom.com>",
        "References": "<20210530085929.29695-1-venkatkumar.duvvuru@broadcom.com>\n <20210613000652.28191-1-ajit.khaparde@broadcom.com>",
        "MIME-Version": "1.0",
        "Content-Type": "multipart/signed; protocol=\"application/pkcs7-signature\";\n micalg=sha-256; boundary=\"000000000000fc880205c49a8733\"",
        "X-Content-Filtered-By": "Mailman/MimeDel 2.1.29",
        "Subject": "[dpdk-dev] [PATCH v2 32/58] net/bnxt: modify table processing",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\n\n1. Added interface table specific opcode to process interface table\nentry creation and reuse. This allows reuse of the interface table\nentry for multiple flows. Changed the regfile apis to store\nthe data in big endian format.\n\n2. The result blob creation being done in tcam, interface, index\ntables are consolidate to a common method.\n\n3. Added result blob processing for generic table write\n\n4. Modified the index table opcode processing to support new opcodes.\n\n5. The driver was setting key size that did not take into account\n   the word alignment.\n\n6. The hard coded values for critical resource is replaced with\n   template defined values.\n\nSigned-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nSigned-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>\nReviewed-by: Mike Baucom <michael.baucom@broadcom.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c         |  18 +-\n drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h         |   4 +-\n drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 674 ++++++++++--------\n .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  22 +\n .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c | 108 +--\n .../tf_ulp/ulp_template_db_wh_plus_class.c    |  69 +-\n 6 files changed, 512 insertions(+), 383 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c b/drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c\nindex 0a15789c4e..62a5924a36 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c\n@@ -5,6 +5,8 @@\n \n #include <rte_log.h>\n #include <rte_malloc.h>\n+#include \"tf_core.h\"\n+#include \"tfp.h\"\n #include \"ulp_mapper.h\"\n #include \"ulp_flow_db.h\"\n \n@@ -163,18 +165,20 @@ ulp_mapper_gen_tbl_idx_calculate(uint32_t res_sub_type, uint32_t dir)\n }\n \n /*\n- * Set the data in the generic table entry\n+ * Set the data in the generic table entry, Data is in Big endian format\n  *\n  * entry [in] - generic table entry\n  * offset [in] - The offset in bits where the data has to be set\n  * len [in] - The length of the data in bits to be set\n  * data [in] - pointer to the data to be used for setting the value.\n+ * data_size [in] - length of the data pointer in bytes.\n  *\n  * returns 0 on success\n  */\n int32_t\n ulp_mapper_gen_tbl_entry_data_set(struct ulp_mapper_gen_tbl_entry *entry,\n-\t\t\t\t  uint32_t offset, uint32_t len, uint8_t *data)\n+\t\t\t\t  uint32_t offset, uint32_t len, uint8_t *data,\n+\t\t\t\t  uint32_t data_size)\n {\n \t/* validate the null arguments */\n \tif (!entry || !data) {\n@@ -183,12 +187,17 @@ ulp_mapper_gen_tbl_entry_data_set(struct ulp_mapper_gen_tbl_entry *entry,\n \t}\n \n \t/* check the size of the buffer for validation */\n-\tif ((offset + len) > ULP_BYTE_2_BITS(entry->byte_data_size)) {\n+\tif ((offset + len) > ULP_BYTE_2_BITS(entry->byte_data_size) ||\n+\t    data_size < ULP_BITS_2_BYTE(len)) {\n \t\tBNXT_TF_DBG(ERR, \"invalid offset or length %x:%x:%x\\n\",\n \t\t\t    offset, len, entry->byte_data_size);\n \t\treturn -EINVAL;\n \t}\n \n+\t/* adjust the data pointer */\n+\tdata = data + (data_size - ULP_BITS_2_BYTE(len));\n+\n+\t/* Push the data into the byte data array */\n \tif (entry->byte_order == BNXT_ULP_BYTE_ORDER_LE) {\n \t\tif (ulp_bs_push_lsb(entry->byte_data, offset, len, data) !=\n \t\t    len) {\n@@ -208,7 +217,7 @@ ulp_mapper_gen_tbl_entry_data_set(struct ulp_mapper_gen_tbl_entry *entry,\n }\n \n /*\n- * Get the data in the generic table entry\n+ * Get the data in the generic table entry, Data is in Big endian format\n  *\n  * entry [in] - generic table entry\n  * offset [in] - The offset in bits where the data has to get\n@@ -298,6 +307,7 @@ ulp_mapper_gen_tbl_res_free(struct bnxt_ulp_context *ulp_ctx,\n \t\t\t    tbl_idx, res->resource_hndl);\n \t\treturn -EINVAL;\n \t}\n+\tfid = tfp_be_to_cpu_32(fid);\n \n \t/* Destroy the flow associated with the shared flow id */\n \tif (ulp_mapper_flow_destroy(ulp_ctx, BNXT_ULP_FDB_TYPE_REGULAR,\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h b/drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h\nindex c8a1112af4..701a8d10e5 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h\n@@ -104,12 +104,14 @@ ulp_mapper_gen_tbl_idx_calculate(uint32_t res_sub_type, uint32_t dir);\n  * offset [in] - The offset in bits where the data has to be set\n  * len [in] - The length of the data in bits to be set\n  * data [in] - pointer to the data to be used for setting the value.\n+ * data_size [in] - length of the data pointer in bytes.\n  *\n  * returns 0 on success\n  */\n int32_t\n ulp_mapper_gen_tbl_entry_data_set(struct ulp_mapper_gen_tbl_entry *entry,\n-\t\t\t\t  uint32_t offset, uint32_t len, uint8_t *data);\n+\t\t\t\t  uint32_t offset, uint32_t len, uint8_t *data,\n+\t\t\t\t  uint32_t data_size);\n \n /*\n  * Get the data in the generic table entry\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\nindex 56005480af..b38c834fce 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n@@ -530,7 +530,7 @@ ulp_mapper_fdb_opc_process(struct bnxt_ulp_mapper_parms *parms,\n \tcase BNXT_ULP_FDB_OPC_ALLOC_PUSH_REGFILE:\n \t\t/* allocate a new fid */\n \t\trc = ulp_flow_db_fid_alloc(parms->ulp_ctx,\n-\t\t\t\t\t   BNXT_ULP_FDB_TYPE_REGULAR,\n+\t\t\t\t\t   parms->flow_type,\n \t\t\t\t\t   tbl->resource_func, &fid);\n \t\tif (rc) {\n \t\t\tBNXT_TF_DBG(ERR,\n@@ -540,7 +540,7 @@ ulp_mapper_fdb_opc_process(struct bnxt_ulp_mapper_parms *parms,\n \t\t/* Store the allocated fid in regfile*/\n \t\tval64 = fid;\n \t\trc = ulp_regfile_write(parms->regfile, tbl->flow_db_operand,\n-\t\t\t\t       val64);\n+\t\t\t\t       tfp_cpu_to_be_64(val64));\n \t\tif (!rc) {\n \t\t\tBNXT_TF_DBG(ERR, \"Write regfile[%d] failed\\n\",\n \t\t\t\t    tbl->flow_db_operand);\n@@ -560,7 +560,7 @@ ulp_mapper_fdb_opc_process(struct bnxt_ulp_mapper_parms *parms,\n \t\t\treturn -EINVAL;\n \t\t}\n \t\t/* Use the extracted fid to update the flow resource */\n-\t\tpush_fid = (uint32_t)val64;\n+\t\tpush_fid = tfp_be_to_cpu_64((uint32_t)val64);\n \t\tbreak;\n \tdefault:\n \t\treturn rc; /* Nothing to be done */\n@@ -584,6 +584,65 @@ ulp_mapper_fdb_opc_process(struct bnxt_ulp_mapper_parms *parms,\n \treturn rc;\n }\n \n+/*\n+ * Process the identifier list in the given table.\n+ * Extract the ident from the table entry and\n+ * write it to the reg file.\n+ * returns 0 on success.\n+ */\n+static int32_t\n+ulp_mapper_tbl_ident_scan_ext(struct bnxt_ulp_mapper_parms *parms,\n+\t\t\t      struct bnxt_ulp_mapper_tbl_info *tbl,\n+\t\t\t      uint8_t *byte_data,\n+\t\t\t      uint32_t byte_data_size,\n+\t\t\t      enum bnxt_ulp_byte_order byte_order)\n+{\n+\tstruct bnxt_ulp_mapper_ident_info *idents;\n+\tuint32_t i, num_idents = 0;\n+\tuint64_t val64;\n+\n+\t/* validate the null arguments */\n+\tif (!byte_data) {\n+\t\tBNXT_TF_DBG(ERR, \"invalid argument\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Get the ident list and process each one */\n+\tidents = ulp_mapper_ident_fields_get(parms, tbl, &num_idents);\n+\n+\tfor (i = 0; i < num_idents; i++) {\n+\t\t/* check the size of the buffer for validation */\n+\t\tif ((idents[i].ident_bit_pos + idents[i].ident_bit_size) >\n+\t\t    ULP_BYTE_2_BITS(byte_data_size) ||\n+\t\t    idents[i].ident_bit_size > ULP_BYTE_2_BITS(sizeof(val64))) {\n+\t\t\tBNXT_TF_DBG(ERR, \"invalid offset or length %x:%x:%x\\n\",\n+\t\t\t\t    idents[i].ident_bit_pos,\n+\t\t\t\t    idents[i].ident_bit_size,\n+\t\t\t\t    byte_data_size);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\tif (byte_order == BNXT_ULP_BYTE_ORDER_LE)\n+\t\t\tulp_bs_pull_lsb(byte_data, (uint8_t *)&val64,\n+\t\t\t\t\tsizeof(val64),\n+\t\t\t\t\tidents[i].ident_bit_pos,\n+\t\t\t\t\tidents[i].ident_bit_size);\n+\t\telse\n+\t\t\tulp_bs_pull_msb(byte_data, (uint8_t *)&val64,\n+\t\t\t\t\tidents[i].ident_bit_pos,\n+\t\t\t\t\tidents[i].ident_bit_size);\n+\n+\t\t/* Write it to the regfile, val64 is already in big-endian*/\n+\t\tif (!ulp_regfile_write(parms->regfile,\n+\t\t\t\t       idents[i].regfile_idx,\n+\t\t\t\t       val64)) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Regfile[%d] write failed.\\n\",\n+\t\t\t\t    idents[i].regfile_idx);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n /*\n  * Process the identifier instruction and either store it in the flow database\n  * or return it in the val (if not NULL) on success.  If val is NULL, the\n@@ -637,7 +696,7 @@ ulp_mapper_ident_process(struct bnxt_ulp_mapper_parms *parms,\n \t\tfid_parms.resource_func\t= ident->resource_func;\n \t\tfid_parms.resource_type\t= ident->ident_type;\n \t\tfid_parms.resource_hndl\t= iparms.id;\n-\t\tfid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;\n+\t\tfid_parms.critical_resource = tbl->critical_resource;\n \n \t\trc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);\n \t\tif (rc) {\n@@ -729,7 +788,7 @@ ulp_mapper_ident_extract(struct bnxt_ulp_mapper_parms *parms,\n \tfid_parms.resource_func = ident->resource_func;\n \tfid_parms.resource_type = ident->ident_type;\n \tfid_parms.resource_hndl = sparms.search_id;\n-\tfid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;\n+\tfid_parms.critical_resource = tbl->critical_resource;\n \trc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);\n \tif (rc) {\n \t\tBNXT_TF_DBG(ERR, \"Failed to link res to flow rc = %d\\n\",\n@@ -1044,6 +1103,57 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,\n \treturn 0;\n }\n \n+/*\n+ * Result table process and fill the result blob.\n+ * data [out] - the result blob data\n+ */\n+static int32_t\n+ulp_mapper_tbl_result_build(struct bnxt_ulp_mapper_parms *parms,\n+\t\t\t    struct bnxt_ulp_mapper_tbl_info *tbl,\n+\t\t\t    struct ulp_blob *data,\n+\t\t\t    const char *name)\n+{\n+\tstruct bnxt_ulp_mapper_result_field_info *dflds;\n+\tuint32_t i, num_flds = 0, encap_flds = 0;\n+\tint32_t rc = 0;\n+\n+\t/* Get the result field list */\n+\tdflds = ulp_mapper_result_fields_get(parms, tbl, &num_flds,\n+\t\t\t\t\t     &encap_flds);\n+\n+\t/* validate the result field list counts */\n+\tif ((tbl->resource_func == BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE &&\n+\t     (!num_flds && !encap_flds)) || !dflds ||\n+\t    (tbl->resource_func != BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE &&\n+\t\t(!num_flds || encap_flds))) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to get data fields %x:%x\\n\",\n+\t\t\t    num_flds, encap_flds);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* process the result fields, loop through them */\n+\tfor (i = 0; i < (num_flds + encap_flds); i++) {\n+\t\t/* set the swap index if encap swap bit is enabled */\n+\t\tif (parms->device_params->encap_byte_swap && encap_flds &&\n+\t\t    i == num_flds)\n+\t\t\tulp_blob_encap_swap_idx_set(data);\n+\n+\t\t/* Process the result fields */\n+\t\trc = ulp_mapper_result_field_process(parms, tbl->direction,\n+\t\t\t\t\t\t     &dflds[i], data, name);\n+\t\tif (rc) {\n+\t\t\tBNXT_TF_DBG(ERR, \"data field failed\\n\");\n+\t\t\treturn rc;\n+\t\t}\n+\t}\n+\n+\t/* if encap bit swap is enabled perform the bit swap */\n+\tif (parms->device_params->encap_byte_swap && encap_flds)\n+\t\tulp_blob_perform_encap_swap(data);\n+\n+\treturn rc;\n+}\n+\n /* Function to alloc action record and set the table. */\n static int32_t\n ulp_mapper_keymask_field_process(struct bnxt_ulp_mapper_parms *parms,\n@@ -1209,7 +1319,7 @@ ulp_mapper_mark_gfid_process(struct bnxt_ulp_mapper_parms *parms,\n \t}\n \tfid_parms.direction = tbl->direction;\n \tfid_parms.resource_func = BNXT_ULP_RESOURCE_FUNC_HW_FID;\n-\tfid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;\n+\tfid_parms.critical_resource = tbl->critical_resource;\n \tfid_parms.resource_type\t= mark_flag;\n \tfid_parms.resource_hndl\t= gfid;\n \trc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);\n@@ -1255,7 +1365,7 @@ ulp_mapper_mark_act_ptr_process(struct bnxt_ulp_mapper_parms *parms,\n \t}\n \tfid_parms.direction = tbl->direction;\n \tfid_parms.resource_func = BNXT_ULP_RESOURCE_FUNC_HW_FID;\n-\tfid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;\n+\tfid_parms.critical_resource = tbl->critical_resource;\n \tfid_parms.resource_type\t= mark_flag;\n \tfid_parms.resource_hndl\t= act_idx;\n \trc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);\n@@ -1301,7 +1411,7 @@ ulp_mapper_mark_vfr_idx_process(struct bnxt_ulp_mapper_parms *parms,\n \t}\n \tfid_parms.direction = tbl->direction;\n \tfid_parms.resource_func = BNXT_ULP_RESOURCE_FUNC_HW_FID;\n-\tfid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;\n+\tfid_parms.critical_resource = tbl->critical_resource;\n \tfid_parms.resource_type\t= mark_flag;\n \tfid_parms.resource_hndl\t= act_idx;\n \trc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);\n@@ -1310,43 +1420,6 @@ 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(parms, 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@@ -1418,8 +1491,8 @@ ulp_mapper_tcam_tbl_entry_write(struct bnxt_ulp_mapper_parms *parms,\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.key_sz_in_bits\t= 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@@ -1625,8 +1698,8 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,\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\trc = ulp_mapper_tbl_result_build(parms, tbl, &data,\n+\t\t\t\t\t\t\t \"TCAM Result\");\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@@ -1669,9 +1742,8 @@ ulp_mapper_em_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_key_field_info\t*kflds;\n-\tstruct bnxt_ulp_mapper_result_field_info *dflds;\n \tstruct ulp_blob key, data;\n-\tuint32_t i, num_kflds, num_dflds;\n+\tuint32_t i, num_kflds;\n \tuint16_t tmplen;\n \tstruct tf *tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);\n \tstruct ulp_flow_db_res_params\tfid_parms = { 0 };\n@@ -1680,7 +1752,6 @@ ulp_mapper_em_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \tenum bnxt_ulp_flow_mem_type mtype;\n \tint32_t\ttrc;\n \tint32_t rc = 0;\n-\tuint32_t encap_flds = 0;\n \n \trc = bnxt_ulp_cntxt_mem_type_get(parms->ulp_ctx, &mtype);\n \tif (rc) {\n@@ -1721,27 +1792,10 @@ ulp_mapper_em_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t */\n \n \t/* Create the result data blob */\n-\tdflds = ulp_mapper_result_fields_get(parms, tbl,\n-\t\t\t\t\t     &num_dflds, &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\tstruct bnxt_ulp_mapper_result_field_info *fld;\n-\n-\t\tfld = &dflds[i];\n-\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     fld,\n-\t\t\t\t\t\t     &data,\n-\t\t\t\t\t\t     \"EM Result\");\n-\t\tif (rc) {\n-\t\t\tBNXT_TF_DBG(ERR, \"Failed to set data fields.\\n\");\n-\t\t\treturn rc;\n-\t\t}\n+\trc = ulp_mapper_tbl_result_build(parms, tbl, &data, \"EM Result\");\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to build the result blob\\n\");\n+\t\treturn rc;\n \t}\n \t/* do the transpose for the internal EM keys */\n \tif (tbl->resource_func == BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE)\n@@ -1818,28 +1872,23 @@ static int32_t\n ulp_mapper_index_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_result_field_info *flds;\n-\tstruct ulp_flow_db_res_params\tfid_parms;\n+\tstruct ulp_flow_db_res_params fid_parms;\n \tstruct ulp_blob\tdata;\n-\tuint64_t idx = 0;\n+\tuint64_t regval = 0;\n \tuint16_t tmplen;\n-\tuint32_t i, num_flds, index, hit;\n+\tuint32_t index, hit;\n \tint32_t rc = 0, trc = 0;\n-\tstruct tf_alloc_tbl_entry_parms\taparms = { 0 };\n+\tstruct tf_alloc_tbl_entry_parms aparms = { 0 };\n \tstruct tf_search_tbl_entry_parms srchparms = { 0 };\n-\tstruct tf_set_tbl_entry_parms\tsparms = { 0 };\n-\tstruct tf_free_tbl_entry_parms\tfree_parms = { 0 };\n+\tstruct tf_set_tbl_entry_parms sparms = { 0 };\n+\tstruct tf_get_tbl_entry_parms gparms = { 0 };\n+\tstruct tf_free_tbl_entry_parms free_parms = { 0 };\n \tuint32_t tbl_scope_id;\n \tstruct tf *tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);\n \tuint16_t bit_size;\n-\tuint32_t encap_flds = 0;\n-\n-\t/* Get the scope id first */\n-\trc = bnxt_ulp_cntxt_tbl_scope_id_get(parms->ulp_ctx, &tbl_scope_id);\n-\tif (rc) {\n-\t\tBNXT_TF_DBG(ERR, \"Failed to get table scope rc=%d\\n\", rc);\n-\t\treturn rc;\n-\t}\n+\tbool alloc = false;\n+\tbool write = false;\n+\tbool search = false;\n \n \t/* use the max size if encap is enabled */\n \tif (tbl->encap_num_fields)\n@@ -1850,82 +1899,150 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t/* Initialize the blob data */\n \tif (!ulp_blob_init(&data, bit_size,\n \t\t\t   parms->device_params->byte_order)) {\n-\t\tBNXT_TF_DBG(ERR, \"Failed initial index table blob\\n\");\n+\t\tBNXT_TF_DBG(ERR, \"Failed to initialize index table blob\\n\");\n \t\treturn -EINVAL;\n \t}\n \n-\t/* Get the result fields list */\n-\tflds = ulp_mapper_result_fields_get(parms, tbl, &num_flds, &encap_flds);\n-\n-\tif (!flds || (!num_flds && !encap_flds)) {\n-\t\tBNXT_TF_DBG(ERR, \"template undefined for the index table\\n\");\n-\t\treturn -EINVAL;\n+\t/* Get the scope id first */\n+\trc = bnxt_ulp_cntxt_tbl_scope_id_get(parms->ulp_ctx, &tbl_scope_id);\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to get table scope rc=%d\\n\", rc);\n+\t\treturn rc;\n \t}\n \n-\t/* process the result fields, loop through them */\n-\tfor (i = 0; i < (num_flds + encap_flds); i++) {\n-\t\t/* set the swap index if encap swap bit is enabled */\n-\t\tif (parms->device_params->encap_byte_swap && encap_flds &&\n-\t\t    i == num_flds)\n-\t\t\tulp_blob_encap_swap_idx_set(&data);\n-\n-\t\t/* Process the result fields */\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     &flds[i],\n-\t\t\t\t\t\t     &data,\n-\t\t\t\t\t\t     \"Indexed Result\");\n-\t\tif (rc) {\n-\t\t\tBNXT_TF_DBG(ERR, \"data field failed\\n\");\n-\t\t\treturn rc;\n+\tswitch (tbl->tbl_opcode) {\n+\tcase BNXT_ULP_INDEX_TBL_OPC_ALLOC_REGFILE:\n+\t\talloc = true;\n+\t\tbreak;\n+\tcase BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE:\n+\t\t/*\n+\t\t * Build the entry, alloc an index, write the table, and store\n+\t\t * the data in the regfile.\n+\t\t */\n+\t\talloc = true;\n+\t\twrite = true;\n+\t\tbreak;\n+\tcase BNXT_ULP_INDEX_TBL_OPC_SRCH_ALLOC_WR_REGFILE:\n+\t\tif (tbl->resource_type == TF_TBL_TYPE_EXT) {\n+\t\t\t/* Not currently supporting with EXT */\n+\t\t\tBNXT_TF_DBG(ERR,\n+\t\t\t\t    \"Ext Table Search Opcode not supported.\\n\");\n+\t\t\treturn -EINVAL;\n \t\t}\n-\t}\n-\n-\t/* if encap bit swap is enabled perform the bit swap */\n-\tif (parms->device_params->encap_byte_swap && encap_flds) {\n-\t\tulp_blob_perform_encap_swap(&data);\n-\t}\n+\t\t/*\n+\t\t * Search for the entry in the tf core.  If it is hit, save the\n+\t\t * index in the regfile.  If it is a miss, Build the entry,\n+\t\t * alloc an index, write the table, and store the data in the\n+\t\t * regfile (same as ALLOC_WR).\n+\t\t */\n+\t\tsearch = true;\n+\t\tbreak;\n+\tcase BNXT_ULP_INDEX_TBL_OPC_WR_REGFILE:\n+\t\t/*\n+\t\t * get the index to write to from the regfile and then write\n+\t\t * the table entry.\n+\t\t */\n+\t\tif (!ulp_regfile_read(parms->regfile,\n+\t\t\t\t      tbl->tbl_operand,\n+\t\t\t\t      &regval)) {\n+\t\t\tBNXT_TF_DBG(ERR,\n+\t\t\t\t    \"Failed to get tbl idx from regfile[%d].\\n\",\n+\t\t\t\t    tbl->tbl_operand);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\tindex = tfp_be_to_cpu_64(regval);\n+\t\t/* For external, we need to reverse shift */\n+\t\tif (tbl->resource_type == TF_TBL_TYPE_EXT)\n+\t\t\tindex = TF_ACT_REC_PTR_2_OFFSET(index);\n \n-\t/*\n-\t * Check for index opcode, if it is Global then\n-\t * no need to allocate the table, just set the table\n-\t * and exit since it is not maintained in the flow db.\n-\t */\n-\tif (tbl->index_opcode == BNXT_ULP_INDEX_OPCODE_GLOBAL) {\n-\t\t/* get the index from index operand */\n-\t\tif (tbl->index_operand < BNXT_ULP_GLB_REGFILE_INDEX_LAST &&\n-\t\t    ulp_mapper_glb_resource_read(parms->mapper_data,\n+\t\twrite = true;\n+\t\tbreak;\n+\tcase BNXT_ULP_INDEX_TBL_OPC_WR_GLB_REGFILE:\n+\t\t/*\n+\t\t * get the index to write to from the global regfile and then\n+\t\t * write the table.\n+\t\t */\n+\t\tif (ulp_mapper_glb_resource_read(parms->mapper_data,\n \t\t\t\t\t\t tbl->direction,\n-\t\t\t\t\t\t tbl->index_operand,\n-\t\t\t\t\t\t &idx)) {\n-\t\t\tBNXT_TF_DBG(ERR, \"Glbl regfile[%d] read failed.\\n\",\n+\t\t\t\t\t\t tbl->tbl_operand,\n+\t\t\t\t\t\t &regval)) {\n+\t\t\tBNXT_TF_DBG(ERR,\n+\t\t\t\t    \"Failed to get tbl idx from Global \"\n+\t\t\t\t    \"regfile[%d].\\n\",\n \t\t\t\t    tbl->index_operand);\n \t\t\treturn -EINVAL;\n \t\t}\n-\t\t/* set the Tf index table */\n-\t\tsparms.dir\t\t= tbl->direction;\n-\t\tsparms.type\t\t= tbl->resource_type;\n-\t\tsparms.data\t\t= ulp_blob_data_get(&data, &tmplen);\n-\t\tsparms.data_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);\n-\t\tsparms.idx\t\t= tfp_be_to_cpu_64(idx);\n-\t\tsparms.tbl_scope_id\t= tbl_scope_id;\n+\t\tindex = tfp_be_to_cpu_64(regval);\n+\t\t/* For external, we need to reverse shift */\n+\t\tif (tbl->resource_type == TF_TBL_TYPE_EXT)\n+\t\t\tindex = TF_ACT_REC_PTR_2_OFFSET(index);\n+\t\twrite = true;\n+\t\tbreak;\n+\tcase BNXT_ULP_INDEX_TBL_OPC_RD_REGFILE:\n+\t\t/*\n+\t\t * The read is different from the rest and can be handled here\n+\t\t * instead of trying to use common code.  Simply read the table\n+\t\t * with the index from the regfile, scan and store the\n+\t\t * identifiers, and return.\n+\t\t */\n+\t\tif (tbl->resource_type == TF_TBL_TYPE_EXT) {\n+\t\t\t/* Not currently supporting with EXT */\n+\t\t\tBNXT_TF_DBG(ERR,\n+\t\t\t\t    \"Ext Table Read Opcode not supported.\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\tif (!ulp_regfile_read(parms->regfile,\n+\t\t\t\t      tbl->tbl_operand, &regval)) {\n+\t\t\tBNXT_TF_DBG(ERR,\n+\t\t\t\t    \"Failed to get tbl idx from regfile[%d]\\n\",\n+\t\t\t\t    tbl->tbl_operand);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\tindex = tfp_be_to_cpu_64(regval);\n+\t\tgparms.dir = tbl->direction;\n+\t\tgparms.type = tbl->resource_type;\n+\t\tgparms.data = ulp_blob_data_get(&data, &tmplen);\n+\t\tgparms.data_sz_in_bytes = ULP_BITS_2_BYTE(tbl->result_bit_size);\n+\t\tgparms.idx = index;\n+\t\trc = tf_get_tbl_entry(tfp, &gparms);\n+\t\tif (rc) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Failed to read the tbl entry %d:%d\\n\",\n+\t\t\t\t    tbl->resource_type, index);\n+\t\t\treturn rc;\n+\t\t}\n+\t\t/*\n+\t\t * Scan the fields in the entry and push them into the regfile.\n+\t\t */\n+\t\trc = ulp_mapper_tbl_ident_scan_ext(parms, tbl,\n+\t\t\t\t\t\t   gparms.data,\n+\t\t\t\t\t\t   gparms.data_sz_in_bytes,\n+\t\t\t\t\t\t   data.byte_order);\n+\t\tif (rc) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Failed to read fields on tbl read \"\n+\t\t\t\t    \"rc=%d\\n\", rc);\n+\t\t\treturn rc;\n+\t\t}\n+\t\treturn 0;\n+\tdefault:\n+\t\tBNXT_TF_DBG(ERR, \"Invalid index table opcode %d\\n\",\n+\t\t\t    tbl->tbl_opcode);\n+\t\treturn -EINVAL;\n+\t}\n \n-\t\trc = tf_set_tbl_entry(tfp, &sparms);\n+\tif (write || search) {\n+\t\t/* Get the result fields list */\n+\t\trc = ulp_mapper_tbl_result_build(parms,\n+\t\t\t\t\t\t tbl,\n+\t\t\t\t\t\t &data,\n+\t\t\t\t\t\t \"Indexed Result\");\n \t\tif (rc) {\n-\t\t\tBNXT_TF_DBG(ERR,\n-\t\t\t\t    \"Glbl Index table[%s][%s][%x] failed rc=%d\\n\",\n-\t\t\t\t    tf_tbl_type_2_str(sparms.type),\n-\t\t\t\t    tf_dir_2_str(sparms.dir),\n-\t\t\t\t    sparms.idx, rc);\n+\t\t\tBNXT_TF_DBG(ERR, \"Failed to build the result blob\\n\");\n \t\t\treturn rc;\n \t\t}\n-\t\treturn 0; /* success */\n \t}\n \n-\tindex = 0;\n-\thit = 0;\n-\t/* Perform the tf table allocation by filling the alloc params */\n-\tif (tbl->srch_b4_alloc) {\n+\tif (search) {\n+\t\t/* Use the result blob to perform a search */\n \t\tmemset(&srchparms, 0, sizeof(srchparms));\n \t\tsrchparms.dir = tbl->direction;\n \t\tsrchparms.type = tbl->resource_type;\n@@ -1948,12 +2065,15 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t\t}\n \t\tindex = srchparms.idx;\n \t\thit = srchparms.hit;\n-\t} else {\n+\t\tif (hit)\n+\t\t\twrite = false;\n+\t\telse\n+\t\t\twrite = true;\n+\t}\n+\n+\tif (alloc) {\n \t\taparms.dir\t\t= tbl->direction;\n \t\taparms.type\t\t= tbl->resource_type;\n-\t\taparms.search_enable\t= tbl->srch_b4_alloc;\n-\t\taparms.result\t\t= ulp_blob_data_get(&data, &tmplen);\n-\t\taparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);\n \t\taparms.tbl_scope_id\t= tbl_scope_id;\n \n \t\t/* All failures after the alloc succeeds require a free */\n@@ -1967,39 +2087,43 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t\tindex = aparms.idx;\n \t}\n \n-\t/*\n-\t * calculate the idx for the result record, for external EM the offset\n-\t * needs to be shifted accordingly. If external non-inline table types\n-\t * are used then need to revisit this logic.\n-\t */\n-\tif (tbl->resource_type == TF_TBL_TYPE_EXT)\n-\t\tidx = TF_ACT_REC_OFFSET_2_PTR(index);\n-\telse\n-\t\tidx = index;\n+\tif (search || alloc) {\n+\t\t/*\n+\t\t * Store the index in the regfile since we either allocated it\n+\t\t * or it was a hit.\n+\t\t *\n+\t\t * Calculate the idx for the result record, for external EM the\n+\t\t * offset needs to be shifted accordingly.\n+\t\t * If external non-inline table types are used then need to\n+\t\t * revisit this logic.\n+\t\t */\n+\t\tif (tbl->resource_type == TF_TBL_TYPE_EXT)\n+\t\t\tregval = TF_ACT_REC_OFFSET_2_PTR(index);\n+\t\telse\n+\t\t\tregval = index;\n \n-\t/* Always storing values in Regfile in BE */\n-\tidx = tfp_cpu_to_be_64(idx);\n-\tif (tbl->index_opcode == BNXT_ULP_INDEX_OPCODE_ALLOCATE) {\n-\t\trc = ulp_regfile_write(parms->regfile, tbl->index_operand, idx);\n+\t\trc = ulp_regfile_write(parms->regfile,\n+\t\t\t\t       tbl->tbl_operand,\n+\t\t\t\t       tfp_cpu_to_be_64(regval));\n \t\tif (!rc) {\n-\t\t\tBNXT_TF_DBG(ERR, \"Write regfile[%d] failed\\n\",\n-\t\t\t\t    tbl->index_operand);\n+\t\t\tBNXT_TF_DBG(ERR, \"Failed to write regfile[%d] rc=%d\\n\",\n+\t\t\t\t    tbl->tbl_operand, rc);\n \t\t\tgoto error;\n \t\t}\n \t}\n \n-\t/* Perform the tf table set by filling the set params */\n-\tif (!tbl->srch_b4_alloc || !hit) {\n-\t\tsparms.dir\t\t= tbl->direction;\n-\t\tsparms.type\t\t= tbl->resource_type;\n-\t\tsparms.data\t\t= ulp_blob_data_get(&data, &tmplen);\n+\tif (write) {\n+\t\tsparms.dir = tbl->direction;\n+\t\tsparms.type = tbl->resource_type;\n+\t\tsparms.data = ulp_blob_data_get(&data, &tmplen);\n \t\tsparms.data_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);\n-\t\tsparms.idx\t\t= index;\n-\t\tsparms.tbl_scope_id\t= tbl_scope_id;\n-\n+\t\tsparms.idx = index;\n+\t\tsparms.tbl_scope_id = tbl_scope_id;\n \t\trc = tf_set_tbl_entry(tfp, &sparms);\n \t\tif (rc) {\n-\t\t\tBNXT_TF_DBG(ERR, \"Set table[%s][%s][%x] failed rc=%d\\n\",\n+\t\t\tBNXT_TF_DBG(ERR,\n+\t\t\t\t    \"Index table[%s][%s][%x] write failed \"\n+\t\t\t\t    \"rc=%d\\n\",\n \t\t\t\t    tf_tbl_type_2_str(sparms.type),\n \t\t\t\t    tf_dir_2_str(sparms.dir),\n \t\t\t\t    sparms.idx, rc);\n@@ -2014,7 +2138,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \tfid_parms.resource_type\t= tbl->resource_type;\n \tfid_parms.resource_sub_type = tbl->resource_sub_type;\n \tfid_parms.resource_hndl\t= index;\n-\tfid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;\n+\tfid_parms.critical_resource = tbl->critical_resource;\n \n \trc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);\n \tif (rc) {\n@@ -2051,15 +2175,15 @@ static int32_t\n ulp_mapper_if_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_result_field_info *flds;\n-\tstruct ulp_blob\tdata;\n+\tstruct ulp_blob\tdata, res_blob;\n \tuint64_t idx;\n \tuint16_t tmplen;\n-\tuint32_t i, num_flds;\n \tint32_t rc = 0;\n \tstruct tf_set_if_tbl_entry_parms iftbl_params = { 0 };\n+\tstruct tf_get_if_tbl_entry_parms get_parms = { 0 };\n \tstruct tf *tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);\n-\tuint32_t encap_flds;\n+\tenum bnxt_ulp_if_tbl_opc if_opc = tbl->tbl_opcode;\n+\tuint32_t res_size;\n \n \t/* Initialize the blob data */\n \tif (!ulp_blob_init(&data, tbl->result_bit_size,\n@@ -2068,34 +2192,64 @@ ulp_mapper_if_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t\treturn -EINVAL;\n \t}\n \n-\t/* Get the result fields list */\n-\tflds = ulp_mapper_result_fields_get(parms, tbl, &num_flds, &encap_flds);\n-\n-\tif (!flds || !num_flds || encap_flds) {\n-\t\tBNXT_TF_DBG(ERR, \"template undefined for the IF table\\n\");\n-\t\treturn -EINVAL;\n+\t/* create the result blob */\n+\trc = ulp_mapper_tbl_result_build(parms, tbl, &data, \"IFtable Result\");\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to build the result blob\\n\");\n+\t\treturn rc;\n \t}\n \n-\t/* process the result fields, loop through them */\n-\tfor (i = 0; i < num_flds; i++) {\n-\t\t/* Process the result fields */\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     &flds[i],\n-\t\t\t\t\t\t     &data,\n-\t\t\t\t\t\t     \"IFtable Result\");\n+\t/* Get the index details */\n+\tswitch (if_opc) {\n+\tcase BNXT_ULP_IF_TBL_OPC_WR_COMP_FIELD:\n+\t\tidx = ULP_COMP_FLD_IDX_RD(parms, tbl->tbl_operand);\n+\t\tbreak;\n+\tcase BNXT_ULP_IF_TBL_OPC_WR_REGFILE:\n+\t\tif (!ulp_regfile_read(parms->regfile, tbl->tbl_operand, &idx)) {\n+\t\t\tBNXT_TF_DBG(ERR, \"regfile[%d] read oob\\n\",\n+\t\t\t\t    tbl->tbl_operand);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\tidx = tfp_be_to_cpu_64(idx);\n+\t\tbreak;\n+\tcase BNXT_ULP_IF_TBL_OPC_WR_CONST:\n+\t\tidx = tbl->tbl_operand;\n+\t\tbreak;\n+\tcase BNXT_ULP_IF_TBL_OPC_RD_COMP_FIELD:\n+\t\t/* Initialize the result blob */\n+\t\tif (!ulp_blob_init(&res_blob, tbl->result_bit_size,\n+\t\t\t\t   parms->device_params->byte_order)) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Failed initial result blob\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\t/* read the interface table */\n+\t\tidx = ULP_COMP_FLD_IDX_RD(parms, tbl->tbl_operand);\n+\t\tres_size = ULP_BITS_2_BYTE(tbl->result_bit_size);\n+\t\tget_parms.dir = tbl->direction;\n+\t\tget_parms.type = tbl->resource_type;\n+\t\tget_parms.idx = idx;\n+\t\tget_parms.data = ulp_blob_data_get(&res_blob, &tmplen);\n+\t\tget_parms.data_sz_in_bytes = res_size;\n+\n+\t\trc = tf_get_if_tbl_entry(tfp, &get_parms);\n \t\tif (rc) {\n-\t\t\tBNXT_TF_DBG(ERR, \"data field failed\\n\");\n+\t\t\tBNXT_TF_DBG(ERR, \"Get table[%d][%s][%x] failed rc=%d\\n\",\n+\t\t\t\t    get_parms.type,\n+\t\t\t\t    tf_dir_2_str(get_parms.dir),\n+\t\t\t\t    get_parms.idx, rc);\n \t\t\treturn rc;\n \t\t}\n-\t}\n-\n-\t/* Get the index details from computed field */\n-\tif (tbl->index_opcode == BNXT_ULP_INDEX_OPCODE_COMP_FIELD) {\n-\t\tidx = ULP_COMP_FLD_IDX_RD(parms, tbl->index_operand);\n-\t} else if (tbl->index_opcode == BNXT_ULP_INDEX_OPCODE_CONSTANT) {\n-\t\tidx = tbl->index_operand;\n-\t} else {\n+\t\trc = ulp_mapper_tbl_ident_scan_ext(parms, tbl,\n+\t\t\t\t\t\t   res_blob.data,\n+\t\t\t\t\t\t   res_size,\n+\t\t\t\t\t\t   res_blob.byte_order);\n+\t\tif (rc)\n+\t\t\tBNXT_TF_DBG(ERR, \"Scan and extract failed rc=%d\\n\", rc);\n+\t\treturn rc;\n+\tcase BNXT_ULP_IF_TBL_OPC_NOT_USED:\n+\t\treturn rc; /* skip it */\n+\tdefault:\n \t\tBNXT_TF_DBG(ERR, \"Invalid tbl index opcode\\n\");\n \t\treturn -EINVAL;\n \t}\n@@ -2123,98 +2277,20 @@ ulp_mapper_if_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \treturn rc;\n }\n \n-/*\n- * Process the identifier list in the generic table.\n- * Extract the ident from the generic table entry and\n- * write it to the reg file.\n- */\n-static int32_t\n-ulp_mapper_gen_tbl_ident_scan(struct bnxt_ulp_mapper_parms *parms,\n-\t\t\t      struct bnxt_ulp_mapper_tbl_info *tbl,\n-\t\t\t      struct ulp_mapper_gen_tbl_entry *gen_tbl_ent)\n-{\n-\tstruct bnxt_ulp_mapper_ident_info *idents;\n-\tuint32_t i, idx, num_idents = 0;\n-\tint32_t rc = 0;\n-\n-\t/* Get the ident list */\n-\tidents = ulp_mapper_ident_fields_get(parms, tbl, &num_idents);\n-\n-\tfor (i = 0; i < num_idents; i++) {\n-\t\t/* Extract the index from the result byte data array */\n-\t\trc = ulp_mapper_gen_tbl_entry_data_get(gen_tbl_ent,\n-\t\t\t\t\t\t       idents[i].ident_bit_pos,\n-\t\t\t\t\t\t       idents[i].ident_bit_size,\n-\t\t\t\t\t\t       (uint8_t *)&idx,\n-\t\t\t\t\t\t       sizeof(idx));\n-\n-\t\t/* validate the extraction */\n-\t\tif (rc) {\n-\t\t\tBNXT_TF_DBG(ERR, \"failed to read %s:%x:%x\\n\",\n-\t\t\t\t    idents[i].description,\n-\t\t\t\t    idents[i].ident_bit_pos,\n-\t\t\t\t    idents[i].ident_bit_size);\n-\t\t\treturn -EINVAL;\n-\t\t}\n-\n-\t\t/* Write it to the regfile */\n-\t\tif (!ulp_regfile_write(parms->regfile,\n-\t\t\t\t       idents[i].regfile_idx, idx)) {\n-\t\t\tBNXT_TF_DBG(ERR, \"Regfile[%d] write failed.\\n\",\n-\t\t\t\t    idents[i].regfile_idx);\n-\t\t\treturn -EINVAL;\n-\t\t}\n-\t}\n-\treturn 0;\n-}\n-\n-/*\n- * Process the identifier list in the generic table.\n- * Write the ident to the generic table entry\n- */\n-static int32_t\n-ulp_mapper_gen_tbl_ident_write(struct bnxt_ulp_mapper_parms *parms,\n-\t\t\t       struct bnxt_ulp_mapper_tbl_info *tbl,\n-\t\t\t       struct ulp_mapper_gen_tbl_entry *gen_tbl_ent)\n-{\n-\tstruct bnxt_ulp_mapper_ident_info *idents;\n-\tuint32_t i, num_idents = 0;\n-\tuint64_t idx;\n-\n-\t/* Get the ident list */\n-\tidents = ulp_mapper_ident_fields_get(parms, tbl, &num_idents);\n-\n-\tfor (i = 0; i < num_idents; i++) {\n-\t\t/* read from the regfile */\n-\t\tif (!ulp_regfile_read(parms->regfile, idents[i].regfile_idx,\n-\t\t\t\t      &idx)) {\n-\t\t\tBNXT_TF_DBG(ERR, \"Regfile[%d] write failed.\\n\",\n-\t\t\t\t    idents[i].regfile_idx);\n-\t\t\treturn -EINVAL;\n-\t\t}\n-\n-\t\t/* Update the gen tbl entry with the new data */\n-\t\tulp_mapper_gen_tbl_entry_data_set(gen_tbl_ent,\n-\t\t\t\t\t\t  idents[i].ident_bit_pos,\n-\t\t\t\t\t\t  idents[i].ident_bit_size,\n-\t\t\t\t\t\t  (uint8_t *)&idx);\n-\t}\n-\treturn 0;\n-}\n-\n static int32_t\n ulp_mapper_gen_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_key_field_info *kflds;\n \tstruct ulp_flow_db_res_params fid_parms;\n-\tstruct ulp_mapper_gen_tbl_entry gen_tbl_ent;\n+\tstruct ulp_mapper_gen_tbl_entry gen_tbl_ent, *g;\n \tuint16_t tmplen;\n-\tstruct ulp_blob key;\n+\tstruct ulp_blob key, data;\n \tuint8_t *cache_key;\n \tint32_t tbl_idx;\n \tuint32_t i, ckey, num_kflds = 0;\n \tuint32_t gen_tbl_hit = 0, fdb_write = 0;\n+\tuint8_t *byte_data;\n \tint32_t rc = 0;\n \n \t/* Get the key fields list and build the key. */\n@@ -2265,9 +2341,12 @@ ulp_mapper_gen_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \tcase BNXT_ULP_GENERIC_TBL_OPC_READ:\n \t\t/* check the reference count */\n \t\tif (ULP_GEN_TBL_REF_CNT(&gen_tbl_ent)) {\n+\t\t\tg = &gen_tbl_ent;\n \t\t\t/* Scan ident list and create the result blob*/\n-\t\t\trc = ulp_mapper_gen_tbl_ident_scan(parms, tbl,\n-\t\t\t\t\t\t\t   &gen_tbl_ent);\n+\t\t\trc = ulp_mapper_tbl_ident_scan_ext(parms, tbl,\n+\t\t\t\t\t\t\t   g->byte_data,\n+\t\t\t\t\t\t\t   g->byte_data_size,\n+\t\t\t\t\t\t\t   g->byte_order);\n \t\t\tif (rc) {\n \t\t\t\tBNXT_TF_DBG(ERR,\n \t\t\t\t\t    \"Failed to scan ident list\\n\");\n@@ -2290,11 +2369,26 @@ ulp_mapper_gen_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t\t\treturn -EINVAL; /* success */\n \t\t}\n \n-\t\t/* Create the result blob from the ident list */\n-\t\trc = ulp_mapper_gen_tbl_ident_write(parms, tbl, &gen_tbl_ent);\n+\t\t/* Initialize the blob data */\n+\t\tif (!ulp_blob_init(&data, tbl->result_bit_size,\n+\t\t\t\t   BNXT_ULP_BYTE_ORDER_BE)) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Failed initial index table blob\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\t/* Get the result fields list */\n+\t\trc = ulp_mapper_tbl_result_build(parms, tbl, &data,\n+\t\t\t\t\t\t \"Gen tbl Result\");\n \t\tif (rc) {\n-\t\t\tBNXT_TF_DBG(ERR,\n-\t\t\t\t    \"Failed to write  ident list\\n\");\n+\t\t\tBNXT_TF_DBG(ERR, \"Failed to build the result blob\\n\");\n+\t\t\treturn rc;\n+\t\t}\n+\t\tbyte_data = ulp_blob_data_get(&data, &tmplen);\n+\t\trc = ulp_mapper_gen_tbl_entry_data_set(&gen_tbl_ent, 0,\n+\t\t\t\t\t\t       tmplen, byte_data,\n+\t\t\t\t\t\t       ULP_BITS_2_BYTE(tmplen));\n+\t\tif (rc) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Failed to write generic table\\n\");\n \t\t\treturn -EINVAL;\n \t\t}\n \n@@ -2310,7 +2404,7 @@ ulp_mapper_gen_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t/* Set the generic entry hit */\n \trc = ulp_regfile_write(parms->regfile,\n \t\t\t       BNXT_ULP_REGFILE_INDEX_GENERIC_TBL_HIT,\n-\t\t\t       gen_tbl_hit);\n+\t\t\t       tfp_cpu_to_be_64(gen_tbl_hit));\n \tif (!rc) {\n \t\tBNXT_TF_DBG(ERR, \"Write regfile[%d] failed\\n\",\n \t\t\t    tbl->index_operand);\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 ddc396b3f9..b9a81d881b 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@@ -3,6 +3,8 @@\n  * All rights reserved.\n  */\n \n+/* date: Thu Oct 15 17:28:37 2020 */\n+\n #ifndef ULP_TEMPLATE_DB_H_\n #define ULP_TEMPLATE_DB_H_\n \n@@ -230,6 +232,26 @@ enum bnxt_ulp_hdr_type {\n \tBNXT_ULP_HDR_TYPE_LAST = 3\n };\n \n+enum bnxt_ulp_if_tbl_opc {\n+\tBNXT_ULP_IF_TBL_OPC_NOT_USED = 0,\n+\tBNXT_ULP_IF_TBL_OPC_WR_COMP_FIELD = 1,\n+\tBNXT_ULP_IF_TBL_OPC_WR_REGFILE = 2,\n+\tBNXT_ULP_IF_TBL_OPC_WR_CONST = 3,\n+\tBNXT_ULP_IF_TBL_OPC_RD_COMP_FIELD = 4,\n+\tBNXT_ULP_IF_TBL_OPC_LAST = 5\n+};\n+\n+enum bnxt_ulp_index_tbl_opc {\n+\tBNXT_ULP_INDEX_TBL_OPC_NOT_USED = 0,\n+\tBNXT_ULP_INDEX_TBL_OPC_ALLOC_REGFILE = 1,\n+\tBNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE = 2,\n+\tBNXT_ULP_INDEX_TBL_OPC_SRCH_ALLOC_WR_REGFILE = 3,\n+\tBNXT_ULP_INDEX_TBL_OPC_WR_GLB_REGFILE = 4,\n+\tBNXT_ULP_INDEX_TBL_OPC_WR_REGFILE = 5,\n+\tBNXT_ULP_INDEX_TBL_OPC_RD_REGFILE = 6,\n+\tBNXT_ULP_INDEX_TBL_OPC_LAST = 7\n+};\n+\n enum bnxt_ulp_index_opcode {\n \tBNXT_ULP_INDEX_OPCODE_NOT_USED = 0,\n \tBNXT_ULP_INDEX_OPCODE_ALLOCATE = 1,\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c b/drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c\nindex be6149b9ce..73f57409a9 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c\n@@ -56,8 +56,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_FLOW_CNTR_PTR_0\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_FLOW_CNTR_PTR_0\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -73,7 +73,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n \t.index_operand = BNXT_ULP_REGFILE_INDEX_MODIFY_IPV4_SRC_PTR_0\n \t},\n \t{\n@@ -90,8 +90,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MODIFY_IPV4_DST_PTR_0\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MODIFY_IPV4_DST_PTR_0\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -105,8 +105,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 0,\n \t.encap_num_fields = 12,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_GLOBAL,\n-\t.index_operand = BNXT_ULP_GLB_REGFILE_INDEX_ENCAP_MAC_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_WR_GLB_REGFILE,\n+\t.tbl_operand = BNXT_ULP_GLB_REGFILE_INDEX_ENCAP_MAC_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -121,8 +121,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -137,8 +137,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -154,8 +154,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_FLOW_CNTR_PTR_0\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_FLOW_CNTR_PTR_0\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -170,8 +170,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -186,8 +186,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -203,8 +203,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_FLOW_CNTR_PTR_0\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_FLOW_CNTR_PTR_0\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -219,8 +219,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -235,8 +235,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -252,8 +252,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_FLOW_CNTR_PTR_0\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_FLOW_CNTR_PTR_0\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -269,7 +269,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 0,\n \t.encap_num_fields = 3,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n \t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_SP_PTR\n \t},\n \t{\n@@ -286,8 +286,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 0,\n \t.encap_num_fields = 3,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_SP_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_SP_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -301,8 +301,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 0,\n \t.encap_num_fields = 12,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_ENCAP_PTR_0\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_ENCAP_PTR_0\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -317,8 +317,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 12,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -333,8 +333,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -350,8 +350,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_FLOW_CNTR_PTR_0\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_FLOW_CNTR_PTR_0\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -367,8 +367,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MODIFY_IPV4_SRC_PTR_0\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MODIFY_IPV4_SRC_PTR_0\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -384,7 +384,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n \t.index_operand = BNXT_ULP_REGFILE_INDEX_MODIFY_IPV4_DST_PTR_0\n \t},\n \t{\n@@ -400,8 +400,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 0,\n \t.encap_num_fields = 12,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_GLOBAL,\n-\t.index_operand = BNXT_ULP_GLB_REGFILE_INDEX_ENCAP_MAC_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_WR_GLB_REGFILE,\n+\t.tbl_operand = BNXT_ULP_GLB_REGFILE_INDEX_ENCAP_MAC_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -416,8 +416,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -432,8 +432,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 11,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -449,8 +449,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_FLOW_CNTR_PTR_0\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_FLOW_CNTR_PTR_0\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -467,7 +467,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 0,\n \t.encap_num_fields = 12,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n \t.index_operand = BNXT_ULP_REGFILE_INDEX_ENCAP_PTR_0\n \t},\n \t{\n@@ -483,8 +483,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -501,8 +501,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -519,8 +519,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 11,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t}\n };\n \ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c b/drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c\nindex 7a22aedf83..fcc5c9e20c 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c\n@@ -202,8 +202,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{ /* class_tid: 1, wh_plus, table: l2_cntxt_cache_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INVALID,\n@@ -250,8 +250,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_bit_size = 32,\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_COMP_FIELD,\n-\t.index_operand = BNXT_ULP_CF_IDX_PHY_PORT_PARIF\n+\t.tbl_opcode = BNXT_ULP_IF_TBL_OPC_WR_COMP_FIELD,\n+\t.tbl_operand = BNXT_ULP_CF_IDX_PHY_PORT_PARIF,\n \t},\n \t{ /* class_tid: 1, wh_plus, table: parif_def_arec_ptr_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_IF_TABLE,\n@@ -261,8 +261,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_bit_size = 32,\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_COMP_FIELD,\n-\t.index_operand = BNXT_ULP_CF_IDX_PHY_PORT_PARIF\n+\t.tbl_opcode = BNXT_ULP_IF_TBL_OPC_WR_COMP_FIELD,\n+\t.tbl_operand = BNXT_ULP_CF_IDX_PHY_PORT_PARIF\n \t},\n \t{ /* class_tid: 1, wh_plus, table: parif_def_err_arec_ptr_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_IF_TABLE,\n@@ -272,8 +272,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_bit_size = 32,\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_COMP_FIELD,\n-\t.index_operand = BNXT_ULP_CF_IDX_PHY_PORT_PARIF\n+\t.tbl_opcode = BNXT_ULP_IF_TBL_OPC_WR_COMP_FIELD,\n+\t.tbl_operand = BNXT_ULP_CF_IDX_PHY_PORT_PARIF\n \t},\n \t{ /* class_tid: 2, wh_plus, table: int_full_act_record_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -287,8 +287,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{ /* class_tid: 2, wh_plus, table: l2_cntxt_tcam_vfr_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,\n@@ -361,8 +361,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_bit_size = 32,\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_COMP_FIELD,\n-\t.index_operand = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF\n+\t.tbl_opcode = BNXT_ULP_IF_TBL_OPC_WR_COMP_FIELD,\n+\t.tbl_operand = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF\n \t},\n \t{ /* class_tid: 2, wh_plus, table: parif_def_arec_ptr_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_IF_TABLE,\n@@ -372,8 +372,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_bit_size = 32,\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_COMP_FIELD,\n-\t.index_operand = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF\n+\t.tbl_opcode = BNXT_ULP_IF_TBL_OPC_WR_COMP_FIELD,\n+\t.tbl_operand = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF\n \t},\n \t{ /* class_tid: 2, wh_plus, table: parif_def_err_arec_ptr_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_IF_TABLE,\n@@ -383,8 +383,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_bit_size = 32,\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_COMP_FIELD,\n-\t.index_operand = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF\n+\t.tbl_opcode = BNXT_ULP_IF_TBL_OPC_WR_COMP_FIELD,\n+\t.tbl_operand = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF\n \t},\n \t{ /* class_tid: 3, wh_plus, table: egr_int_vtag_encap_record_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -398,8 +398,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_num_fields = 0,\n \t.encap_num_fields = 12,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_ENCAP_PTR_0\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_ENCAP_PTR_0\n \t},\n \t{ /* class_tid: 3, wh_plus, table: egr_int_full_act_record_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -413,8 +413,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{ /* class_tid: 3, wh_plus, table: egr_l2_cntxt_cache_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INVALID,\n@@ -465,8 +465,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{ /* class_tid: 3, wh_plus, table: ing_l2_cntxt_dtagged_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,\n@@ -551,8 +551,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_bit_size = 32,\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_CONSTANT,\n-\t.index_operand = BNXT_ULP_SYM_VF_FUNC_PARIF\n+\t.tbl_opcode = BNXT_ULP_IF_TBL_OPC_WR_CONST,\n+\t.tbl_operand = BNXT_ULP_SYM_VF_FUNC_PARIF\n \t},\n \t{ /* class_tid: 4, wh_plus, table: egr_parif_def_arec_ptr_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_IF_TABLE,\n@@ -562,8 +562,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_bit_size = 32,\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_CONSTANT,\n-\t.index_operand = BNXT_ULP_SYM_VF_FUNC_PARIF\n+\t.tbl_opcode = BNXT_ULP_IF_TBL_OPC_WR_CONST,\n+\t.tbl_operand = BNXT_ULP_SYM_VF_FUNC_PARIF\n \t},\n \t{ /* class_tid: 4, wh_plus, table: egr_parif_def_err_arec_ptr_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_IF_TABLE,\n@@ -573,8 +573,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_bit_size = 32,\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_CONSTANT,\n-\t.index_operand = BNXT_ULP_SYM_VF_FUNC_PARIF\n+\t.tbl_opcode = BNXT_ULP_IF_TBL_OPC_WR_CONST,\n+\t.tbl_operand = BNXT_ULP_SYM_VF_FUNC_PARIF\n \t},\n \t{ /* class_tid: 4, wh_plus, table: ing_int_full_act_record_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n@@ -588,8 +588,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_SET_VFR_FLAG,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR\n \t},\n \t{ /* class_tid: 4, wh_plus, table: ing_l2_cntxt_tcam_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,\n@@ -623,8 +623,9 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_num_fields = 26,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_GLOBAL,\n-\t.index_operand = BNXT_ULP_GLB_REGFILE_INDEX_GLB_LB_AREC_PTR\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_WR_GLB_REGFILE,\n+\t.tbl_operand = BNXT_ULP_GLB_REGFILE_INDEX_GLB_LB_AREC_PTR,\n+\t.fdb_opcode = BNXT_ULP_FDB_OPC_NOP\n \t},\n \t{ /* class_tid: 6, wh_plus, table: l2_cntxt_tcam_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,\n@@ -1824,8 +1825,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {\n \t.result_num_fields = 1,\n \t.encap_num_fields = 0,\n \t.mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP,\n-\t.index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE,\n-\t.index_operand = BNXT_ULP_REGFILE_INDEX_FLOW_CNTR_PTR_0\n+\t.tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,\n+\t.tbl_operand = BNXT_ULP_REGFILE_INDEX_FLOW_CNTR_PTR_0\n \t},\n \t{ /* class_tid: 18, wh_plus, table: l2_cntxt_tcam_0 */\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,\n",
    "prefixes": [
        "v2",
        "32/58"
    ]
}