get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74674,
    "url": "https://patches.dpdk.org/api/patches/74674/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200723115639.22357-14-somnath.kotur@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": "<20200723115639.22357-14-somnath.kotur@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200723115639.22357-14-somnath.kotur@broadcom.com",
    "date": "2020-07-23T11:56:32",
    "name": "[v2,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/?format=api",
        "name": "Somnath Kotur",
        "email": "somnath.kotur@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/20200723115639.22357-14-somnath.kotur@broadcom.com/mbox/",
    "series": [
        {
            "id": 11254,
            "url": "https://patches.dpdk.org/api/series/11254/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11254",
            "date": "2020-07-23T11:56:19",
            "name": "bnxt patches",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/11254/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74674/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74674/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 78A07A0521;\n\tThu, 23 Jul 2020 14:04:32 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3354A1C0C3;\n\tThu, 23 Jul 2020 14:02:37 +0200 (CEST)",
            "from relay.smtp.broadcom.com (unknown [192.19.211.62])\n by dpdk.org (Postfix) with ESMTP id D62721BFDB\n for <dev@dpdk.org>; Thu, 23 Jul 2020 14:02:05 +0200 (CEST)",
            "from dhcp-10-123-153-55.dhcp.broadcom.net\n (bgccx-dev-host-lnx35.bec.broadcom.net [10.123.153.55])\n by relay.smtp.broadcom.com (Postfix) with ESMTP id 6D21A29ADB5;\n Thu, 23 Jul 2020 05:02:05 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 6D21A29ADB5",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1595505725;\n bh=O19ukcb68t1huzXDJ0dKW9fwKuu4cdZvRRjlER5xB4Q=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=h82dR7AKY6pG405BtCA7Q3DUNIjG3h/15t5k5yGI/UZatrnCxz33/TS+lmdXxNXwu\n uRQLEpLNslr9CefsP8y91IRWxKtgsuVJqy29X8hIXElIMqp3hBdabJ/cw+JNKVAh6D\n SG4SZzyxI9xoeoQrcMHb+bqKhJYTYsi1eKs63n+Y=",
        "From": "Somnath Kotur <somnath.kotur@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com",
        "Date": "Thu, 23 Jul 2020 17:26:32 +0530",
        "Message-Id": "<20200723115639.22357-14-somnath.kotur@broadcom.com>",
        "X-Mailer": "git-send-email 2.10.1.613.g2cc2e70",
        "In-Reply-To": "<20200723115639.22357-1-somnath.kotur@broadcom.com>",
        "References": "<20200723111329.21855-1-somnath.kotur@broadcom.com>\n <20200723115639.22357-1-somnath.kotur@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH v2 13/20] net/bnxt: ulp mapper changes to use tbl\n\tsearch",
        "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: 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": [
        "v2",
        "13/20"
    ]
}