get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 93592,
    "url": "http://patches.dpdk.org/api/patches/93592/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210530085929.29695-52-venkatkumar.duvvuru@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": "<20210530085929.29695-52-venkatkumar.duvvuru@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210530085929.29695-52-venkatkumar.duvvuru@broadcom.com",
    "date": "2021-05-30T08:59:22",
    "name": "[51/58] net/bnxt: process resource lists before session open",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "efa1376f599e96ef30f038f3421000385c3f4ce4",
    "submitter": {
        "id": 1635,
        "url": "http://patches.dpdk.org/api/people/1635/?format=api",
        "name": "Venkat Duvvuru",
        "email": "venkatkumar.duvvuru@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/20210530085929.29695-52-venkatkumar.duvvuru@broadcom.com/mbox/",
    "series": [
        {
            "id": 17161,
            "url": "http://patches.dpdk.org/api/series/17161/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=17161",
            "date": "2021-05-30T08:58:31",
            "name": "enhancements to host based flow table management",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/17161/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/93592/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/93592/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 A59A0A0524;\n\tSun, 30 May 2021 11:07:11 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B5FCB411E0;\n\tSun, 30 May 2021 11:02:03 +0200 (CEST)",
            "from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com\n [192.19.11.229]) by mails.dpdk.org (Postfix) with ESMTP id 6FB9E4003E\n for <dev@dpdk.org>; Sun, 30 May 2021 11:02:00 +0200 (CEST)",
            "from S60.dhcp.broadcom.net (unknown [10.123.66.170])\n (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n (No client certificate requested)\n by relay.smtp-ext.broadcom.com (Postfix) with ESMTPS id 0E2487DAF;\n Sun, 30 May 2021 02:01:58 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 0E2487DAF",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1622365320;\n bh=zDeUOKj0KVcibhs3dxPo1LWVwspCTnCxVezbVQqC2lA=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=YYvTRPmz33TC9kFzkwsl7hRUsAz9eaWsm4qDU6cY/BKG3ikmpJrQ596xVnZeKVLRq\n Lvdg57l6Akkr2TTJV/ywmTQwZ5xcoKpbM2JC1tc/ZJgGBuXDomxQxedzwHaQ62zdKk\n OtfKSxZOKMCgSm7ozzEK/SkmThl6pX610i+BgKnk=",
        "From": "Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "Mike Baucom <michael.baucom@broadcom.com>,\n Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>",
        "Date": "Sun, 30 May 2021 14:29:22 +0530",
        "Message-Id": "<20210530085929.29695-52-venkatkumar.duvvuru@broadcom.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20210530085929.29695-1-venkatkumar.duvvuru@broadcom.com>",
        "References": "<20210530085929.29695-1-venkatkumar.duvvuru@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH 51/58] net/bnxt: process resource lists before\n session open",
        "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: Mike Baucom <michael.baucom@broadcom.com>\n\nShared sessions require both named and unnamed resources to be requested\nduring a tf_open_session. ULP uses named resources for global resources\nthat are pre-allocated and remain through the life of the application.\nUnnamed resources are generally per flow resources and allocated on\ndemand. The sum of both named and unnamed resources must be requested\nwhen initializing the session.  The ulp_init now processes both lists\nprior to calling tf_open_session for both shared and regular sessions.\n\nSigned-off-by: Mike Baucom <michael.baucom@broadcom.com>\nSigned-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>\nReviewed-by: Randy Schacher <stuart.schacher@broadcom.com>\nReviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/bnxt_ulp.c            | 177 ++++++++++++------\n drivers/net/bnxt/tf_ulp/ulp_def_rules.c       |   4 +-\n drivers/net/bnxt/tf_ulp/ulp_mapper.c          |  37 ++--\n .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |   1 +\n drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |  36 ++++\n drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   6 +\n 6 files changed, 183 insertions(+), 78 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\nindex 632334674c..98b86f2c52 100644\n--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\n+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\n@@ -77,6 +77,15 @@ bnxt_ulp_app_cap_list_get(uint32_t *num_entries)\n \treturn ulp_app_cap_info_list;\n }\n \n+static struct bnxt_ulp_resource_resv_info *\n+bnxt_ulp_app_resource_resv_list_get(uint32_t *num_entries)\n+{\n+\tif (num_entries == NULL)\n+\t\treturn NULL;\n+\t*num_entries = BNXT_ULP_APP_RESOURCE_RESV_LIST_MAX_SZ;\n+\treturn ulp_app_resource_resv_list;\n+}\n+\n struct bnxt_ulp_resource_resv_info *\n bnxt_ulp_resource_resv_list_get(uint32_t *num_entries)\n {\n@@ -96,23 +105,18 @@ bnxt_ulp_app_glb_resource_info_list_get(uint32_t *num_entries)\n }\n \n static int32_t\n-bnxt_ulp_tf_resources_get(struct bnxt_ulp_context *ulp_ctx,\n-\t\t\t  struct tf_session_resources *res)\n+bnxt_ulp_named_resources_calc(struct bnxt_ulp_context *ulp_ctx,\n+\t\t\t      struct bnxt_ulp_glb_resource_info *info,\n+\t\t\t      uint32_t num,\n+\t\t\t      struct tf_session_resources *res)\n {\n-\tstruct bnxt_ulp_resource_resv_info *info = NULL;\n-\tuint32_t dev_id, res_type, i, num;\n+\tuint32_t dev_id, res_type, i;\n \tenum tf_dir dir;\n \tuint8_t app_id;\n \tint32_t rc = 0;\n \n-\tif (!ulp_ctx || !res) {\n-\t\tBNXT_TF_DBG(ERR, \"Invalid arguments to get resources.\\n\");\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tinfo = bnxt_ulp_resource_resv_list_get(&num);\n-\tif (!info) {\n-\t\tBNXT_TF_DBG(ERR, \"Unable to get resource reservation list.\\n\");\n+\tif (ulp_ctx == NULL || info == NULL || res == NULL || num == 0) {\n+\t\tBNXT_TF_DBG(ERR, \"Invalid parms to named resources calc.\\n\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -124,31 +128,33 @@ bnxt_ulp_tf_resources_get(struct bnxt_ulp_context *ulp_ctx,\n \n \trc = bnxt_ulp_cntxt_dev_id_get(ulp_ctx, &dev_id);\n \tif (rc) {\n-\t\tBNXT_TF_DBG(ERR, \"Unable to get the device id from ulp.\\n\");\n+\t\tBNXT_TF_DBG(ERR, \"Unable to get the dev id from ulp.\\n\");\n \t\treturn -EINVAL;\n \t}\n \n \tfor (i = 0; i < num; i++) {\n-\t\tif (app_id != info[i].app_id || dev_id != info[i].device_id)\n+\t\tif (dev_id != info[i].device_id || app_id != info[i].app_id)\n \t\t\tcontinue;\n \t\tdir = info[i].direction;\n \t\tres_type = info[i].resource_type;\n \n \t\tswitch (info[i].resource_func) {\n \t\tcase BNXT_ULP_RESOURCE_FUNC_IDENTIFIER:\n-\t\t\tres->ident_cnt[dir].cnt[res_type] = info[i].count;\n+\t\t\tres->ident_cnt[dir].cnt[res_type]++;\n \t\t\tbreak;\n \t\tcase BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE:\n-\t\t\tres->tbl_cnt[dir].cnt[res_type] = info[i].count;\n+\t\t\tres->tbl_cnt[dir].cnt[res_type]++;\n \t\t\tbreak;\n \t\tcase BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE:\n-\t\t\tres->tcam_cnt[dir].cnt[res_type] = info[i].count;\n+\t\t\tres->tcam_cnt[dir].cnt[res_type]++;\n \t\t\tbreak;\n \t\tcase BNXT_ULP_RESOURCE_FUNC_EM_TABLE:\n-\t\t\tres->em_cnt[dir].cnt[res_type] = info[i].count;\n+\t\t\tres->em_cnt[dir].cnt[res_type]++;\n \t\t\tbreak;\n \t\tdefault:\n-\t\t\tbreak;\n+\t\t\tBNXT_TF_DBG(ERR, \"Unknown resource func (0x%x)\\n,\",\n+\t\t\t\t    info[i].resource_func);\n+\t\t\tcontinue;\n \t\t}\n \t}\n \n@@ -156,14 +162,20 @@ bnxt_ulp_tf_resources_get(struct bnxt_ulp_context *ulp_ctx,\n }\n \n static int32_t\n-bnxt_ulp_tf_shared_session_resources_get(struct bnxt_ulp_context *ulp_ctx,\n-\t\t\t\t\t struct tf_session_resources *res)\n+bnxt_ulp_unnamed_resources_calc(struct bnxt_ulp_context *ulp_ctx,\n+\t\t\t\tstruct bnxt_ulp_resource_resv_info *info,\n+\t\t\t\tuint32_t num,\n+\t\t\t\tstruct tf_session_resources *res)\n {\n-\tstruct bnxt_ulp_glb_resource_info *info;\n-\tuint32_t dev_id, res_type, i, num;\n+\tuint32_t dev_id, res_type, i;\n \tenum tf_dir dir;\n \tuint8_t app_id;\n-\tint32_t rc;\n+\tint32_t rc = 0;\n+\n+\tif (ulp_ctx == NULL || res == NULL || info == NULL || num == 0) {\n+\t\tBNXT_TF_DBG(ERR, \"Invalid arguments to get resources.\\n\");\n+\t\treturn -EINVAL;\n+\t}\n \n \trc = bnxt_ulp_cntxt_app_id_get(ulp_ctx, &app_id);\n \tif (rc) {\n@@ -173,48 +185,108 @@ bnxt_ulp_tf_shared_session_resources_get(struct bnxt_ulp_context *ulp_ctx,\n \n \trc = bnxt_ulp_cntxt_dev_id_get(ulp_ctx, &dev_id);\n \tif (rc) {\n-\t\tBNXT_TF_DBG(ERR, \"Unable to get device id from ulp.\\n\");\n+\t\tBNXT_TF_DBG(ERR, \"Unable to get the dev id from ulp.\\n\");\n \t\treturn -EINVAL;\n \t}\n \n-\t/* Make sure the resources are zero before accumulating. */\n-\tmemset(res, 0, sizeof(struct tf_session_resources));\n-\n-\t/* Get the list and tally the resources. */\n-\tinfo = bnxt_ulp_app_glb_resource_info_list_get(&num);\n-\tif (!info) {\n-\t\tBNXT_TF_DBG(ERR, \"Unable to get app global resource list\\n\");\n-\t\treturn -EINVAL;\n-\t}\n \tfor (i = 0; i < num; i++) {\n-\t\tif (dev_id != info[i].device_id || app_id != info[i].app_id)\n+\t\tif (app_id != info[i].app_id || dev_id != info[i].device_id)\n \t\t\tcontinue;\n \t\tdir = info[i].direction;\n \t\tres_type = info[i].resource_type;\n \n \t\tswitch (info[i].resource_func) {\n \t\tcase BNXT_ULP_RESOURCE_FUNC_IDENTIFIER:\n-\t\t\tres->ident_cnt[dir].cnt[res_type]++;\n+\t\t\tres->ident_cnt[dir].cnt[res_type] = info[i].count;\n \t\t\tbreak;\n \t\tcase BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE:\n-\t\t\tres->tbl_cnt[dir].cnt[res_type]++;\n+\t\t\tres->tbl_cnt[dir].cnt[res_type] = info[i].count;\n \t\t\tbreak;\n \t\tcase BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE:\n-\t\t\tres->tcam_cnt[dir].cnt[res_type]++;\n+\t\t\tres->tcam_cnt[dir].cnt[res_type] = info[i].count;\n \t\t\tbreak;\n \t\tcase BNXT_ULP_RESOURCE_FUNC_EM_TABLE:\n-\t\t\tres->em_cnt[dir].cnt[res_type]++;\n+\t\t\tres->em_cnt[dir].cnt[res_type] = info[i].count;\n \t\t\tbreak;\n \t\tdefault:\n-\t\t\tBNXT_TF_DBG(ERR, \"Unknown resource func (0x%x)\\n,\",\n-\t\t\t\t    info[i].resource_func);\n-\t\t\tcontinue;\n+\t\t\tbreak;\n \t\t}\n \t}\n-\n \treturn 0;\n }\n \n+static int32_t\n+bnxt_ulp_tf_resources_get(struct bnxt_ulp_context *ulp_ctx,\n+\t\t\t  struct tf_session_resources *res)\n+{\n+\tstruct bnxt_ulp_resource_resv_info *unnamed = NULL;\n+\tuint32_t unum;\n+\tint32_t rc = 0;\n+\n+\tif (ulp_ctx == NULL || res == NULL) {\n+\t\tBNXT_TF_DBG(ERR, \"Invalid arguments to get resources.\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tunnamed = bnxt_ulp_resource_resv_list_get(&unum);\n+\tif (unnamed == NULL) {\n+\t\tBNXT_TF_DBG(ERR, \"Unable to get resource resv list.\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\trc = bnxt_ulp_unnamed_resources_calc(ulp_ctx, unnamed, unum, res);\n+\tif (rc)\n+\t\tBNXT_TF_DBG(ERR, \"Unable to calc resources for session.\\n\");\n+\n+\treturn rc;\n+}\n+\n+static int32_t\n+bnxt_ulp_tf_shared_session_resources_get(struct bnxt_ulp_context *ulp_ctx,\n+\t\t\t\t\t struct tf_session_resources *res)\n+{\n+\tstruct bnxt_ulp_resource_resv_info *unnamed;\n+\tstruct bnxt_ulp_glb_resource_info *named;\n+\tuint32_t unum, nnum;\n+\tint32_t rc;\n+\n+\tif (ulp_ctx == NULL || res == NULL) {\n+\t\tBNXT_TF_DBG(ERR, \"Invalid arguments to get resources.\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Make sure the resources are zero before accumulating. */\n+\tmemset(res, 0, sizeof(struct tf_session_resources));\n+\n+\t/*\n+\t * Shared resources are comprised of both named and unnamed resources.\n+\t * First get the unnamed counts, and then add the named to the result.\n+\t */\n+\t/* Get the baseline counts */\n+\tunnamed = bnxt_ulp_app_resource_resv_list_get(&unum);\n+\tif (unnamed == NULL) {\n+\t\tBNXT_TF_DBG(ERR, \"Unable to get shared resource resv list.\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\trc = bnxt_ulp_unnamed_resources_calc(ulp_ctx, unnamed, unum, res);\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"Unable to calc resources for shared session.\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Get the named list and add the totals */\n+\tnamed = bnxt_ulp_app_glb_resource_info_list_get(&nnum);\n+\tif (named == NULL) {\n+\t\tBNXT_TF_DBG(ERR, \"Unable to get app global resource list\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\trc = bnxt_ulp_named_resources_calc(ulp_ctx, named, nnum, res);\n+\tif (rc)\n+\t\tBNXT_TF_DBG(ERR, \"Unable to calc named resources\\n\");\n+\n+\treturn rc;\n+}\n+\n int32_t\n bnxt_ulp_cntxt_app_caps_init(struct bnxt_ulp_context *ulp_ctx,\n \t\t\t     uint8_t app_id, uint32_t dev_id)\n@@ -320,10 +392,8 @@ ulp_ctx_shared_session_open(struct bnxt *bp,\n \tstrncat(parms.ctrl_chan_name, \"-tf_shared\", copy_num_bytes);\n \n \trc = bnxt_ulp_tf_shared_session_resources_get(bp->ulp_ctx, resources);\n-\tif (rc) {\n-\t\tBNXT_TF_DBG(ERR, \"Unable to get shared resource count.\\n\");\n+\tif (rc)\n \t\treturn rc;\n-\t}\n \n \trc = bnxt_ulp_cntxt_dev_id_get(bp->ulp_ctx, &ulp_dev_id);\n \tif (rc) {\n@@ -342,8 +412,7 @@ ulp_ctx_shared_session_open(struct bnxt *bp,\n \t\tparms.device_type = TF_DEVICE_TYPE_THOR;\n \t\tbreak;\n \tdefault:\n-\t\tBNXT_TF_DBG(ERR, \"Unable to determine device for \"\n-\t\t\t    \"opening session.\\n\");\n+\t\tBNXT_TF_DBG(ERR, \"Unable to determine dev for opening session.\\n\");\n \t\treturn rc;\n \t}\n \n@@ -450,18 +519,14 @@ ulp_ctx_session_open(struct bnxt *bp,\n \t\tparams.device_type = TF_DEVICE_TYPE_THOR;\n \t\tbreak;\n \tdefault:\n-\t\tBNXT_TF_DBG(ERR, \"Unable to determine device for \"\n-\t\t\t    \"opening session.\\n\");\n+\t\tBNXT_TF_DBG(ERR, \"Unable to determine device for opening session.\\n\");\n \t\treturn rc;\n \t}\n \n \tresources = &params.resources;\n \trc = bnxt_ulp_tf_resources_get(bp->ulp_ctx, resources);\n-\tif (rc) {\n-\t\tBNXT_TF_DBG(ERR, \"Unable to determine tf resources for \"\n-\t\t\t    \"session open.\\n\");\n+\tif (rc)\n \t\treturn rc;\n-\t}\n \n \tparams.bp = bp;\n \trc = tf_open_session(&bp->tfp, &params);\n@@ -708,8 +773,8 @@ ulp_ctx_init(struct bnxt *bp,\n \n \trc = bnxt_ulp_cntxt_app_caps_init(bp->ulp_ctx, bp->app_id, devid);\n \tif (rc) {\n-\t\tBNXT_TF_DBG(ERR, \"Unable to set capabilities for \"\n-\t\t\t    \" app(%x)/dev(%x)\\n\", bp->app_id, devid);\n+\t\tBNXT_TF_DBG(ERR, \"Unable to set caps for app(%x)/dev(%x)\\n\",\n+\t\t\t    bp->app_id, devid);\n \t\tgoto error_deinit;\n \t}\n \ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c\nindex b688288a62..483030edbf 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c\n@@ -321,8 +321,8 @@ ulp_default_flow_create(struct rte_eth_dev *eth_dev,\n \n \tulp_ctx = bnxt_ulp_eth_dev_ptr2_cntxt_get(eth_dev);\n \tif (!ulp_ctx) {\n-\t\tBNXT_TF_DBG(ERR, \"ULP context is not initialized. \"\n-\t\t\t\t \"Failed to create default flow.\\n\");\n+\t\tBNXT_TF_DBG(ERR,\n+\t\t\t    \"ULP context is not initialized. Failed to create dflt flow.\\n\");\n \t\treturn -EINVAL;\n \t}\n \ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\nindex 8fd8a329bf..b5cefbeb08 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n@@ -2296,8 +2296,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t\t\t\t\t\t tbl->tbl_operand,\n \t\t\t\t\t\t &regval, &shared)) {\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    \"Failed to get tbl idx from Glb RF[%d].\\n\",\n \t\t\t\t    tbl->tbl_operand);\n \t\t\treturn -EINVAL;\n \t\t}\n@@ -2347,8 +2346,9 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\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\tBNXT_TF_DBG(ERR,\n+\t\t\t\t    \"Failed to get flds on tbl read rc=%d\\n\",\n+\t\t\t\t    rc);\n \t\t\treturn rc;\n \t\t}\n \t\treturn 0;\n@@ -2433,8 +2433,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t\trc = tf_set_tbl_entry(tfp, &sparms);\n \t\tif (rc) {\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    \"Index table[%s][%s][%x] write fail 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@@ -2833,15 +2832,15 @@ ulp_mapper_glb_resource_info_init(struct bnxt_ulp_context *ulp_ctx,\n \n \trc = bnxt_ulp_cntxt_dev_id_get(ulp_ctx, &dev_id);\n \tif (rc) {\n-\t\tBNXT_TF_DBG(ERR, \"Failed to get device id for \"\n-\t\t\t    \"global init (%d)\\n\", rc);\n+\t\tBNXT_TF_DBG(ERR, \"Failed to get device id for glb init (%d)\\n\",\n+\t\t\t    rc);\n \t\treturn rc;\n \t}\n \n \trc = bnxt_ulp_cntxt_app_id_get(ulp_ctx, &app_id);\n \tif (rc) {\n-\t\tBNXT_TF_DBG(ERR, \"Failed to get app id for \"\n-\t\t\t    \"global init (%d)\\n\", rc);\n+\t\tBNXT_TF_DBG(ERR, \"Failed to get app id for glb init (%d)\\n\",\n+\t\t\t    rc);\n \t\treturn rc;\n \t}\n \n@@ -2916,15 +2915,15 @@ ulp_mapper_app_glb_resource_info_init(struct bnxt_ulp_context *ulp_ctx,\n \n \trc = bnxt_ulp_cntxt_app_id_get(ulp_ctx, &app_id);\n \tif (rc) {\n-\t\tBNXT_TF_DBG(ERR, \"Failed to get the app id in global init \"\n-\t\t\t    \"(%d).\\n\", rc);\n+\t\tBNXT_TF_DBG(ERR, \"Failed to get the app id in glb init (%d).\\n\",\n+\t\t\t    rc);\n \t\treturn rc;\n \t}\n \n \trc = bnxt_ulp_cntxt_dev_id_get(ulp_ctx, &dev_id);\n \tif (rc) {\n-\t\tBNXT_TF_DBG(ERR, \"Failed to get device id for app \"\n-\t\t\t    \"global init (%d)\\n\", rc);\n+\t\tBNXT_TF_DBG(ERR, \"Failed to get dev id for app glb init (%d)\\n\",\n+\t\t\t    rc);\n \t\treturn rc;\n \t}\n \n@@ -3413,8 +3412,8 @@ ulp_mapper_tbls_process(struct bnxt_ulp_mapper_parms *parms, uint32_t tid)\n \t\t\t\t\t\t      cond_tbls, num_cond_tbls,\n \t\t\t\t\t\t      &cond_rc);\n \t\tif (rc) {\n-\t\t\tBNXT_TF_DBG(ERR, \"Failed to process cond opc list \"\n-\t\t\t\t   \"(%d)\\n\", rc);\n+\t\t\tBNXT_TF_DBG(ERR, \"Failed to proc cond opc list (%d)\\n\",\n+\t\t\t\t    rc);\n \t\t\tgoto error;\n \t\t}\n \t\t/* Skip the table if False */\n@@ -3812,8 +3811,7 @@ ulp_mapper_init(struct bnxt_ulp_context *ulp_ctx)\n \tif (bnxt_ulp_cntxt_shared_session_enabled(ulp_ctx)) {\n \t\trc = ulp_mapper_app_glb_resource_info_init(ulp_ctx, data);\n \t\tif (rc) {\n-\t\t\tBNXT_TF_DBG(ERR, \"Failed to initialize app \"\n-\t\t\t\t    \"global resources\\n\");\n+\t\t\tBNXT_TF_DBG(ERR, \"Failed to init app glb resources\\n\");\n \t\t\tgoto error;\n \t\t}\n \t}\n@@ -3840,8 +3838,7 @@ ulp_mapper_deinit(struct bnxt_ulp_context *ulp_ctx)\n \n \tif (!ulp_ctx) {\n \t\tBNXT_TF_DBG(ERR,\n-\t\t\t    \"Failed to acquire ulp context, so data may \"\n-\t\t\t    \"not be released.\\n\");\n+\t\t\t    \"Failed to acquire ulp context, so data may not be released.\\n\");\n \t\treturn;\n \t}\n \ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h\nindex 4a2f7337be..bc701aa8a5 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@@ -29,6 +29,7 @@\n #define BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ 33\n #define BNXT_ULP_APP_GLB_RESOURCE_TBL_MAX_SZ 27\n #define BNXT_ULP_RESOURCE_RESV_LIST_MAX_SZ 219\n+#define BNXT_ULP_APP_RESOURCE_RESV_LIST_MAX_SZ 4\n #define BNXT_ULP_APP_CAP_TBL_MAX_SZ 6\n #define BNXT_ULP_COND_GOTO_REJECT 1023\n #define BNXT_ULP_COND_GOTO_RF 0x10000\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c b/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c\nindex f3146cc1a3..ffa42ffa8b 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c\n@@ -270,6 +270,42 @@ struct bnxt_ulp_app_capabilities_info ulp_app_cap_info_list[] = {\n \t}\n };\n \n+/* List of unnamed app tf resources required to be reserved per app/device */\n+struct bnxt_ulp_resource_resv_info ulp_app_resource_resv_list[] = {\n+\t{\n+\t.app_id                  = 1,\n+\t.device_id               = BNXT_ULP_DEVICE_ID_WH_PLUS,\n+\t.direction               = TF_DIR_RX,\n+\t.resource_func           = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,\n+\t.resource_type           = TF_TCAM_TBL_TYPE_WC_TCAM,\n+\t.count                   = 256\n+\t},\n+\t{\n+\t.app_id                  = 1,\n+\t.device_id               = BNXT_ULP_DEVICE_ID_THOR,\n+\t.direction               = TF_DIR_RX,\n+\t.resource_func           = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,\n+\t.resource_type           = TF_TCAM_TBL_TYPE_WC_TCAM,\n+\t.count                   = 256\n+\t},\n+\t{\n+\t.app_id                  = 2,\n+\t.device_id               = BNXT_ULP_DEVICE_ID_WH_PLUS,\n+\t.direction               = TF_DIR_RX,\n+\t.resource_func           = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,\n+\t.resource_type           = TF_TCAM_TBL_TYPE_WC_TCAM,\n+\t.count                   = 256\n+\t},\n+\t{\n+\t.app_id                  = 2,\n+\t.device_id               = BNXT_ULP_DEVICE_ID_THOR,\n+\t.direction               = TF_DIR_RX,\n+\t.resource_func           = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,\n+\t.resource_type           = TF_TCAM_TBL_TYPE_WC_TCAM,\n+\t.count                   = 256\n+\t}\n+};\n+\n /* List of device specific parameters */\n struct bnxt_ulp_glb_resource_info ulp_app_glb_resource_tbl[]  = {\n \t{\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\nindex 09bd179781..72d0df98a8 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\n@@ -391,6 +391,12 @@ extern struct bnxt_ulp_glb_resource_info ulp_app_glb_resource_tbl[];\n  */\n extern struct bnxt_ulp_resource_resv_info ulp_resource_resv_list[];\n \n+/*\n+ * The ulp_app_resource_resv_list provides the list of tf resources required\n+ * when calling tf_open.\n+ */\n+extern struct bnxt_ulp_resource_resv_info ulp_app_resource_resv_list[];\n+\n /*\n  * The_app_cap_info_list provides the list of ULP capabilities per app/device.\n  */\n",
    "prefixes": [
        "51/58"
    ]
}