Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/119361/?format=api
http://patches.dpdk.org/api/patches/119361/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221031112634.18329-2-mb@smartsharesystems.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": "<20221031112634.18329-2-mb@smartsharesystems.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20221031112634.18329-2-mb@smartsharesystems.com", "date": "2022-10-31T11:26:33", "name": "[v2,2/3] mempool: include non-DPDK threads in statistics", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "726ffa1c3baab48b87dad7763c552a973ffb0fd6", "submitter": { "id": 591, "url": "http://patches.dpdk.org/api/people/591/?format=api", "name": "Morten Brørup", "email": "mb@smartsharesystems.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20221031112634.18329-2-mb@smartsharesystems.com/mbox/", "series": [ { "id": 25484, "url": "http://patches.dpdk.org/api/series/25484/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=25484", "date": "2022-10-30T11:54:45", "name": "mempool: split statistics from debug", "version": 1, "mbox": "http://patches.dpdk.org/series/25484/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/119361/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/119361/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 85751A00C5;\n\tMon, 31 Oct 2022 12:26:39 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 632A740223;\n\tMon, 31 Oct 2022 12:26:39 +0100 (CET)", "from smartserver.smartsharesystems.com\n (smartserver.smartsharesystems.com [77.243.40.215])\n by mails.dpdk.org (Postfix) with ESMTP id 4F8DD40151\n for <dev@dpdk.org>; Mon, 31 Oct 2022 12:26:38 +0100 (CET)", "from dkrd2.smartsharesys.local ([192.168.4.12]) by\n smartserver.smartsharesystems.com with Microsoft SMTPSVC(6.0.3790.4675);\n Mon, 31 Oct 2022 12:26:36 +0100" ], "From": "=?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>", "To": "olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru,\n stephen@networkplumber.org, jerinj@marvell.com, bruce.richardson@intel.com", "Cc": "thomas@monjalon.net, dev@dpdk.org,\n =?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>", "Subject": "[PATCH v2 2/3] mempool: include non-DPDK threads in statistics", "Date": "Mon, 31 Oct 2022 12:26:33 +0100", "Message-Id": "<20221031112634.18329-2-mb@smartsharesystems.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20221031112634.18329-1-mb@smartsharesystems.com>", "References": "<20221030115445.2115-1-mb@smartsharesystems.com>\n <20221031112634.18329-1-mb@smartsharesystems.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-OriginalArrivalTime": "31 Oct 2022 11:26:36.0717 (UTC)\n FILETIME=[A34EA5D0:01D8ED1B]", "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" }, "content": "Offset the stats array index by one, and count non-DPDK threads at index\nzero.\n\nThis patch provides two benefits:\n* Non-DPDK threads are also included in the statistics.\n* A conditional in the fast path is removed. Static branch prediction was\n correct, so the performance improvement is negligible.\n\nv2:\n* New. No v1 of this patch in the series.\n\nSuggested-by: Stephen Hemminger <stephen@networkplumber.org>\nSigned-off-by: Morten Brørup <mb@smartsharesystems.com>\n---\n lib/mempool/rte_mempool.c | 2 +-\n lib/mempool/rte_mempool.h | 12 ++++++------\n 2 files changed, 7 insertions(+), 7 deletions(-)", "diff": "diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c\nindex 62d1ce764e..e6208125e0 100644\n--- a/lib/mempool/rte_mempool.c\n+++ b/lib/mempool/rte_mempool.c\n@@ -1272,7 +1272,7 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)\n #ifdef RTE_LIBRTE_MEMPOOL_STATS\n \trte_mempool_ops_get_info(mp, &info);\n \tmemset(&sum, 0, sizeof(sum));\n-\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n+\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE + 1; 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 += mp->stats[lcore_id].put_common_pool_bulk;\ndiff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h\nindex 9c4bf5549f..16e7e62e3c 100644\n--- a/lib/mempool/rte_mempool.h\n+++ b/lib/mempool/rte_mempool.h\n@@ -238,8 +238,11 @@ struct rte_mempool {\n \tstruct rte_mempool_memhdr_list mem_list; /**< List of memory chunks */\n \n #ifdef RTE_LIBRTE_MEMPOOL_STATS\n-\t/** Per-lcore statistics. */\n-\tstruct rte_mempool_debug_stats stats[RTE_MAX_LCORE];\n+\t/** Per-lcore statistics.\n+\t *\n+\t * Offset by one, to include non-DPDK threads.\n+\t */\n+\tstruct rte_mempool_debug_stats stats[RTE_MAX_LCORE + 1];\n #endif\n } __rte_cache_aligned;\n \n@@ -304,10 +307,7 @@ struct rte_mempool {\n */\n #ifdef RTE_LIBRTE_MEMPOOL_STATS\n #define RTE_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 += n; \\\n-\t\t} \\\n+\t\t(mp)->stats[rte_lcore_id() + 1].name += n; \\\n \t} while (0)\n #else\n #define RTE_MEMPOOL_STAT_ADD(mp, name, n) do {} while (0)\n", "prefixes": [ "v2", "2/3" ] }{ "id": 119361, "url": "