Show a patch.

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

{
    "id": 74654,
    "url": "https://patches.dpdk.org/api/patches/74654/",
    "web_url": "https://patches.dpdk.org/patch/74654/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk"
    },
    "msgid": "<20200723111329.21855-14-somnath.kotur@broadcom.com>",
    "date": "2020-07-23T11:13:22",
    "name": "[13/20] net/bnxt: ulp mapper changes to use tbl search",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4a41ca75ac42a33c2c0e847407adac086d8e8cec",
    "submitter": {
        "id": 908,
        "url": "https://patches.dpdk.org/api/people/908/",
        "name": "Somnath Kotur",
        "email": "somnath.kotur@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "https://patches.dpdk.org/api/users/1766/",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "https://patches.dpdk.org/patch/74654/mbox/",
    "series": [
        {
            "id": 11252,
            "url": "https://patches.dpdk.org/api/series/11252/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11252",
            "date": "2020-07-23T11:13:09",
            "name": "bnxt patches",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/11252/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74654/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74654/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "References": "<20200723111329.21855-1-somnath.kotur@broadcom.com>",
        "X-BeenThere": "dev@dpdk.org",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com CDB721BD951",
        "Subject": "[dpdk-dev] [PATCH 13/20] net/bnxt: ulp mapper changes to use tbl\n\tsearch",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 7CDCCA0521;\n\tThu, 23 Jul 2020 13:21:36 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id ED64B1C0BE;\n\tThu, 23 Jul 2020 13:20:06 +0200 (CEST)",
            "from relay.smtp.broadcom.com (unknown [192.19.232.149])\n by dpdk.org (Postfix) with ESMTP id 7ACB11BFFD\n for <dev@dpdk.org>; Thu, 23 Jul 2020 13:19:11 +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 CDB721BD951;\n Thu, 23 Jul 2020 04:19:10 -0700 (PDT)"
        ],
        "To": "dev@dpdk.org",
        "X-Mailer": "git-send-email 2.10.1.613.g2cc2e70",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1595503151;\n bh=O19ukcb68t1huzXDJ0dKW9fwKuu4cdZvRRjlER5xB4Q=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=LZWUPsc5Oau/Uo7unrTWgeok8vv/85SNwI6diky04NzDRRjnEZtOURwPD1m9nvIFV\n QuEIbUVopCxZwmHVnmJp3XhzPM5rDWeRc+tlHhTCsCyzwuFLwub4DCNxPMQWQdqIzH\n 4x9RcSW3rslrFmtVU9xJaZtKe1/hUVKhT1x+fWiM=",
        "Date": "Thu, 23 Jul 2020 16:43:22 +0530",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "From": "Somnath Kotur <somnath.kotur@broadcom.com>",
        "In-Reply-To": "<20200723111329.21855-1-somnath.kotur@broadcom.com>",
        "Cc": "ferruh.yigit@intel.com",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200723111329.21855-14-somnath.kotur@broadcom.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "From: Mike Baucom <michael.baucom@broadcom.com>\n\nmodified ulp mappper to use the new tf_search_tbl_entry API.\nWhen search before allocation is requested, mapper calls\ntc_search_tbl_entry with the alloc flag.\n\n- On HIT, the result and table index is returned.\n- On MISS, the table index is returned but the result is\ncreated and the table entry is set.\n- On REJECT, the flow request is rejected.\n\nSigned-off-by: Mike Baucom <michael.baucom@broadcom.com>\nReviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/ulp_mapper.c | 75 ++++++++++++++++++++++++------------\n 1 file changed, 51 insertions(+), 24 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\nindex a071c07..4dee659 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n@@ -1764,9 +1764,10 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \tstruct ulp_blob\tdata;\n \tuint64_t idx = 0;\n \tuint16_t tmplen;\n-\tuint32_t i, num_flds;\n+\tuint32_t i, num_flds, index, hit;\n \tint32_t rc = 0, trc = 0;\n \tstruct tf_alloc_tbl_entry_parms\taparms = { 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 \tuint32_t tbl_scope_id;\n@@ -1868,33 +1869,59 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\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-\taparms.dir\t\t= tbl->direction;\n-\taparms.type\t\t= tbl->resource_type;\n-\taparms.search_enable\t= tbl->srch_b4_alloc;\n-\taparms.result\t\t= ulp_blob_data_get(&data, &tmplen);\n-\taparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);\n-\taparms.tbl_scope_id\t= tbl_scope_id;\n-\n-\t/* All failures after the alloc succeeds require a free */\n-\trc = tf_alloc_tbl_entry(tfp, &aparms);\n-\tif (rc) {\n-\t\tBNXT_TF_DBG(ERR, \"Alloc table[%d][%s] failed rc=%d\\n\",\n-\t\t\t    aparms.type,\n-\t\t\t    (aparms.dir == TF_DIR_RX) ? \"RX\" : \"TX\",\n-\t\t\t    rc);\n-\t\treturn rc;\n-\t}\n+\tif (tbl->srch_b4_alloc) {\n+\t\tmemset(&srchparms, 0, sizeof(srchparms));\n+\t\tsrchparms.dir = tbl->direction;\n+\t\tsrchparms.type = tbl->resource_type;\n+\t\tsrchparms.alloc\t= 1;\n+\t\tsrchparms.result = ulp_blob_data_get(&data, &tmplen);\n+\t\tsrchparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);\n+\t\tsrchparms.tbl_scope_id = tbl_scope_id;\n+\t\trc = tf_search_tbl_entry(tfp, &srchparms);\n+\t\tif (rc) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Alloc table[%s][%s] failed rc=%d\\n\",\n+\t\t\t\t    tf_tbl_type_2_str(tbl->resource_type),\n+\t\t\t\t    tf_dir_2_str(tbl->direction), rc);\n+\t\t\treturn rc;\n+\t\t}\n+\t\tif (srchparms.search_status == REJECT) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Alloc table[%s][%s] rejected.\\n\",\n+\t\t\t\t    tf_tbl_type_2_str(tbl->resource_type),\n+\t\t\t\t    tf_dir_2_str(tbl->direction));\n+\t\t\treturn -ENOMEM;\n+\t\t}\n+\t\tindex = srchparms.idx;\n+\t\thit = srchparms.hit;\n+\t} else {\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+\t\trc = tf_alloc_tbl_entry(tfp, &aparms);\n+\t\tif (rc) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Alloc table[%s][%s] failed rc=%d\\n\",\n+\t\t\t\t    tf_tbl_type_2_str(tbl->resource_type),\n+\t\t\t\t    tf_dir_2_str(tbl->direction), rc);\n+\t\t\treturn rc;\n+\t\t}\n+\t\tindex = aparms.idx;\n+\t}\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 (aparms.type == TF_TBL_TYPE_EXT)\n-\t\tidx = TF_ACT_REC_OFFSET_2_PTR(aparms.idx);\n+\tif (tbl->resource_type == TF_TBL_TYPE_EXT)\n+\t\tidx = TF_ACT_REC_OFFSET_2_PTR(index);\n \telse\n-\t\tidx = aparms.idx;\n+\t\tidx = index;\n \n \t/* Always storing values in Regfile in BE */\n \tidx = tfp_cpu_to_be_64(idx);\n@@ -1908,12 +1935,12 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t}\n \n \t/* Perform the tf table set by filling the set params */\n-\tif (!tbl->srch_b4_alloc || !aparms.hit) {\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 \t\tsparms.data_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);\n-\t\tsparms.idx\t\t= aparms.idx;\n+\t\tsparms.idx\t\t= index;\n \t\tsparms.tbl_scope_id\t= tbl_scope_id;\n \n \t\trc = tf_set_tbl_entry(tfp, &sparms);\n@@ -1933,7 +1960,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \tfid_parms.resource_func\t= tbl->resource_func;\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= aparms.idx;\n+\tfid_parms.resource_hndl\t= index;\n \tfid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;\n \n \trc = ulp_flow_db_resource_add(parms->ulp_ctx,\n@@ -1960,7 +1987,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t */\n \tfree_parms.dir\t= tbl->direction;\n \tfree_parms.type\t= tbl->resource_type;\n-\tfree_parms.idx\t= aparms.idx;\n+\tfree_parms.idx\t= index;\n \tfree_parms.tbl_scope_id = tbl_scope_id;\n \n \ttrc = tf_free_tbl_entry(tfp, &free_parms);\n",
    "prefixes": [
        "13/20"
    ]
}