Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/12856/?format=api
http://patches.dpdk.org/api/patches/12856/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1463569496-31086-25-git-send-email-olivier.matz@6wind.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": "<1463569496-31086-25-git-send-email-olivier.matz@6wind.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1463569496-31086-25-git-send-email-olivier.matz@6wind.com", "date": "2016-05-18T11:04:45", "name": "[dpdk-dev,v3,24/35] mempool: introduce a function to free a pool", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "66fff284a9288595ea12d4b5bfe85ca2a55de353", "submitter": { "id": 8, "url": "http://patches.dpdk.org/api/people/8/?format=api", "name": "Olivier Matz", "email": "olivier.matz@6wind.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1463569496-31086-25-git-send-email-olivier.matz@6wind.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/12856/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/12856/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 589C4ADD8;\n\tWed, 18 May 2016 13:05:39 +0200 (CEST)", "from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com\n\t[62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 1EFD4E07\n\tfor <dev@dpdk.org>; Wed, 18 May 2016 13:05:16 +0200 (CEST)", "from glumotte.dev.6wind.com (unknown [10.16.0.195])\n\tby proxy.6wind.com (Postfix) with ESMTP id 07C0029BB4;\n\tWed, 18 May 2016 13:03:39 +0200 (CEST)" ], "From": "Olivier Matz <olivier.matz@6wind.com>", "To": "dev@dpdk.org", "Cc": "bruce.richardson@intel.com, stephen@networkplumber.org,\n\tkeith.wiles@intel.com", "Date": "Wed, 18 May 2016 13:04:45 +0200", "Message-Id": "<1463569496-31086-25-git-send-email-olivier.matz@6wind.com>", "X-Mailer": "git-send-email 2.8.0.rc3", "In-Reply-To": "<1463569496-31086-1-git-send-email-olivier.matz@6wind.com>", "References": "<1460629199-32489-1-git-send-email-olivier.matz@6wind.com>\n\t<1463569496-31086-1-git-send-email-olivier.matz@6wind.com>", "Subject": "[dpdk-dev] [PATCH v3 24/35] mempool: introduce a function to free a\n\tpool", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://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": "<http://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": "Introduce rte_mempool_free() that:\n\n- unlink the mempool from the global list if it is found\n- free all the memory chunks using their free callbacks\n- free the internal ring\n- free the memzone containing the mempool\n\nCurrently this function is only used in error cases when\ncreating a new mempool, but it will be made public later\nin the patch series.\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n lib/librte_mempool/rte_mempool.c | 37 ++++++++++++++++++++++++++++++-------\n 1 file changed, 30 insertions(+), 7 deletions(-)", "diff": "diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex 891458a..4aff53b 100644\n--- a/lib/librte_mempool/rte_mempool.c\n+++ b/lib/librte_mempool/rte_mempool.c\n@@ -622,6 +622,35 @@ rte_mempool_populate_default(struct rte_mempool *mp)\n \treturn ret;\n }\n \n+/* free a mempool */\n+static void\n+rte_mempool_free(struct rte_mempool *mp)\n+{\n+\tstruct rte_mempool_list *mempool_list = NULL;\n+\tstruct rte_tailq_entry *te;\n+\n+\tif (mp == NULL)\n+\t\treturn;\n+\n+\tmempool_list = RTE_TAILQ_CAST(rte_mempool_tailq.head, rte_mempool_list);\n+\trte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);\n+\t/* find out tailq entry */\n+\tTAILQ_FOREACH(te, mempool_list, next) {\n+\t\tif (te->data == (void *)mp)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (te != NULL) {\n+\t\tTAILQ_REMOVE(mempool_list, te, next);\n+\t\trte_free(te);\n+\t}\n+\trte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);\n+\n+\trte_mempool_free_memchunks(mp);\n+\trte_ring_free(mp->ring);\n+\trte_memzone_free(mp->mz);\n+}\n+\n /*\n * Create the mempool over already allocated chunk of memory.\n * That external memory buffer can consists of physically disjoint pages.\n@@ -781,13 +810,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size,\n \n exit_unlock:\n \trte_rwlock_write_unlock(RTE_EAL_MEMPOOL_RWLOCK);\n-\tif (mp != NULL) {\n-\t\trte_mempool_free_memchunks(mp);\n-\t\trte_ring_free(mp->ring);\n-\t}\n-\trte_free(te);\n-\tif (mz != NULL)\n-\t\trte_memzone_free(mz);\n+\trte_mempool_free(mp);\n \n \treturn NULL;\n }\n", "prefixes": [ "dpdk-dev", "v3", "24/35" ] }{ "id": 12856, "url": "