get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 73868,
    "url": "http://patchwork.dpdk.org/api/patches/73868/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200713061600.19456-8-somnath.kotur@broadcom.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20200713061600.19456-8-somnath.kotur@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200713061600.19456-8-somnath.kotur@broadcom.com",
    "date": "2020-07-13T06:15:57",
    "name": "[07/10] net/bnxt: add support for identifier search and ref count",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "489442c06098ce4de864684934402bbb2b5ea95e",
    "submitter": {
        "id": 908,
        "url": "http://patchwork.dpdk.org/api/people/908/?format=api",
        "name": "Somnath Kotur",
        "email": "somnath.kotur@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "http://patchwork.dpdk.org/api/users/1766/?format=api",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200713061600.19456-8-somnath.kotur@broadcom.com/mbox/",
    "series": [
        {
            "id": 10976,
            "url": "http://patchwork.dpdk.org/api/series/10976/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=10976",
            "date": "2020-07-13T06:15:50",
            "name": "bnxt patches",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/10976/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/73868/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/73868/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 E55AEA0540;\n\tMon, 13 Jul 2020 08:22:30 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4F8BB1D166;\n\tMon, 13 Jul 2020 08:21:22 +0200 (CEST)",
            "from relay.smtp.broadcom.com (unknown [192.19.211.62])\n by dpdk.org (Postfix) with ESMTP id ACEAA1C0B5\n for <dev@dpdk.org>; Mon, 13 Jul 2020 08:21: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 E432229C66C;\n Sun, 12 Jul 2020 23:21:10 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com E432229C66C",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1594621271;\n bh=zkxZpTD6Y50uygV0mxjh2IQcIq7tXmeBPO4sdgwStnI=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=EzGCxMM69/BJ5kt21+bdh/H73mNO0+GVrkbqtJmLrbIf4+F8DohlltmqmPKx1wjMK\n D7c5/dmIGxcB8OdEs3j7qAy7iMxysp7QxCRNcNs0A5n7z3qsamALVafxmpJA6dY/Er\n bDaL7Lb4tarCs7kZlKUGMLabHPQfaNDY1jtIeU6U=",
        "From": "Somnath Kotur <somnath.kotur@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com",
        "Date": "Mon, 13 Jul 2020 11:45:57 +0530",
        "Message-Id": "<20200713061600.19456-8-somnath.kotur@broadcom.com>",
        "X-Mailer": "git-send-email 2.10.1.613.g2cc2e70",
        "In-Reply-To": "<20200713061600.19456-1-somnath.kotur@broadcom.com>",
        "References": "<20200713061600.19456-1-somnath.kotur@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH 07/10] net/bnxt: add support for identifier\n\tsearch and ref count",
        "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\nAdd support to search for identifiers and increase the reference\ncount for identifiers that are already allocated.\n\nSigned-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nReviewed-by: Michael Baucom <michael.baucom@broadcom.com>\nSigned-off-by: Somnath Kotur <somnath.kotur@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/ulp_mapper.c | 118 ++++++++++++++++++++++++++++++++++-\n 1 file changed, 115 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\nindex 86858b8..157c451 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n@@ -677,6 +677,103 @@ ulp_mapper_ident_process(struct bnxt_ulp_mapper_parms *parms,\n \treturn rc;\n }\n \n+/*\n+ * Process the identifier instruction and extract it from result blob.\n+ * Increment the identifier reference count and store it in the flow database.\n+ */\n+static int32_t\n+ulp_mapper_ident_extract(struct bnxt_ulp_mapper_parms *parms,\n+\t\t\t struct bnxt_ulp_mapper_tbl_info *tbl,\n+\t\t\t struct bnxt_ulp_mapper_ident_info *ident,\n+\t\t\t struct ulp_blob *res_blob)\n+{\n+\tstruct ulp_flow_db_res_params\tfid_parms;\n+\tuint64_t id = 0;\n+\tuint32_t idx;\n+\tstruct tf_search_identifier_parms sparms = { 0 };\n+\tstruct tf_free_identifier_parms free_parms = { 0 };\n+\tstruct tf *tfp;\n+\tint rc;\n+\n+\t/* Get the tfp from ulp context */\n+\ttfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);\n+\tif (!tfp) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to get tf pointer\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Extract the index from the result blob */\n+\trc = ulp_blob_pull(res_blob, (uint8_t *)&idx, sizeof(idx),\n+\t\t\t   ident->ident_bit_pos, ident->ident_bit_size);\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to extract identifier from blob\\n\");\n+\t\treturn -EIO;\n+\t}\n+\n+\t/* populate the search params and search identifier shadow table */\n+\tsparms.ident_type = ident->ident_type;\n+\tsparms.dir = tbl->direction;\n+\t/* convert the idx into cpu format */\n+\tsparms.search_id = tfp_be_to_cpu_32(idx);\n+\n+\t/* Search identifier also increase the reference count */\n+\trc = tf_search_identifier(tfp, &sparms);\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"Search ident %s:%s:%x failed.\\n\",\n+\t\t\t    tf_dir_2_str(sparms.dir),\n+\t\t\t    tf_tbl_type_2_str(sparms.ident_type),\n+\t\t\t    sparms.search_id);\n+\t\treturn rc;\n+\t}\n+\tBNXT_TF_INF(\"Search ident %s:%s:%x.success.\\n\",\n+\t\t    tf_dir_2_str(sparms.dir),\n+\t\t    tf_tbl_type_2_str(sparms.ident_type),\n+\t\t    sparms.search_id);\n+\n+\t/* Write it to the regfile */\n+\tid = (uint64_t)tfp_cpu_to_be_64(sparms.search_id);\n+\tif (!ulp_regfile_write(parms->regfile, ident->regfile_idx, id)) {\n+\t\tBNXT_TF_DBG(ERR, \"Regfile[%d] write failed.\\n\", idx);\n+\t\trc = -EINVAL;\n+\t\t/* Need to free the identifier, so goto error */\n+\t\tgoto error;\n+\t}\n+\n+\t/* Link the resource to the flow in the flow db */\n+\tmemset(&fid_parms, 0, sizeof(fid_parms));\n+\tfid_parms.direction = tbl->direction;\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+\trc = ulp_flow_db_resource_add(parms->ulp_ctx,\n+\t\t\t\t      parms->tbl_idx,\n+\t\t\t\t      parms->fid,\n+\t\t\t\t      &fid_parms);\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to link res to flow rc = %d\\n\",\n+\t\t\t    rc);\n+\t\t/* Need to free the identifier, so goto error */\n+\t\tgoto error;\n+\t}\n+\n+#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG\n+\tulp_mapper_ident_field_dump(\"Ident\", ident, tbl, sparms.search_id);\n+#endif\n+\treturn 0;\n+\n+error:\n+\t/* Need to free the identifier */\n+\tfree_parms.dir = tbl->direction;\n+\tfree_parms.ident_type = ident->ident_type;\n+\tfree_parms.id = sparms.search_id;\n+\t(void)tf_free_identifier(tfp, &free_parms);\n+\tBNXT_TF_DBG(ERR, \"Ident extract failed for %s:%s:%x\\n\",\n+\t\t    ident->description,\n+\t\t    tf_dir_2_str(tbl->direction), sparms.search_id);\n+\treturn rc;\n+}\n+\n static int32_t\n ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,\n \t\t\t\tenum tf_dir dir,\n@@ -1204,6 +1301,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \tstruct tf_free_tcam_entry_parms free_parms\t= { 0 };\n \tuint32_t hit = 0;\n \tuint16_t tmplen = 0;\n+\tstruct ulp_blob res_blob;\n \n \t/* Skip this if was handled by the cache. */\n \tif (parms->tcam_tbl_opc == BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_SKIP) {\n@@ -1379,9 +1477,23 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t\t\tgoto error;\n \n \t} else {\n-\t\tBNXT_TF_DBG(ERR, \"Not supporting search before alloc now\\n\");\n-\t\trc = -EINVAL;\n-\t\tgoto error;\n+\t\tstruct bnxt_ulp_mapper_ident_info *idents;\n+\t\tuint32_t num_idents;\n+\n+\t\t/*\n+\t\t * Extract the listed identifiers from the result field,\n+\t\t * no need to allocate them.\n+\t\t */\n+\t\tidents = ulp_mapper_ident_fields_get(tbl, &num_idents);\n+\t\tfor (i = 0; i < num_idents; i++) {\n+\t\t\trc = ulp_mapper_ident_extract(parms, tbl,\n+\t\t\t\t\t\t      &idents[i], &res_blob);\n+\t\t\tif (rc) {\n+\t\t\t\tBNXT_TF_DBG(ERR,\n+\t\t\t\t\t    \"Error in ident extraction\\n\");\n+\t\t\t\tgoto error;\n+\t\t\t}\n+\t\t}\n \t}\n \n \t/*\n",
    "prefixes": [
        "07/10"
    ]
}