get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 71146,
    "url": "http://patches.dpdk.org/api/patches/71146/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200610114427.22146-11-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": "<20200610114427.22146-11-somnath.kotur@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200610114427.22146-11-somnath.kotur@broadcom.com",
    "date": "2020-06-10T11:44:01",
    "name": "[10/36] net/bnxt: extend default identifier list to be global resource list",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5f14d582c7a77988b2a5188f07c2d92888bba83b",
    "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/20200610114427.22146-11-somnath.kotur@broadcom.com/mbox/",
    "series": [
        {
            "id": 10380,
            "url": "http://patches.dpdk.org/api/series/10380/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=10380",
            "date": "2020-06-10T11:43:51",
            "name": "bnxt patches",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/10380/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/71146/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/71146/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 98850A051A;\n\tWed, 10 Jun 2020 13:50:45 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BDA841BE9D;\n\tWed, 10 Jun 2020 13:49:11 +0200 (CEST)",
            "from relay.smtp.broadcom.com (relay.smtp.broadcom.com\n [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id 8A7F81BDFD\n for <dev@dpdk.org>; Wed, 10 Jun 2020 13:49:08 +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 C4E851BD53E;\n Wed, 10 Jun 2020 04:49:07 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com C4E851BD53E",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1591789748;\n bh=UI16QEM0sHHC16U/g6EmFG2qFCpvNIN4mw6xwSWOqF0=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=aKjpR86NlDLiR2E2IRwgrhIhwjj56BFtaOe0hOco75aGqp7QKYu1i0Nj7I9ZSe/PB\n +xnY+SHnomdETxe8puYttwFaS2U7PYvl4gGlIDaldws62Oz730coDlWdEzazAlGdqw\n T4nH5YIkBBtDnXvPOS/jcwhvrGNDKNDkpRS7r9oQ=",
        "From": "Somnath Kotur <somnath.kotur@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com",
        "Date": "Wed, 10 Jun 2020 17:14:01 +0530",
        "Message-Id": "<20200610114427.22146-11-somnath.kotur@broadcom.com>",
        "X-Mailer": "git-send-email 2.10.1.613.g2cc2e70",
        "In-Reply-To": "<20200610114427.22146-1-somnath.kotur@broadcom.com>",
        "References": "<20200610114427.22146-1-somnath.kotur@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH 10/36] net/bnxt: extend default identifier list\n\tto be global resource list",
        "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\nThe default identifier list in ulp mapper is extended to support\nother truflow resource types and not just identifiers.\n\nSigned-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nReviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>\nSigned-off-by: Somnath Kotur <somnath.kotur@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 231 +++++++++++++++++---------\n drivers/net/bnxt/tf_ulp/ulp_mapper.h          |  11 +-\n drivers/net/bnxt/tf_ulp/ulp_template_db.c     |  45 ++---\n drivers/net/bnxt/tf_ulp/ulp_template_db.h     |  18 +-\n drivers/net/bnxt/tf_ulp/ulp_template_struct.h |  13 +-\n 5 files changed, 196 insertions(+), 122 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\nindex 3b8ec43..158b430 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n@@ -17,55 +17,111 @@\n #include \"ulp_flow_db.h\"\n #include \"ulp_mapper.h\"\n \n-static struct bnxt_ulp_def_ident_info *\n-ulp_mapper_def_ident_info_list_get(uint32_t *num_entries)\n+static struct bnxt_ulp_glb_resource_info *\n+ulp_mapper_glb_resource_info_list_get(uint32_t *num_entries)\n {\n \tif (!num_entries)\n \t\treturn NULL;\n-\t*num_entries = BNXT_ULP_DEF_IDENT_INFO_TBL_MAX_SZ;\n-\treturn ulp_def_ident_tbl;\n+\t*num_entries = BNXT_ULP_GLB_RESOURCE_INFO_TBL_MAX_SZ;\n+\treturn ulp_glb_resource_tbl;\n }\n \n /*\n- * Read a default identifier from the mapper regfile.\n+ * Read the global resource from the mapper global resource list\n  *\n  * The regval is always returned in big-endian.\n  *\n  * returns 0 on success\n  */\n static int32_t\n-ulp_mapper_def_regfile_read(struct bnxt_ulp_mapper_data *mapper_data,\n-\t\t\t    enum tf_dir dir,\n-\t\t\t    uint16_t idx,\n-\t\t\t    uint64_t *regval)\n+ulp_mapper_glb_resource_read(struct bnxt_ulp_mapper_data *mapper_data,\n+\t\t\t     enum tf_dir dir,\n+\t\t\t     uint16_t idx,\n+\t\t\t     uint64_t *regval)\n {\n \tif (!mapper_data || !regval ||\n-\t    dir >= TF_DIR_MAX || idx >= BNXT_ULP_DEF_REGFILE_INDEX_LAST)\n+\t    dir >= TF_DIR_MAX || idx >= BNXT_ULP_GLB_REGFILE_INDEX_LAST)\n \t\treturn -EINVAL;\n-\t*regval = mapper_data->dflt_ids[dir][idx].ident;\n+\n+\t*regval = mapper_data->glb_res_tbl[dir][idx].resource_hndl;\n \treturn 0;\n }\n \n /*\n- * Write a default identifier to the mapper regfile\n+ * Write a global resource to the mapper global resource list\n  *\n  * The regval value must be in big-endian.\n  *\n  * return 0 on success.\n  */\n static int32_t\n-ulp_mapper_def_regfile_write(struct bnxt_ulp_mapper_data *mapper_data,\n-\t\t\t     enum tf_dir dir,\n-\t\t\t     uint16_t idx,\n-\t\t\t     uint64_t regval)\n+ulp_mapper_glb_resource_write(struct bnxt_ulp_mapper_data *data,\n+\t\t\t      struct bnxt_ulp_glb_resource_info *res,\n+\t\t\t      uint64_t regval)\n {\n-\tif (!mapper_data || dir >= TF_DIR_MAX ||\n-\t    idx >= BNXT_ULP_DEF_REGFILE_INDEX_LAST)\n+\tstruct bnxt_ulp_mapper_glb_resource_entry *ent;\n+\n+\t/* validate the arguments */\n+\tif (!data || res->direction >= TF_DIR_MAX ||\n+\t    res->glb_regfile_index >= BNXT_ULP_GLB_REGFILE_INDEX_LAST)\n \t\treturn -EINVAL;\n-\tmapper_data->dflt_ids[dir][idx].ident = regval;\n+\n+\t/* write to the mapper data */\n+\tent = &data->glb_res_tbl[res->direction][res->glb_regfile_index];\n+\tent->resource_func = res->resource_func;\n+\tent->resource_type = res->resource_type;\n+\tent->resource_hndl = regval;\n \treturn 0;\n }\n \n+/*\n+ * Internal function to allocate identity resource and store it in mapper data.\n+ *\n+ * returns 0 on success\n+ */\n+static int32_t\n+ulp_mapper_resource_ident_allocate(struct tf *tfp,\n+\t\t\t\t   struct bnxt_ulp_mapper_data *mapper_data,\n+\t\t\t\t   struct bnxt_ulp_glb_resource_info *glb_res)\n+{\n+\tstruct tf_alloc_identifier_parms iparms = { 0 };\n+\tstruct tf_free_identifier_parms fparms;\n+\tuint64_t regval;\n+\tint32_t rc = 0;\n+\n+\tiparms.ident_type = glb_res->resource_type;\n+\tiparms.dir = glb_res->direction;\n+\n+\t/* Allocate the Identifier using tf api */\n+\trc = tf_alloc_identifier(tfp, &iparms);\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to alloc identifier [%s][%d]\\n\",\n+\t\t\t    (iparms.dir == TF_DIR_RX) ? \"RX\" : \"TX\",\n+\t\t\t    iparms.ident_type);\n+\t\treturn rc;\n+\t}\n+\n+\t/* entries are stored as big-endian format */\n+\tregval = tfp_cpu_to_be_64((uint64_t)iparms.id);\n+\t/* write to the mapper global resource */\n+\trc = ulp_mapper_glb_resource_write(mapper_data, glb_res, regval);\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to write to global resource id\\n\");\n+\t\t/* Free the identifer when update failed */\n+\t\tfparms.dir = iparms.dir;\n+\t\tfparms.ident_type = iparms.ident_type;\n+\t\tfparms.id = iparms.id;\n+\t\ttf_free_identifier(tfp, &fparms);\n+\t\treturn rc;\n+\t}\n+#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG\n+\tBNXT_TF_DBG(DEBUG, \"Allocated Glb Res[%s][%d][%d] = 0x%04x\\n\",\n+\t\t    (iparms.dir == TF_DIR_RX) ? \"RX\" : \"TX\",\n+\t\t    glb_res->glb_regfile_index, iparms.ident_type, iparms.id);\n+#endif\n+\treturn rc;\n+}\n+\n /* Retrieve the cache initialization parameters for the tbl_idx */\n static struct bnxt_ulp_cache_tbl_params *\n ulp_mapper_cache_tbl_params_get(uint32_t tbl_idx)\n@@ -323,7 +379,6 @@ ulp_mapper_cache_entry_free(struct bnxt_ulp_context *ulp,\n \t * formulate the args for tf calls.\n \t */\n \tulp_mapper_cache_res_type_get(res, &table_type, &table_id);\n-\n \tcache_entry = ulp_mapper_cache_entry_get(ulp, table_id,\n \t\t\t\t\t\t (uint16_t)res->resource_hndl);\n \tif (!cache_entry || !cache_entry->ref_count) {\n@@ -641,7 +696,7 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,\n \t\t\treturn -EINVAL;\n \t\t}\n \t\tbreak;\n-\tcase BNXT_ULP_RESULT_OPC_SET_TO_DEF_REGFILE:\n+\tcase BNXT_ULP_RESULT_OPC_SET_TO_GLB_REGFILE:\n \t\tif (!ulp_operand_read(fld->result_operand,\n \t\t\t\t      (uint8_t *)&idx,\n \t\t\t\t      sizeof(uint16_t))) {\n@@ -649,9 +704,9 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,\n \t\t\treturn -EINVAL;\n \t\t}\n \t\tidx = tfp_be_to_cpu_16(idx);\n-\t\tif (ulp_mapper_def_regfile_read(parms->mapper_data,\n-\t\t\t\t\t\tdir,\n-\t\t\t\t\t\tidx, &regval)) {\n+\t\tif (ulp_mapper_glb_resource_read(parms->mapper_data,\n+\t\t\t\t\t\t dir,\n+\t\t\t\t\t\t idx, &regval)) {\n \t\t\tBNXT_TF_DBG(ERR, \"%s regfile[%d] read failed.\\n\",\n \t\t\t\t    name, idx);\n \t\t\treturn -EINVAL;\n@@ -789,16 +844,16 @@ ulp_mapper_keymask_field_process(struct bnxt_ulp_mapper_parms *parms,\n \t\t\treturn -EINVAL;\n \t\t}\n \t\tbreak;\n-\tcase BNXT_ULP_SPEC_OPC_SET_TO_DEF_REGFILE:\n+\tcase BNXT_ULP_SPEC_OPC_SET_TO_GLB_REGFILE:\n \t\tif (!ulp_operand_read(operand, (uint8_t *)&idx,\n \t\t\t\t      sizeof(uint16_t))) {\n \t\t\tBNXT_TF_DBG(ERR, \"%s key operand read failed.\\n\", name);\n \t\t\treturn -EINVAL;\n \t\t}\n \t\tidx = tfp_be_to_cpu_16(idx);\n-\t\tif (ulp_mapper_def_regfile_read(parms->mapper_data,\n-\t\t\t\t\t\tdir,\n-\t\t\t\t\t\tidx, &val64)) {\n+\t\tif (ulp_mapper_glb_resource_read(parms->mapper_data,\n+\t\t\t\t\t\t dir,\n+\t\t\t\t\t\t idx, &val64)) {\n \t\t\tBNXT_TF_DBG(ERR, \"%s regfile[%d] read failed.\\n\",\n \t\t\t\t    name, idx);\n \t\t\treturn -EINVAL;\n@@ -1736,6 +1791,37 @@ ulp_mapper_cache_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \treturn rc;\n }\n \n+static int32_t\n+ulp_mapper_glb_resource_info_init(struct tf *tfp,\n+\t\t\t\t  struct bnxt_ulp_mapper_data *mapper_data)\n+{\n+\tstruct bnxt_ulp_glb_resource_info *glb_res;\n+\tuint32_t num_glb_res_ids, idx;\n+\tint32_t rc = 0;\n+\n+\tglb_res = ulp_mapper_glb_resource_info_list_get(&num_glb_res_ids);\n+\tif (!glb_res || !num_glb_res_ids) {\n+\t\tBNXT_TF_DBG(ERR, \"Invalid Arguments\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Iterate the global resources and process each one */\n+\tfor (idx = 0; idx < num_glb_res_ids; idx++) {\n+\t\tswitch (glb_res[idx].resource_func) {\n+\t\tcase BNXT_ULP_RESOURCE_FUNC_IDENTIFIER:\n+\t\t\trc = ulp_mapper_resource_ident_allocate(tfp,\n+\t\t\t\t\t\t\t\tmapper_data,\n+\t\t\t\t\t\t\t\t&glb_res[idx]);\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tBNXT_TF_DBG(ERR, \"Global resource %x not supported\\n\",\n+\t\t\t\t    glb_res[idx].resource_func);\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\treturn rc;\n+}\n+\n /*\n  * Function to process the action template. Iterate through the list\n  * action info templates and process it.\n@@ -1911,6 +1997,32 @@ ulp_mapper_resources_free(struct bnxt_ulp_context\t*ulp_ctx,\n \treturn rc;\n }\n \n+static void\n+ulp_mapper_glb_resource_info_deinit(struct bnxt_ulp_context *ulp_ctx,\n+\t\t\t\t    struct bnxt_ulp_mapper_data *mapper_data)\n+{\n+\tstruct bnxt_ulp_mapper_glb_resource_entry *ent;\n+\tstruct ulp_flow_db_res_params res;\n+\tuint32_t dir, idx;\n+\n+\t/* Iterate the global resources and process each one */\n+\tfor (dir = TF_DIR_RX; dir < TF_DIR_MAX; dir++) {\n+\t\tfor (idx = 0; idx < BNXT_ULP_GLB_RESOURCE_INFO_TBL_MAX_SZ;\n+\t\t      idx++) {\n+\t\t\tent = &mapper_data->glb_res_tbl[dir][idx];\n+\t\t\tif (ent->resource_func ==\n+\t\t\t    BNXT_ULP_RESOURCE_FUNC_INVALID)\n+\t\t\t\tcontinue;\n+\t\t\tmemset(&res, 0, sizeof(struct ulp_flow_db_res_params));\n+\t\t\tres.resource_func = ent->resource_func;\n+\t\t\tres.direction = dir;\n+\t\t\tres.resource_type = ent->resource_type;\n+\t\t\tres.resource_hndl = ent->resource_hndl;\n+\t\t\tulp_mapper_resource_free(ulp_ctx, &res);\n+\t\t}\n+\t}\n+}\n+\n int32_t\n ulp_mapper_flow_destroy(struct bnxt_ulp_context\t*ulp_ctx, uint32_t fid)\n {\n@@ -2057,11 +2169,8 @@ int32_t\n ulp_mapper_init(struct bnxt_ulp_context *ulp_ctx)\n {\n \tstruct bnxt_ulp_cache_tbl_params *tbl;\n-\tstruct tf_alloc_identifier_parms iparms;\n \tstruct bnxt_ulp_mapper_data *data;\n-\tstruct bnxt_ulp_def_ident_info *dflt_ids;\n-\tuint32_t i, num_dflt_ids, reg_idx;\n-\tuint64_t regval;\n+\tuint32_t i;\n \tstruct tf *tfp;\n \tint32_t rc, csize;\n \n@@ -2086,30 +2195,11 @@ ulp_mapper_init(struct bnxt_ulp_context *ulp_ctx)\n \t\treturn -ENOMEM;\n \t}\n \n-\t/* Allocate the default ids. */\n-\tdflt_ids = ulp_mapper_def_ident_info_list_get(&num_dflt_ids);\n-\tfor (i = 0; i < num_dflt_ids; i++) {\n-\t\tiparms.ident_type = dflt_ids[i].ident_type;\n-\t\tiparms.dir = dflt_ids[i].direction;\n-\n-\t\trc = tf_alloc_identifier(tfp, &iparms);\n-\t\tif (rc) {\n-\t\t\tBNXT_TF_DBG(ERR, \"Failed to alloc dflt \"\n-\t\t\t\t    \"identifier [%s][%d]\\n\",\n-\t\t\t\t    (iparms.dir == TF_DIR_RX) ? \"RX\" : \"TX\",\n-\t\t\t\t    iparms.ident_type);\n-\t\t\tgoto error;\n-\t\t}\n-\t\treg_idx = dflt_ids[i].def_regfile_index;\n-\t\t/* All regfile entries are stored as 64bit big-endian values. */\n-\t\tregval = tfp_cpu_to_be_64((uint64_t)iparms.id);\n-\t\trc = ulp_mapper_def_regfile_write(data, iparms.dir,\n-\t\t\t\t\t\t  reg_idx, regval);\n-\t\tif (rc) {\n-\t\t\tBNXT_TF_DBG(ERR, \"Failed to write to default \"\n-\t\t\t\t    \"regfile.\\n\");\n-\t\t\tgoto error;\n-\t\t}\n+\t/* Allocate the global resource ids */\n+\trc = ulp_mapper_glb_resource_info_init(tfp, data);\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to initialize global resource ids\\n\");\n+\t\tgoto error;\n \t}\n \n \t/* Allocate the ulp cache tables. */\n@@ -2144,12 +2234,8 @@ ulp_mapper_init(struct bnxt_ulp_context *ulp_ctx)\n void\n ulp_mapper_deinit(struct bnxt_ulp_context *ulp_ctx)\n {\n-\tstruct tf_free_identifier_parms free_parms;\n-\tstruct bnxt_ulp_def_ident_info *dflt_ids;\n \tstruct bnxt_ulp_mapper_data *data;\n-\tuint32_t i, num_dflt_ids, reg_idx;\n-\tenum tf_dir dir;\n-\tuint64_t regval;\n+\tuint32_t i;\n \tstruct tf *tfp;\n \n \tif (!ulp_ctx) {\n@@ -2174,27 +2260,8 @@ ulp_mapper_deinit(struct bnxt_ulp_context *ulp_ctx)\n \t\tgoto free_mapper_data;\n \t}\n \n-\t/* Free the default prof func ids per direction. */\n-\tdflt_ids = ulp_mapper_def_ident_info_list_get(&num_dflt_ids);\n-\tfor (i = 0; i < num_dflt_ids; i++) {\n-\t\treg_idx = dflt_ids[i].def_regfile_index;\n-\t\tdir = dflt_ids[i].direction;\n-\t\tfree_parms.ident_type = dflt_ids[i].ident_type;\n-\t\tfree_parms.dir = dir;\n-\t\tif (ulp_mapper_def_regfile_read(data, dir, reg_idx, &regval)) {\n-\t\t\tBNXT_TF_DBG(ERR, \"Failed to read def regfile to free \"\n-\t\t\t\t    \"identifier.\\n\");\n-\t\t\tcontinue;\n-\t\t}\n-\t\t/*\n-\t\t * All regfile entries are stored as 64bit big-endian.  Need\n-\t\t * to convert the value to cpu before calling tf.\n-\t\t */\n-\t\tregval = tfp_be_to_cpu_64(regval);\n-\t\tfree_parms.id = (uint16_t)regval;\n-\t\t/* Ignore errors and free the remaining identifiers. */\n-\t\ttf_free_identifier(tfp, &free_parms);\n-\t}\n+\t/* Free the global resource info table entries */\n+\tulp_mapper_glb_resource_info_deinit(ulp_ctx, data);\n \n free_mapper_data:\n \t/* Free the ulp cache tables */\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.h b/drivers/net/bnxt/tf_ulp/ulp_mapper.h\nindex 3be04e8..0c9bb86 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.h\n@@ -39,14 +39,15 @@ struct bnxt_ulp_mapper_cache_entry {\n \tuint8_t ident_types[BNXT_ULP_CACHE_TBL_IDENT_MAX_NUM];\n };\n \n-struct bnxt_ulp_mapper_def_id_entry {\n-\tenum tf_identifier_type ident_type;\n-\tuint64_t ident;\n+struct bnxt_ulp_mapper_glb_resource_entry {\n+\tenum bnxt_ulp_resource_func\tresource_func;\n+\tuint32_t\t\t\tresource_type; /* TF_ enum type */\n+\tuint64_t\t\t\tresource_hndl;\n };\n \n struct bnxt_ulp_mapper_data {\n-\tstruct bnxt_ulp_mapper_def_id_entry\n-\t\tdflt_ids[TF_DIR_MAX][BNXT_ULP_DEF_IDENT_INFO_TBL_MAX_SZ];\n+\tstruct bnxt_ulp_mapper_glb_resource_entry\n+\t\tglb_res_tbl[TF_DIR_MAX][BNXT_ULP_GLB_RESOURCE_INFO_TBL_MAX_SZ];\n \tstruct bnxt_ulp_mapper_cache_entry\n \t\t*cache_tbl[BNXT_ULP_CACHE_TBL_MAX_SZ];\n };\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.c b/drivers/net/bnxt/tf_ulp/ulp_template_db.c\nindex 444373a..c6b1b9b 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_db.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.c\n@@ -308,20 +308,10 @@ struct bnxt_ulp_cache_tbl_params ulp_cache_tbl_params[] = {\n \t}\n };\n \n-struct bnxt_ulp_def_ident_info ulp_def_ident_tbl[] = {\n-\t[0] = {\n-\t\t.ident_type              = TF_IDENT_TYPE_PROF_FUNC,\n-\t\t.def_regfile_index       =\n-\t\t\tBNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID,\n-\t\t.direction               = TF_DIR_RX\n-\t}\n-};\n-\n struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST] = {\n \t[BNXT_ULP_DEVICE_ID_WH_PLUS] = {\n \t\t.global_fid_enable       = BNXT_ULP_SYM_YES,\n-\t\t.byte_order              = (enum bnxt_ulp_byte_order)\n-\t\t\t\t\t\tBNXT_ULP_SYM_LITTLE_ENDIAN,\n+\t\t.byte_order              = BNXT_ULP_BYTE_ORDER_LE,\n \t\t.encap_byte_swap         = 1,\n \t\t.lfid_entries            = 16384,\n \t\t.lfid_entry_size         = 4,\n@@ -332,6 +322,21 @@ struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST] = {\n \t}\n };\n \n+struct bnxt_ulp_glb_resource_info ulp_glb_resource_tbl[] = {\n+\t[0] = {\n+\t.resource_func           = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,\n+\t.resource_type           = TF_IDENT_TYPE_PROF_FUNC,\n+\t.glb_regfile_index       = BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID,\n+\t.direction               = TF_DIR_RX\n+\t},\n+\t[1] = {\n+\t.resource_func           = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,\n+\t.resource_type           = TF_IDENT_TYPE_PROF_FUNC,\n+\t.glb_regfile_index       = BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID,\n+\t.direction               = TF_DIR_TX\n+\t}\n+};\n+\n struct bnxt_ulp_rte_hdr_info ulp_hdr_info[] = {\n \t[RTE_FLOW_ITEM_TYPE_END] = {\n \t\t.hdr_type                = BNXT_ULP_HDR_TYPE_END,\n@@ -846,10 +851,10 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {\n \t.mask_opcode = BNXT_ULP_MASK_OPC_SET_TO_CONSTANT,\n \t.mask_operand = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n \t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n-\t.spec_opcode = BNXT_ULP_SPEC_OPC_SET_TO_DEF_REGFILE,\n+\t.spec_opcode = BNXT_ULP_SPEC_OPC_SET_TO_GLB_REGFILE,\n \t.spec_operand = {\n-\t\t(BNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID >> 8) & 0xff,\n-\t\tBNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID & 0xff,\n+\t\t(BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID >> 8) & 0xff,\n+\t\tBNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID & 0xff,\n \t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n \t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\n \t},\n@@ -1208,10 +1213,10 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {\n \t.mask_opcode = BNXT_ULP_MASK_OPC_SET_TO_CONSTANT,\n \t.mask_operand = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n \t\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},\n-\t.spec_opcode = BNXT_ULP_SPEC_OPC_SET_TO_DEF_REGFILE,\n+\t.spec_opcode = BNXT_ULP_SPEC_OPC_SET_TO_GLB_REGFILE,\n \t.spec_operand = {\n-\t\t(BNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID >> 8) & 0xff,\n-\t\tBNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID & 0xff,\n+\t\t(BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID >> 8) & 0xff,\n+\t\tBNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID & 0xff,\n \t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n \t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\n \t},\n@@ -1385,10 +1390,10 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {\n \t},\n \t{\n \t.field_bit_size = 7,\n-\t.result_opcode = BNXT_ULP_RESULT_OPC_SET_TO_DEF_REGFILE,\n+\t.result_opcode = BNXT_ULP_RESULT_OPC_SET_TO_GLB_REGFILE,\n \t.result_operand = {\n-\t\t(BNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID >> 8) & 0xff,\n-\t\tBNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID & 0xff,\n+\t\t(BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID >> 8) & 0xff,\n+\t\tBNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID & 0xff,\n \t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n \t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\n \t},\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.h b/drivers/net/bnxt/tf_ulp/ulp_template_db.h\nindex d087404..1bec4b6 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_db.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.h\n@@ -26,7 +26,7 @@\n #define BNXT_ULP_ACT_HID_SHFTL 23\n #define BNXT_ULP_ACT_HID_MASK 255\n #define BNXT_ULP_CACHE_TBL_IDENT_MAX_NUM 2\n-#define BNXT_ULP_DEF_IDENT_INFO_TBL_MAX_SZ 1\n+#define BNXT_ULP_GLB_RESOURCE_INFO_TBL_MAX_SZ 2\n \n enum bnxt_ulp_action_bit {\n \tBNXT_ULP_ACTION_BIT_MARK             = 0x0000000000000001,\n@@ -129,11 +129,6 @@ enum bnxt_ulp_cf_idx {\n \tBNXT_ULP_CF_IDX_LAST = 29\n };\n \n-enum bnxt_ulp_def_regfile_index {\n-\tBNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID = 0,\n-\tBNXT_ULP_DEF_REGFILE_INDEX_LAST = 1\n-};\n-\n enum bnxt_ulp_device_id {\n \tBNXT_ULP_DEVICE_ID_WH_PLUS = 0,\n \tBNXT_ULP_DEVICE_ID_THOR = 1,\n@@ -148,6 +143,11 @@ enum bnxt_ulp_direction {\n \tBNXT_ULP_DIRECTION_LAST = 2\n };\n \n+enum bnxt_ulp_glb_regfile_index {\n+\tBNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID = 0,\n+\tBNXT_ULP_GLB_REGFILE_INDEX_LAST = 1\n+};\n+\n enum bnxt_ulp_hdr_type {\n \tBNXT_ULP_HDR_TYPE_NOT_SUPPORTED = 0,\n \tBNXT_ULP_HDR_TYPE_SUPPORTED = 1,\n@@ -165,7 +165,7 @@ enum bnxt_ulp_mask_opc {\n \tBNXT_ULP_MASK_OPC_SET_TO_CONSTANT = 0,\n \tBNXT_ULP_MASK_OPC_SET_TO_HDR_FIELD = 1,\n \tBNXT_ULP_MASK_OPC_SET_TO_REGFILE = 2,\n-\tBNXT_ULP_MASK_OPC_SET_TO_DEF_REGFILE = 3,\n+\tBNXT_ULP_MASK_OPC_SET_TO_GLB_REGFILE = 3,\n \tBNXT_ULP_MASK_OPC_ADD_PAD = 4,\n \tBNXT_ULP_MASK_OPC_LAST = 5\n };\n@@ -227,7 +227,7 @@ enum bnxt_ulp_result_opc {\n \tBNXT_ULP_RESULT_OPC_SET_TO_ACT_PROP = 1,\n \tBNXT_ULP_RESULT_OPC_SET_TO_ENCAP_ACT_PROP_SZ = 2,\n \tBNXT_ULP_RESULT_OPC_SET_TO_REGFILE = 3,\n-\tBNXT_ULP_RESULT_OPC_SET_TO_DEF_REGFILE = 4,\n+\tBNXT_ULP_RESULT_OPC_SET_TO_GLB_REGFILE = 4,\n \tBNXT_ULP_RESULT_OPC_SET_TO_COMP_FIELD = 5,\n \tBNXT_ULP_RESULT_OPC_LAST = 6\n };\n@@ -243,7 +243,7 @@ enum bnxt_ulp_spec_opc {\n \tBNXT_ULP_SPEC_OPC_SET_TO_HDR_FIELD = 1,\n \tBNXT_ULP_SPEC_OPC_SET_TO_COMP_FIELD = 2,\n \tBNXT_ULP_SPEC_OPC_SET_TO_REGFILE = 3,\n-\tBNXT_ULP_SPEC_OPC_SET_TO_DEF_REGFILE = 4,\n+\tBNXT_ULP_SPEC_OPC_SET_TO_GLB_REGFILE = 4,\n \tBNXT_ULP_SPEC_OPC_ADD_PAD = 5,\n \tBNXT_ULP_SPEC_OPC_LAST = 6\n };\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\nindex 22a2173..3cbed24 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\n@@ -224,10 +224,11 @@ struct bnxt_ulp_mapper_ident_info {\n \tenum bnxt_ulp_regfile_index\tregfile_wr_idx;\n };\n \n-struct bnxt_ulp_def_ident_info {\n-\tenum tf_dir direction;\n-\tenum tf_identifier_type ident_type;\n-\tenum bnxt_ulp_def_regfile_index def_regfile_index;\n+struct bnxt_ulp_glb_resource_info {\n+\tenum bnxt_ulp_resource_func\tresource_func;\n+\tuint32_t\t\t\tresource_type; /* TF_ enum type */\n+\tenum bnxt_ulp_glb_regfile_index\tglb_regfile_index;\n+\tenum tf_dir\t\t\tdirection;\n };\n \n struct bnxt_ulp_cache_tbl_params {\n@@ -298,10 +299,10 @@ extern struct bnxt_ulp_mapper_ident_info\tulp_ident_list[];\n extern uint32_t ulp_act_prop_map_table[];\n \n /*\n- * The ulp_def_ident_tbl provides the list of default identifiers that need to\n+ * The ulp_glb_resource_tbl provides the list of global resources that need to\n  * be initialized and where to store them.\n  */\n-extern struct bnxt_ulp_def_ident_info ulp_def_ident_tbl[];\n+extern struct bnxt_ulp_glb_resource_info ulp_glb_resource_tbl[];\n \n /*\n  * The ulp_cache_tbl_parms table provides the sizes of the cache tables the\n",
    "prefixes": [
        "10/36"
    ]
}