get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 92048,
    "url": "http://patches.dpdk.org/api/patches/92048/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210423012938.24770-2-dharmik.thakkar@arm.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": "<20210423012938.24770-2-dharmik.thakkar@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210423012938.24770-2-dharmik.thakkar@arm.com",
    "date": "2021-04-23T01:29:37",
    "name": "[v4,1/2] lib/mempool: make stats macro generic",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1701d32007a83107d56d09565b35d5f546a4c29b",
    "submitter": {
        "id": 1108,
        "url": "http://patches.dpdk.org/api/people/1108/?format=api",
        "name": "Dharmik Thakkar",
        "email": "dharmik.thakkar@arm.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210423012938.24770-2-dharmik.thakkar@arm.com/mbox/",
    "series": [
        {
            "id": 16613,
            "url": "http://patches.dpdk.org/api/series/16613/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=16613",
            "date": "2021-04-23T01:29:36",
            "name": "lib/mempool: add debug stats",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/16613/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/92048/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/92048/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 B2834A0A02;\n\tFri, 23 Apr 2021 03:30:08 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DCEEC41DBF;\n\tFri, 23 Apr 2021 03:30:00 +0200 (CEST)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id 4850641CAF\n for <dev@dpdk.org>; Fri, 23 Apr 2021 03:29:57 +0200 (CEST)",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 873101396;\n Thu, 22 Apr 2021 18:29:56 -0700 (PDT)",
            "from 2p2660v4-1.austin.arm.com (2p2660v4-1.austin.arm.com\n [10.118.13.237])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7F7BE3F774;\n Thu, 22 Apr 2021 18:29:56 -0700 (PDT)"
        ],
        "From": "Dharmik Thakkar <dharmik.thakkar@arm.com>",
        "To": "Olivier Matz <olivier.matz@6wind.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>",
        "Cc": "dev@dpdk.org, nd@arm.com, joyce.kong@arm.com,\n Dharmik Thakkar <dharmik.thakkar@arm.com>",
        "Date": "Thu, 22 Apr 2021 20:29:37 -0500",
        "Message-Id": "<20210423012938.24770-2-dharmik.thakkar@arm.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20210423012938.24770-1-dharmik.thakkar@arm.com>",
        "References": "<20210420000800.1504-1-dharmik.thakkar@arm.com>\n <20210423012938.24770-1-dharmik.thakkar@arm.com>",
        "Subject": "[dpdk-dev] [PATCH v4 1/2] lib/mempool: make stats macro generic",
        "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": "Make __MEMPOOL_STAT_ADD macro more generic and delete\n__MEMPOOL_CONTIG_BLOCKS_STAT_ADD macro\n\nSuggested-by: Olivier Matz <olivier.matz@6wind.com>\nSigned-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\nReviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\nAcked-by: Olivier Matz <olivier.matz@6wind.com>\n---\n lib/mempool/rte_mempool.h | 34 ++++++++++++++++------------------\n 1 file changed, 16 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h\nindex c551cf733acf..848a19226149 100644\n--- a/lib/mempool/rte_mempool.h\n+++ b/lib/mempool/rte_mempool.h\n@@ -273,20 +273,11 @@ struct rte_mempool {\n #define __MEMPOOL_STAT_ADD(mp, name, n) do {                    \\\n \t\tunsigned __lcore_id = rte_lcore_id();           \\\n \t\tif (__lcore_id < RTE_MAX_LCORE) {               \\\n-\t\t\tmp->stats[__lcore_id].name##_objs += n;\t\\\n-\t\t\tmp->stats[__lcore_id].name##_bulk += 1;\t\\\n+\t\t\tmp->stats[__lcore_id].name += n;\t\\\n \t\t}                                               \\\n \t} while(0)\n-#define __MEMPOOL_CONTIG_BLOCKS_STAT_ADD(mp, name, n) do {                    \\\n-\t\tunsigned int __lcore_id = rte_lcore_id();       \\\n-\t\tif (__lcore_id < RTE_MAX_LCORE) {               \\\n-\t\t\tmp->stats[__lcore_id].name##_blks += n;\t\\\n-\t\t\tmp->stats[__lcore_id].name##_bulk += 1;\t\\\n-\t\t}                                               \\\n-\t} while (0)\n #else\n #define __MEMPOOL_STAT_ADD(mp, name, n) do {} while(0)\n-#define __MEMPOOL_CONTIG_BLOCKS_STAT_ADD(mp, name, n) do {} while (0)\n #endif\n \n /**\n@@ -1288,7 +1279,8 @@ __mempool_generic_put(struct rte_mempool *mp, void * const *obj_table,\n \tvoid **cache_objs;\n \n \t/* increment stat now, adding in mempool always success */\n-\t__MEMPOOL_STAT_ADD(mp, put, n);\n+\t__MEMPOOL_STAT_ADD(mp, put_bulk, 1);\n+\t__MEMPOOL_STAT_ADD(mp, put_objs, n);\n \n \t/* No cache provided or if put would overflow mem allocated for cache */\n \tif (unlikely(cache == NULL || n > RTE_MEMPOOL_CACHE_MAX_SIZE))\n@@ -1446,7 +1438,8 @@ __mempool_generic_get(struct rte_mempool *mp, void **obj_table,\n \n \tcache->len -= n;\n \n-\t__MEMPOOL_STAT_ADD(mp, get_success, n);\n+\t__MEMPOOL_STAT_ADD(mp, get_success_bulk, 1);\n+\t__MEMPOOL_STAT_ADD(mp, get_success_objs, n);\n \n \treturn 0;\n \n@@ -1455,10 +1448,13 @@ __mempool_generic_get(struct rte_mempool *mp, void **obj_table,\n \t/* get remaining objects from ring */\n \tret = rte_mempool_ops_dequeue_bulk(mp, obj_table, n);\n \n-\tif (ret < 0)\n-\t\t__MEMPOOL_STAT_ADD(mp, get_fail, n);\n-\telse\n-\t\t__MEMPOOL_STAT_ADD(mp, get_success, n);\n+\tif (ret < 0) {\n+\t\t__MEMPOOL_STAT_ADD(mp, get_fail_bulk, 1);\n+\t\t__MEMPOOL_STAT_ADD(mp, get_fail_objs, n);\n+\t} else {\n+\t\t__MEMPOOL_STAT_ADD(mp, get_success_bulk, 1);\n+\t\t__MEMPOOL_STAT_ADD(mp, get_success_objs, n);\n+\t}\n \n \treturn ret;\n }\n@@ -1581,11 +1577,13 @@ rte_mempool_get_contig_blocks(struct rte_mempool *mp,\n \n \tret = rte_mempool_ops_dequeue_contig_blocks(mp, first_obj_table, n);\n \tif (ret == 0) {\n-\t\t__MEMPOOL_CONTIG_BLOCKS_STAT_ADD(mp, get_success, n);\n+\t\t__MEMPOOL_STAT_ADD(mp, get_success_bulk, 1);\n+\t\t__MEMPOOL_STAT_ADD(mp, get_success_blks, n);\n \t\t__mempool_contig_blocks_check_cookies(mp, first_obj_table, n,\n \t\t\t\t\t\t      1);\n \t} else {\n-\t\t__MEMPOOL_CONTIG_BLOCKS_STAT_ADD(mp, get_fail, n);\n+\t\t__MEMPOOL_STAT_ADD(mp, get_fail_bulk, 1);\n+\t\t__MEMPOOL_STAT_ADD(mp, get_fail_blks, n);\n \t}\n \n \trte_mempool_trace_get_contig_blocks(mp, first_obj_table, n);\n",
    "prefixes": [
        "v4",
        "1/2"
    ]
}