Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/7377/?format=api
https://patches.dpdk.org/api/patches/7377/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1443802033-245423-1-git-send-email-pablo.de.lara.guarch@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": "<1443802033-245423-1-git-send-email-pablo.de.lara.guarch@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1443802033-245423-1-git-send-email-pablo.de.lara.guarch@intel.com", "date": "2015-10-02T16:07:13", "name": "[dpdk-dev] hash: free internal ring when freeing hash", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "38ef9f35fef0033426b8b2e499ce34587f8688e1", "submitter": { "id": 9, "url": "https://patches.dpdk.org/api/people/9/?format=api", "name": "De Lara Guarch, Pablo", "email": "pablo.de.lara.guarch@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1443802033-245423-1-git-send-email-pablo.de.lara.guarch@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/7377/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/7377/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 244EF8E65;\n\tFri, 2 Oct 2015 18:07:20 +0200 (CEST)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 591568D99\n\tfor <dev@dpdk.org>; Fri, 2 Oct 2015 18:07:19 +0200 (CEST)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga103.fm.intel.com with ESMTP; 02 Oct 2015 09:07:16 -0700", "from sie-lab-214-036.ir.intel.com (HELO\n\tsie-lab-214-174.ir.intel.com) ([10.237.214.36])\n\tby fmsmga001.fm.intel.com with ESMTP; 02 Oct 2015 09:07:14 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.17,623,1437462000\"; d=\"scan'208\";a=\"802274993\"", "From": "Pablo de Lara <pablo.de.lara.guarch@intel.com>", "To": "dev@dpdk.org", "Date": "Fri, 2 Oct 2015 17:07:13 +0100", "Message-Id": "<1443802033-245423-1-git-send-email-pablo.de.lara.guarch@intel.com>", "X-Mailer": "git-send-email 2.4.3", "Subject": "[dpdk-dev] [PATCH] hash: free internal ring when freeing hash", "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": "Since freeing a ring is now possible, then when freeing\na hash table, its internal ring can be freed as well.\nTherefore when a new table, with the same name as a previously\nfreed table, is created, there is no need to look up\nthe already allocated ring.\n\nSigned-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>\n---\n\nThis patch depends on patch \"ring: add function to free a ring\"\n(http://dpdk.org/dev/patchwork/patch/7376/)\n\n lib/librte_hash/rte_cuckoo_hash.c | 11 +++--------\n 1 file changed, 3 insertions(+), 8 deletions(-)", "diff": "diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c\nindex 7019763..409fc2e 100644\n--- a/lib/librte_hash/rte_cuckoo_hash.c\n+++ b/lib/librte_hash/rte_cuckoo_hash.c\n@@ -180,7 +180,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \tstruct rte_hash_list *hash_list;\n \tstruct rte_ring *r = NULL;\n \tchar hash_name[RTE_HASH_NAMESIZE];\n-\tvoid *ptr, *k = NULL;\n+\tvoid *k = NULL;\n \tvoid *buckets = NULL;\n \tchar ring_name[RTE_RING_NAMESIZE];\n \tunsigned i;\n@@ -288,13 +288,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n #endif\n \n \tsnprintf(ring_name, sizeof(ring_name), \"HT_%s\", params->name);\n-\tr = rte_ring_lookup(ring_name);\n-\tif (r != NULL) {\n-\t\t/* clear the free ring */\n-\t\twhile (rte_ring_dequeue(r, &ptr) == 0)\n-\t\t\trte_pause();\n-\t} else\n-\t\tr = rte_ring_create(ring_name, rte_align32pow2(params->entries + 1),\n+\tr = rte_ring_create(ring_name, rte_align32pow2(params->entries + 1),\n \t\t\t\tparams->socket_id, 0);\n \tif (r == NULL) {\n \t\tRTE_LOG(ERR, HASH, \"memory allocation failed\\n\");\n@@ -363,6 +357,7 @@ rte_hash_free(struct rte_hash *h)\n \n \trte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);\n \n+\trte_ring_free(h->free_slots);\n \trte_free(h->key_store);\n \trte_free(h->buckets);\n \trte_free(h);\n", "prefixes": [ "dpdk-dev" ] }{ "id": 7377, "url": "