Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/32456/?format=api
https://patches.dpdk.org/api/patches/32456/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/9c79ab3e6218435b6d1af51dfe5d99aaad044d20.1513681966.git.anatoly.burakov@intel.com/", "project": { "id": 1, "url": "https://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": "<9c79ab3e6218435b6d1af51dfe5d99aaad044d20.1513681966.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/9c79ab3e6218435b6d1af51dfe5d99aaad044d20.1513681966.git.anatoly.burakov@intel.com", "date": "2017-12-19T11:14:29", "name": "[dpdk-dev,RFC,v2,02/23] eal: add function to report number of detected sockets", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "81794442ec2b6f1b5bd212b707d0f1356907ed7a", "submitter": { "id": 4, "url": "https://patches.dpdk.org/api/people/4/?format=api", "name": "Anatoly Burakov", "email": "anatoly.burakov@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/9c79ab3e6218435b6d1af51dfe5d99aaad044d20.1513681966.git.anatoly.burakov@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/32456/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/32456/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 80DD91B170;\n\tTue, 19 Dec 2017 12:15:08 +0100 (CET)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 53A8A1B01E\n\tfor <dev@dpdk.org>; Tue, 19 Dec 2017 12:14:55 +0100 (CET)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Dec 2017 03:14:53 -0800", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga003.jf.intel.com with ESMTP; 19 Dec 2017 03:14:51 -0800", "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tvBJBEpiR003089; Tue, 19 Dec 2017 11:14:51 GMT", "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id vBJBEpBx010185;\n\tTue, 19 Dec 2017 11:14:51 GMT", "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id vBJBEpjK010181;\n\tTue, 19 Dec 2017 11:14:51 GMT" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.45,426,1508828400\"; d=\"scan'208\";a=\"13553687\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "andras.kovacs@ericsson.com, laszlo.vadkeri@ericsson.com,\n\tkeith.wiles@intel.com, benjamin.walker@intel.com,\n\tbruce.richardson@intel.com, thomas@monjalon.net", "Date": "Tue, 19 Dec 2017 11:14:29 +0000", "Message-Id": "<9c79ab3e6218435b6d1af51dfe5d99aaad044d20.1513681966.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": [ "<cover.1513681966.git.anatoly.burakov@intel.com>", "<cover.1513681966.git.anatoly.burakov@intel.com>" ], "References": [ "<cover.1513681966.git.anatoly.burakov@intel.com>", "<cover.1513681966.git.anatoly.burakov@intel.com>" ], "Subject": "[dpdk-dev] [RFC v2 02/23] eal: add function to report number of\n\tdetected sockets", "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://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "At the moment, we always rely on scanning everything for every\nsocket up until RTE_MAX_NUMA_NODES and checking if there's a memseg\nassociated with each socket if we want to find out how many sockets\nwe actually have. This becomes a problem when we may have memory on\nsocket but it's not allocated yet, so we do the detection on lcore\nscan instead, and store the value for later use.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/eal_common_lcore.c | 11 +++++++++++\n lib/librte_eal/common/include/rte_eal.h | 1 +\n lib/librte_eal/common/include/rte_lcore.h | 8 ++++++++\n 3 files changed, 20 insertions(+)", "diff": "diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c\nindex 0db1555..7566a6b 100644\n--- a/lib/librte_eal/common/eal_common_lcore.c\n+++ b/lib/librte_eal/common/eal_common_lcore.c\n@@ -57,6 +57,7 @@ rte_eal_cpu_init(void)\n \tstruct rte_config *config = rte_eal_get_configuration();\n \tunsigned lcore_id;\n \tunsigned count = 0;\n+\tunsigned max_socket_id = 0;\n \n \t/*\n \t * Parse the maximum set of logical cores, detect the subset of running\n@@ -100,6 +101,8 @@ rte_eal_cpu_init(void)\n \t\t\t\tlcore_id, lcore_config[lcore_id].core_id,\n \t\t\t\tlcore_config[lcore_id].socket_id);\n \t\tcount++;\n+\t\tmax_socket_id = RTE_MAX(max_socket_id,\n+\t\t\t\t\tlcore_config[lcore_id].socket_id);\n \t}\n \t/* Set the count of enabled logical cores of the EAL configuration */\n \tconfig->lcore_count = count;\n@@ -108,5 +111,13 @@ rte_eal_cpu_init(void)\n \t\tRTE_MAX_LCORE);\n \tRTE_LOG(INFO, EAL, \"Detected %u lcore(s)\\n\", config->lcore_count);\n \n+\tconfig->numa_node_count = max_socket_id + 1;\n+\tRTE_LOG(INFO, EAL, \"Detected %u NUMA nodes\\n\", config->numa_node_count);\n+\n \treturn 0;\n }\n+\n+unsigned rte_num_sockets(void) {\n+\tconst struct rte_config *config = rte_eal_get_configuration();\n+\treturn config->numa_node_count;\n+}\ndiff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h\nindex 8e4e71c..5b12914 100644\n--- a/lib/librte_eal/common/include/rte_eal.h\n+++ b/lib/librte_eal/common/include/rte_eal.h\n@@ -83,6 +83,7 @@ enum rte_proc_type_t {\n struct rte_config {\n \tuint32_t master_lcore; /**< Id of the master lcore */\n \tuint32_t lcore_count; /**< Number of available logical cores. */\n+\tuint32_t numa_node_count; /**< Number of detected NUMA nodes. */\n \tuint32_t service_lcore_count;/**< Number of available service cores. */\n \tenum rte_lcore_role_t lcore_role[RTE_MAX_LCORE]; /**< State of cores. */\n \ndiff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h\nindex c89e6ba..6a75c9b 100644\n--- a/lib/librte_eal/common/include/rte_lcore.h\n+++ b/lib/librte_eal/common/include/rte_lcore.h\n@@ -148,6 +148,14 @@ rte_lcore_index(int lcore_id)\n unsigned rte_socket_id(void);\n \n /**\n+ * Return number of physical sockets on the system.\n+ * @return\n+ * the number of physical sockets as recognized by EAL\n+ *\n+ */\n+unsigned rte_num_sockets(void);\n+\n+/**\n * Get the ID of the physical socket of the specified lcore\n *\n * @param lcore_id\n", "prefixes": [ "dpdk-dev", "RFC", "v2", "02/23" ] }{ "id": 32456, "url": "