Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/56189/?format=api
http://patchwork.dpdk.org/api/patches/56189/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/0c24b8e90a79ec20daca5dfac0130c962d8b1734.1562347546.git.anatoly.burakov@intel.com/", "project": { "id": 1, "url": "http://patchwork.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": "<0c24b8e90a79ec20daca5dfac0130c962d8b1734.1562347546.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/0c24b8e90a79ec20daca5dfac0130c962d8b1734.1562347546.git.anatoly.burakov@intel.com", "date": "2019-07-05T17:26:21", "name": "[v5,3/9] eal: add new API to lock/unlock mempool list", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "eaee36d91740ad1fc6c8b712a88bc1e479fdb5a6", "submitter": { "id": 4, "url": "http://patchwork.dpdk.org/api/people/4/?format=api", "name": "Anatoly Burakov", "email": "anatoly.burakov@intel.com" }, "delegate": null, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/0c24b8e90a79ec20daca5dfac0130c962d8b1734.1562347546.git.anatoly.burakov@intel.com/mbox/", "series": [ { "id": 5379, "url": "http://patchwork.dpdk.org/api/series/5379/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=5379", "date": "2019-07-05T17:26:18", "name": "Make shared memory config non-public", "version": 5, "mbox": "http://patchwork.dpdk.org/series/5379/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/56189/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/56189/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 C8EFF1BE6B;\n\tFri, 5 Jul 2019 19:26:40 +0200 (CEST)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id B76501BE63\n\tfor <dev@dpdk.org>; Fri, 5 Jul 2019 19:26:38 +0200 (CEST)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t05 Jul 2019 10:26:38 -0700", "from silpixa00399498.ir.intel.com (HELO\n\tsilpixa00399498.ger.corp.intel.com) ([10.237.223.125])\n\tby FMSMGA003.fm.intel.com with ESMTP; 05 Jul 2019 10:26:36 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.63,455,1557212400\"; d=\"scan'208\";a=\"172723259\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "Olivier Matz <olivier.matz@6wind.com>,\n\tAndrew Rybchenko <arybchenko@solarflare.com>, thomas@monjalon.net,\n\tdavid.marchand@redhat.com, stephen@networkplumber.org", "Date": "Fri, 5 Jul 2019 18:26:21 +0100", "Message-Id": "<0c24b8e90a79ec20daca5dfac0130c962d8b1734.1562347546.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": [ "<cover.1562347546.git.anatoly.burakov@intel.com>", "<cover.1562347546.git.anatoly.burakov@intel.com>" ], "References": [ "<cover.1562347546.git.anatoly.burakov@intel.com>", "<cover.1562332112.git.anatoly.burakov@intel.com>\n\t<cover.1562347546.git.anatoly.burakov@intel.com>" ], "Subject": "[dpdk-dev] [PATCH v5 3/9] eal: add new API to lock/unlock mempool\n\tlist", "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://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Currently, in order to lock access to the mempool list, a direct\naccess to the shared memory structure is needed. Add an API to do\nthe same, and search-and-replace all usages.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\nAcked-by: Stephen Hemminger <stephen@networkplumber.org>\nAcked-by: David Marchand <david.marchand@redhat.com>\n---\n lib/librte_eal/common/eal_common_mcfg.c | 28 +++++++++++++++++++\n lib/librte_eal/common/include/rte_eal.h | 5 ----\n .../common/include/rte_eal_memconfig.h | 24 ++++++++++++++++\n lib/librte_eal/rte_eal_version.map | 4 +++\n lib/librte_mempool/rte_mempool.c | 18 ++++++------\n 5 files changed, 65 insertions(+), 14 deletions(-)", "diff": "diff --git a/lib/librte_eal/common/eal_common_mcfg.c b/lib/librte_eal/common/eal_common_mcfg.c\nindex 05167e4dc..ba2bc37b7 100644\n--- a/lib/librte_eal/common/eal_common_mcfg.c\n+++ b/lib/librte_eal/common/eal_common_mcfg.c\n@@ -60,3 +60,31 @@ rte_mcfg_tailq_write_unlock(void)\n \tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n \trte_rwlock_write_unlock(&mcfg->qlock);\n }\n+\n+void\n+rte_mcfg_mempool_read_lock(void)\n+{\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n+\trte_rwlock_read_lock(&mcfg->mplock);\n+}\n+\n+void\n+rte_mcfg_mempool_read_unlock(void)\n+{\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n+\trte_rwlock_read_unlock(&mcfg->mplock);\n+}\n+\n+void\n+rte_mcfg_mempool_write_lock(void)\n+{\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n+\trte_rwlock_write_lock(&mcfg->mplock);\n+}\n+\n+void\n+rte_mcfg_mempool_write_unlock(void)\n+{\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n+\trte_rwlock_write_unlock(&mcfg->mplock);\n+}\ndiff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h\nindex 28cbf2dde..34245b053 100644\n--- a/lib/librte_eal/common/include/rte_eal.h\n+++ b/lib/librte_eal/common/include/rte_eal.h\n@@ -446,11 +446,6 @@ typedef void\t(*rte_usage_hook_t)(const char * prgname);\n rte_usage_hook_t\n rte_set_application_usage_hook(rte_usage_hook_t usage_func);\n \n-/**\n- * macro to get the multiple lock of mempool shared by multiple-instance\n- */\n-#define RTE_EAL_MEMPOOL_RWLOCK (&rte_eal_get_configuration()->mem_config->mplock)\n-\n /**\n * Whether EAL is using huge pages (disabled by --no-huge option).\n * The no-huge mode cannot be used with UIO poll-mode drivers like igb/ixgbe.\ndiff --git a/lib/librte_eal/common/include/rte_eal_memconfig.h b/lib/librte_eal/common/include/rte_eal_memconfig.h\nindex 240fa150b..58dcbb96d 100644\n--- a/lib/librte_eal/common/include/rte_eal_memconfig.h\n+++ b/lib/librte_eal/common/include/rte_eal_memconfig.h\n@@ -148,6 +148,30 @@ rte_mcfg_tailq_write_lock(void);\n void\n rte_mcfg_tailq_write_unlock(void);\n \n+/**\n+ * Lock the internal EAL Mempool list for shared access.\n+ */\n+void\n+rte_mcfg_mempool_read_lock(void);\n+\n+/**\n+ * Unlock the internal EAL Mempool list for shared access.\n+ */\n+void\n+rte_mcfg_mempool_read_unlock(void);\n+\n+/**\n+ * Lock the internal EAL Mempool list for exclusive access.\n+ */\n+void\n+rte_mcfg_mempool_write_lock(void);\n+\n+/**\n+ * Unlock the internal EAL Mempool list for exclusive access.\n+ */\n+void\n+rte_mcfg_mempool_write_unlock(void);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex d78a3a8b9..cc4ef04a0 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -296,6 +296,10 @@ DPDK_19.08 {\n \trte_mcfg_mem_read_unlock;\n \trte_mcfg_mem_write_lock;\n \trte_mcfg_mem_write_unlock;\n+\trte_mcfg_mempool_read_lock;\n+\trte_mcfg_mempool_read_unlock;\n+\trte_mcfg_mempool_write_lock;\n+\trte_mcfg_mempool_write_unlock;\n \trte_mcfg_tailq_read_lock;\n \trte_mcfg_tailq_read_unlock;\n \trte_mcfg_tailq_write_lock;\ndiff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex 238287a01..5c688d456 100644\n--- a/lib/librte_mempool/rte_mempool.c\n+++ b/lib/librte_mempool/rte_mempool.c\n@@ -830,7 +830,7 @@ rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size,\n \t\treturn NULL;\n \t}\n \n-\trte_rwlock_write_lock(RTE_EAL_MEMPOOL_RWLOCK);\n+\trte_mcfg_mempool_write_lock();\n \n \t/*\n \t * reserve a memory zone for this mempool: private data is\n@@ -901,12 +901,12 @@ rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size,\n \trte_mcfg_tailq_write_lock();\n \tTAILQ_INSERT_TAIL(mempool_list, te, next);\n \trte_mcfg_tailq_write_unlock();\n-\trte_rwlock_write_unlock(RTE_EAL_MEMPOOL_RWLOCK);\n+\trte_mcfg_mempool_write_unlock();\n \n \treturn mp;\n \n exit_unlock:\n-\trte_rwlock_write_unlock(RTE_EAL_MEMPOOL_RWLOCK);\n+\trte_mcfg_mempool_write_unlock();\n \trte_free(te);\n \trte_mempool_free(mp);\n \treturn NULL;\n@@ -1268,14 +1268,14 @@ rte_mempool_list_dump(FILE *f)\n \n \tmempool_list = RTE_TAILQ_CAST(rte_mempool_tailq.head, rte_mempool_list);\n \n-\trte_rwlock_read_lock(RTE_EAL_MEMPOOL_RWLOCK);\n+\trte_mcfg_mempool_read_lock();\n \n \tTAILQ_FOREACH(te, mempool_list, next) {\n \t\tmp = (struct rte_mempool *) te->data;\n \t\trte_mempool_dump(f, mp);\n \t}\n \n-\trte_rwlock_read_unlock(RTE_EAL_MEMPOOL_RWLOCK);\n+\trte_mcfg_mempool_read_unlock();\n }\n \n /* search a mempool from its name */\n@@ -1288,7 +1288,7 @@ rte_mempool_lookup(const char *name)\n \n \tmempool_list = RTE_TAILQ_CAST(rte_mempool_tailq.head, rte_mempool_list);\n \n-\trte_rwlock_read_lock(RTE_EAL_MEMPOOL_RWLOCK);\n+\trte_mcfg_mempool_read_lock();\n \n \tTAILQ_FOREACH(te, mempool_list, next) {\n \t\tmp = (struct rte_mempool *) te->data;\n@@ -1296,7 +1296,7 @@ rte_mempool_lookup(const char *name)\n \t\t\tbreak;\n \t}\n \n-\trte_rwlock_read_unlock(RTE_EAL_MEMPOOL_RWLOCK);\n+\trte_mcfg_mempool_read_unlock();\n \n \tif (te == NULL) {\n \t\trte_errno = ENOENT;\n@@ -1315,11 +1315,11 @@ void rte_mempool_walk(void (*func)(struct rte_mempool *, void *),\n \n \tmempool_list = RTE_TAILQ_CAST(rte_mempool_tailq.head, rte_mempool_list);\n \n-\trte_rwlock_read_lock(RTE_EAL_MEMPOOL_RWLOCK);\n+\trte_mcfg_mempool_read_lock();\n \n \tTAILQ_FOREACH_SAFE(te, mempool_list, next, tmp_te) {\n \t\t(*func)((struct rte_mempool *) te->data, arg);\n \t}\n \n-\trte_rwlock_read_unlock(RTE_EAL_MEMPOOL_RWLOCK);\n+\trte_mcfg_mempool_read_unlock();\n }\n", "prefixes": [ "v5", "3/9" ] }{ "id": 56189, "url": "