get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 103402,
    "url": "http://patches.dpdk.org/api/patches/103402/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211102040556.7840-4-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": "<20211102040556.7840-4-venkatkumar.duvvuru@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211102040556.7840-4-venkatkumar.duvvuru@broadcom.com",
    "date": "2021-11-02T04:05:39",
    "name": "[v3,03/20] net/bnxt: fix the out of boundary issue in hash list",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "166439548892b8d642e53269668ecf96bd855205",
    "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/20211102040556.7840-4-venkatkumar.duvvuru@broadcom.com/mbox/",
    "series": [
        {
            "id": 20191,
            "url": "http://patches.dpdk.org/api/series/20191/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=20191",
            "date": "2021-11-02T04:05:36",
            "name": "fixes and enhancements to Truflow",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/20191/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/103402/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/103402/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 F12CBA0C4D;\n\tTue,  2 Nov 2021 05:06:28 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5B3A541137;\n\tTue,  2 Nov 2021 05:06:10 +0100 (CET)",
            "from relay.smtp-ext.broadcom.com (lpdvsmtp09.broadcom.com\n [192.19.166.228])\n by mails.dpdk.org (Postfix) with ESMTP id 09C0841122\n for <dev@dpdk.org>; Tue,  2 Nov 2021 05:06:09 +0100 (CET)",
            "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 4E7A07A21;\n Mon,  1 Nov 2021 21:06:07 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 4E7A07A21",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1635825968;\n bh=8VWDIanUNAsAyNNQTMo0r7rejJ9Nd9W0CCcfMBpCQM8=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=OgRcCsWXszcUZhHkI8mG6JeRBw3vfwOMPLLmppABvoANKdEoRp4gqUNRa2VFlO35z\n ECmde3Is73JqU5Fe2l4RFg0Aa2LXjF1ZGBrOMXEz7z3qcipOIzqaASaCO2FdJRVaLQ\n X/QTmM/DHZ9QUl/0wvXr2I/5/zerCdydXTnNR0gQ=",
        "From": "Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "Kishore Padmanabha <kishore.padmanabha@broadcom.com>,\n Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>",
        "Date": "Tue,  2 Nov 2021 09:35:39 +0530",
        "Message-Id": "<20211102040556.7840-4-venkatkumar.duvvuru@broadcom.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20211102040556.7840-1-venkatkumar.duvvuru@broadcom.com>",
        "References": "<20211001055909.27276-1-venkatkumar.duvvuru@broadcom.com>\n <20211102040556.7840-1-venkatkumar.duvvuru@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH v3 03/20] net/bnxt: fix the out of boundary issue\n in hash list",
        "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: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\n\nThe number of hash bucket list calculation is fixed and added\ncheck to limit the out of boundary condition\n\nFixes: 0001cc58d362 (\"net/bnxt: support generic hash table\")\n\nSigned-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nSigned-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>\nReviewed-by: Michael Baucom <michael.baucom@broadcom.com>\nReviewed-by: Randy Schacher <stuart.schacher@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/ulp_gen_hash.c | 20 ++++++++++++++------\n 1 file changed, 14 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/ulp_gen_hash.c b/drivers/net/bnxt/tf_ulp/ulp_gen_hash.c\nindex 3c6e7fe924..84c83de35c 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_gen_hash.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_gen_hash.c\n@@ -16,20 +16,21 @@ int32_t ulp_bit_alloc_list_alloc(struct bit_alloc_list *blist,\n {\n \tuint64_t bentry;\n \tuint32_t idx = 0, jdx = 0;\n+\tuint32_t bsize_64 = blist->bsize / ULP_64B_IN_BYTES;\n \n \t/* Iterate all numbers that have all 1's */\n \tdo {\n \t\tbentry = blist->bdata[idx++];\n-\t} while (bentry == -1UL && idx < blist->bsize);\n+\t} while (bentry == -1UL && idx <= bsize_64);\n \n-\tif (idx < blist->bsize) {\n+\tif (idx <= bsize_64) {\n \t\tif (bentry)\n \t\t\tjdx = __builtin_clzl(~bentry);\n \t\t*index = ((idx - 1) * ULP_INDEX_BITMAP_SIZE) + jdx;\n \t\tULP_INDEX_BITMAP_SET(blist->bdata[(idx - 1)], jdx);\n \t\treturn 0;\n \t}\n-\tjdx = (uint32_t)(blist->bsize * ULP_INDEX_BITMAP_SIZE);\n+\tjdx = (uint32_t)(bsize_64 * ULP_INDEX_BITMAP_SIZE);\n \tBNXT_TF_DBG(ERR, \"bit allocator is full reached max:%x\\n\", jdx);\n \treturn -1;\n }\n@@ -39,9 +40,10 @@ int32_t ulp_bit_alloc_list_dealloc(struct bit_alloc_list *blist,\n \t\t\t\t   uint32_t index)\n {\n \tuint32_t idx = 0, jdx;\n+\tuint32_t bsize_64 = blist->bsize / ULP_64B_IN_BYTES;\n \n \tidx = index / ULP_INDEX_BITMAP_SIZE;\n-\tif (idx >= blist->bsize) {\n+\tif (idx >= bsize_64) {\n \t\tBNXT_TF_DBG(ERR, \"invalid bit index %x:%x\\n\", idx,\n \t\t\t    blist->bsize);\n \t\treturn -EINVAL;\n@@ -127,7 +129,8 @@ ulp_gen_hash_tbl_list_init(struct ulp_hash_create_params *cparams,\n \thash_tbl->hash_mask = size - 1;\n \n \t/* allocate the memory for the bit allocator */\n-\tsize = (cparams->num_key_entries / sizeof(uint64_t)) + 1;\n+\tsize = (cparams->num_key_entries / sizeof(uint64_t));\n+\tsize = ULP_BYTE_ROUND_OFF_8(size);\n \thash_tbl->bit_list.bsize = size;\n \thash_tbl->bit_list.bdata = rte_zmalloc(\"Generic hash bit alloc\", size,\n \t\t\t\t\t       ULP_BUFFER_ALIGN_64_BYTE);\n@@ -311,7 +314,12 @@ ulp_gen_hash_tbl_list_add(struct ulp_gen_hash_tbl *hash_tbl,\n \t\tBNXT_TF_DBG(ERR, \"Error in bit list alloc\\n\");\n \t\treturn -ENOMEM;\n \t}\n-\n+\tif (key_index > hash_tbl->num_key_entries) {\n+\t\tBNXT_TF_DBG(ERR, \"reached max size %u:%u\\n\", key_index,\n+\t\t\t    hash_tbl->num_key_entries);\n+\t\tulp_bit_alloc_list_dealloc(&hash_tbl->bit_list, key_index);\n+\t\treturn -ENOMEM;\n+\t}\n \t/* Update the hash entry */\n \tULP_HASH_BUCKET_MARK_INUSE(bucket, (uint16_t)key_index);\n \n",
    "prefixes": [
        "v3",
        "03/20"
    ]
}