Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/56412/?format=api
http://patchwork.dpdk.org/api/patches/56412/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1562946877-50963-3-git-send-email-gavin.hu@arm.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": "<1562946877-50963-3-git-send-email-gavin.hu@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1562946877-50963-3-git-send-email-gavin.hu@arm.com", "date": "2019-07-12T15:54:37", "name": "[v9,2/2] hash: flush the rings instead of dequeuing one by one", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "11187b7fb40412343593ad6872d8822c84b772c4", "submitter": { "id": 1018, "url": "http://patchwork.dpdk.org/api/people/1018/?format=api", "name": "Gavin Hu", "email": "gavin.hu@arm.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1562946877-50963-3-git-send-email-gavin.hu@arm.com/mbox/", "series": [ { "id": 5479, "url": "http://patchwork.dpdk.org/api/series/5479/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=5479", "date": "2019-07-12T15:54:35", "name": "new ring reset api and use it by hash", "version": 9, "mbox": "http://patchwork.dpdk.org/series/5479/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/56412/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/56412/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 7FC7F1BE1D;\n\tFri, 12 Jul 2019 17:55:02 +0200 (CEST)", "from foss.arm.com (foss.arm.com [217.140.110.172])\n\tby dpdk.org (Postfix) with ESMTP id F3B721BE0D;\n\tFri, 12 Jul 2019 17:54:59 +0200 (CEST)", "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n\tby usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ACCED1424;\n\tFri, 12 Jul 2019 08:54:58 -0700 (PDT)", "from net-arm-thunderx2.shanghai.arm.com\n\t(net-arm-thunderx2.shanghai.arm.com [10.169.40.40])\n\tby usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id\n\t6DDE43F246; Fri, 12 Jul 2019 08:54:56 -0700 (PDT)" ], "From": "Gavin Hu <gavin.hu@arm.com>", "To": "dev@dpdk.org", "Cc": "nd@arm.com, thomas@monjalon.net, jerinj@marvell.com,\n\themant.agrawal@nxp.com, nipun.gupta@nxp.com,\n\tHonnappa.Nagarahalli@arm.com, \n\tgavin.hu@arm.com, i.maximets@samsung.com, olivier.matz@6wind.com,\n\tstable@dpdk.org", "Date": "Fri, 12 Jul 2019 23:54:37 +0800", "Message-Id": "<1562946877-50963-3-git-send-email-gavin.hu@arm.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": [ "<1562946877-50963-1-git-send-email-gavin.hu@arm.com>", "<20181212062404.30243-1-gavin.hu@arm.com>" ], "References": [ "<1562946877-50963-1-git-send-email-gavin.hu@arm.com>", "<20181212062404.30243-1-gavin.hu@arm.com>" ], "Subject": "[dpdk-dev] [PATCH v9 2/2] hash: flush the rings instead of\n\tdequeuing one by one", "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": "Within rte_hash_reset, calling a while loop to dequeue one by\none from the ring, while not using them at all, is wasting cycles,\nThe patch just flush the ring by resetting the indices can save cpu\ncycles.\n\nFixes: b26473ff8f4a (\"hash: add reset function\")\nFixes: 75706568a7eb (\"hash: add extendable bucket feature\")\nCc: stable@dpdk.org\n\nSigned-off-by: Gavin Hu <gavin.hu@arm.com>\nReviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\nAcked-by: Yipeng Wang <yipeng1.wang@intel.com>\n---\n lib/librte_hash/Makefile | 2 +-\n lib/librte_hash/meson.build | 3 +++\n lib/librte_hash/rte_cuckoo_hash.c | 11 ++++-------\n 3 files changed, 8 insertions(+), 8 deletions(-)", "diff": "diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile\nindex c8c435d..5669d83 100644\n--- a/lib/librte_hash/Makefile\n+++ b/lib/librte_hash/Makefile\n@@ -6,7 +6,7 @@ include $(RTE_SDK)/mk/rte.vars.mk\n # library name\n LIB = librte_hash.a\n \n-CFLAGS += -O3\n+CFLAGS += -O3 -DALLOW_EXPERIMENTAL_API\n CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)\n LDLIBS += -lrte_eal -lrte_ring\n \ndiff --git a/lib/librte_hash/meson.build b/lib/librte_hash/meson.build\nindex efc06ed..ebf70de 100644\n--- a/lib/librte_hash/meson.build\n+++ b/lib/librte_hash/meson.build\n@@ -14,3 +14,6 @@ headers = files('rte_cmp_arm64.h',\n \n sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c')\n deps += ['ring']\n+\n+# rte ring reset is not yet part of stable API\n+allow_experimental_apis = true\ndiff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c\nindex d250938..87a4c01 100644\n--- a/lib/librte_hash/rte_cuckoo_hash.c\n+++ b/lib/librte_hash/rte_cuckoo_hash.c\n@@ -570,7 +570,6 @@ __hash_rw_reader_unlock(const struct rte_hash *h)\n void\n rte_hash_reset(struct rte_hash *h)\n {\n-\tvoid *ptr;\n \tuint32_t tot_ring_cnt, i;\n \n \tif (h == NULL)\n@@ -581,16 +580,14 @@ rte_hash_reset(struct rte_hash *h)\n \tmemset(h->key_store, 0, h->key_entry_size * (h->entries + 1));\n \t*h->tbl_chng_cnt = 0;\n \n-\t/* clear the free ring */\n-\twhile (rte_ring_dequeue(h->free_slots, &ptr) == 0)\n-\t\tcontinue;\n+\t/* reset the free ring */\n+\trte_ring_reset(h->free_slots);\n \n-\t/* clear free extendable bucket ring and memory */\n+\t/* flush free extendable bucket ring and memory */\n \tif (h->ext_table_support) {\n \t\tmemset(h->buckets_ext, 0, h->num_buckets *\n \t\t\t\t\t\tsizeof(struct rte_hash_bucket));\n-\t\twhile (rte_ring_dequeue(h->free_ext_bkts, &ptr) == 0)\n-\t\t\tcontinue;\n+\t\trte_ring_reset(h->free_ext_bkts);\n \t}\n \n \t/* Repopulate the free slots ring. Entry zero is reserved for key misses */\n", "prefixes": [ "v9", "2/2" ] }{ "id": 56412, "url": "