get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 92047,
    "url": "http://patches.dpdk.org/api/patches/92047/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210423012938.24770-3-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-3-dharmik.thakkar@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210423012938.24770-3-dharmik.thakkar@arm.com",
    "date": "2021-04-23T01:29:38",
    "name": "[v4,2/2] lib/mempool: distinguish debug counters from cache and pool",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "35debf0ee1203f29aef735e0c51209b2a26d792b",
    "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-3-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/92047/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/92047/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 94C22A0A02;\n\tFri, 23 Apr 2021 03:30:03 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A8ADF41D41;\n\tFri, 23 Apr 2021 03:29:59 +0200 (CEST)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id 4368C4014F\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 9FEE113D5;\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 9839B3F774;\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:38 -0500",
        "Message-Id": "<20210423012938.24770-3-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 2/2] lib/mempool: distinguish debug counters\n from cache and pool",
        "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: Joyce Kong <joyce.kong@arm.com>\n\nIf cache is enabled, objects will be retrieved/put from/to cache,\nsubsequently from/to the common pool. Now the debug stats calculate\nthe objects retrieved/put from/to cache and pool together, it is\nbetter to distinguish them.\n\nSigned-off-by: Joyce Kong <joyce.kong@arm.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>\n---\n lib/mempool/rte_mempool.c | 16 +++++++++++++++\n lib/mempool/rte_mempool.h | 43 ++++++++++++++++++++++++++-------------\n 2 files changed, 45 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c\nindex afb1239c8d48..e9343c2a7f6b 100644\n--- a/lib/mempool/rte_mempool.c\n+++ b/lib/mempool/rte_mempool.c\n@@ -1244,6 +1244,14 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)\n \tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n \t\tsum.put_bulk += mp->stats[lcore_id].put_bulk;\n \t\tsum.put_objs += mp->stats[lcore_id].put_objs;\n+\t\tsum.put_common_pool_bulk +=\n+\t\t\tmp->stats[lcore_id].put_common_pool_bulk;\n+\t\tsum.put_common_pool_objs +=\n+\t\t\tmp->stats[lcore_id].put_common_pool_objs;\n+\t\tsum.get_common_pool_bulk +=\n+\t\t\tmp->stats[lcore_id].get_common_pool_bulk;\n+\t\tsum.get_common_pool_objs +=\n+\t\t\tmp->stats[lcore_id].get_common_pool_objs;\n \t\tsum.get_success_bulk += mp->stats[lcore_id].get_success_bulk;\n \t\tsum.get_success_objs += mp->stats[lcore_id].get_success_objs;\n \t\tsum.get_fail_bulk += mp->stats[lcore_id].get_fail_bulk;\n@@ -1254,6 +1262,14 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)\n \tfprintf(f, \"  stats:\\n\");\n \tfprintf(f, \"    put_bulk=%\"PRIu64\"\\n\", sum.put_bulk);\n \tfprintf(f, \"    put_objs=%\"PRIu64\"\\n\", sum.put_objs);\n+\tfprintf(f, \"    put_common_pool_bulk=%\"PRIu64\"\\n\",\n+\t\t\t\t\t\tsum.put_common_pool_bulk);\n+\tfprintf(f, \"    put_common_pool_objs=%\"PRIu64\"\\n\",\n+\t\t\t\t\t\tsum.put_common_pool_objs);\n+\tfprintf(f, \"    get_common_pool_bulk=%\"PRIu64\"\\n\",\n+\t\t\t\t\t\tsum.get_common_pool_bulk);\n+\tfprintf(f, \"    get_common_pool_objs=%\"PRIu64\"\\n\",\n+\t\t\t\t\t\tsum.get_common_pool_objs);\n \tfprintf(f, \"    get_success_bulk=%\"PRIu64\"\\n\", sum.get_success_bulk);\n \tfprintf(f, \"    get_success_objs=%\"PRIu64\"\\n\", sum.get_success_objs);\n \tfprintf(f, \"    get_fail_bulk=%\"PRIu64\"\\n\", sum.get_fail_bulk);\ndiff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h\nindex 848a19226149..4343b287dc4e 100644\n--- a/lib/mempool/rte_mempool.h\n+++ b/lib/mempool/rte_mempool.h\n@@ -64,14 +64,21 @@ extern \"C\" {\n #ifdef RTE_LIBRTE_MEMPOOL_DEBUG\n /**\n  * A structure that stores the mempool statistics (per-lcore).\n+ * Note: Cache stats (put_cache_bulk/objs, get_cache_bulk/objs) are not\n+ * captured since they can be calculated from other stats.\n+ * For example: put_cache_objs = put_objs - put_common_pool_objs.\n  */\n struct rte_mempool_debug_stats {\n-\tuint64_t put_bulk;         /**< Number of puts. */\n-\tuint64_t put_objs;         /**< Number of objects successfully put. */\n-\tuint64_t get_success_bulk; /**< Successful allocation number. */\n-\tuint64_t get_success_objs; /**< Objects successfully allocated. */\n-\tuint64_t get_fail_bulk;    /**< Failed allocation number. */\n-\tuint64_t get_fail_objs;    /**< Objects that failed to be allocated. */\n+\tuint64_t put_bulk;\t\t  /**< Number of puts. */\n+\tuint64_t put_objs;\t\t  /**< Number of objects successfully put. */\n+\tuint64_t put_common_pool_bulk;\t  /**< Number of bulks enqueued in common pool. */\n+\tuint64_t put_common_pool_objs;\t  /**< Number of objects enqueued in common pool. */\n+\tuint64_t get_common_pool_bulk;    /**< Number of bulks dequeued from common pool. */\n+\tuint64_t get_common_pool_objs;\t  /**< Number of objects dequeued from common pool. */\n+\tuint64_t get_success_bulk;\t  /**< Successful allocation number. */\n+\tuint64_t get_success_objs;\t  /**< Objects successfully allocated. */\n+\tuint64_t get_fail_bulk;\t\t  /**< Failed allocation number. */\n+\tuint64_t get_fail_objs;\t\t  /**< Objects that failed to be allocated. */\n \t/** Successful allocation number of contiguous blocks. */\n \tuint64_t get_success_blks;\n \t/** Failed allocation number of contiguous blocks. */\n@@ -699,10 +706,18 @@ rte_mempool_ops_dequeue_bulk(struct rte_mempool *mp,\n \t\tvoid **obj_table, unsigned n)\n {\n \tstruct rte_mempool_ops *ops;\n+\tint ret;\n \n \trte_mempool_trace_ops_dequeue_bulk(mp, obj_table, n);\n \tops = rte_mempool_get_ops(mp->ops_index);\n-\treturn ops->dequeue(mp, obj_table, n);\n+\tret = ops->dequeue(mp, obj_table, n);\n+\tif (ret == 0) {\n+\t\t__MEMPOOL_STAT_ADD(mp, get_common_pool_bulk, 1);\n+\t\t__MEMPOOL_STAT_ADD(mp, get_common_pool_objs, n);\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+\treturn ret;\n }\n \n /**\n@@ -749,6 +764,8 @@ rte_mempool_ops_enqueue_bulk(struct rte_mempool *mp, void * const *obj_table,\n {\n \tstruct rte_mempool_ops *ops;\n \n+\t__MEMPOOL_STAT_ADD(mp, put_common_pool_bulk, 1);\n+\t__MEMPOOL_STAT_ADD(mp, put_common_pool_objs, n);\n \trte_mempool_trace_ops_enqueue_bulk(mp, obj_table, n);\n \tops = rte_mempool_get_ops(mp->ops_index);\n \treturn ops->enqueue(mp, obj_table, n);\n@@ -1297,9 +1314,10 @@ __mempool_generic_put(struct rte_mempool *mp, void * const *obj_table,\n \n \t/* Add elements back into the cache */\n \trte_memcpy(&cache_objs[0], obj_table, sizeof(void *) * n);\n-\n \tcache->len += n;\n \n+\t__MEMPOOL_STAT_ADD(mp, put_cache_bulk, 1);\n+\n \tif (cache->len >= cache->flushthresh) {\n \t\trte_mempool_ops_enqueue_bulk(mp, &cache->objs[cache->size],\n \t\t\t\tcache->len - cache->size);\n@@ -1430,6 +1448,9 @@ __mempool_generic_get(struct rte_mempool *mp, void **obj_table,\n \t\t}\n \n \t\tcache->len += req;\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 \t/* Now fill in the response ... */\n@@ -1438,9 +1459,6 @@ __mempool_generic_get(struct rte_mempool *mp, void **obj_table,\n \n \tcache->len -= n;\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 ring_dequeue:\n@@ -1451,9 +1469,6 @@ __mempool_generic_get(struct rte_mempool *mp, void **obj_table,\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",
    "prefixes": [
        "v4",
        "2/2"
    ]
}