From patchwork Fri Oct 26 09:53:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Yipeng1" X-Patchwork-Id: 47481 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E14A75323; Fri, 26 Oct 2018 18:59:15 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 3660C2E81 for ; Fri, 26 Oct 2018 18:59:10 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Oct 2018 09:59:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,428,1534834800"; d="scan'208";a="85849485" Received: from skx-yipeng.jf.intel.com ([10.54.81.175]) by orsmga006.jf.intel.com with ESMTP; 26 Oct 2018 09:59:08 -0700 From: Yipeng Wang To: bruce.richardson@intel.com Cc: stephen@networkplumber.org, dev@dpdk.org, yipeng1.wang@intel.com, honnappa.nagarahalli@arm.com, sameh.gobriel@intel.com Date: Fri, 26 Oct 2018 02:53:41 -0700 Message-Id: <1540547626-197189-2-git-send-email-yipeng1.wang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1540547626-197189-1-git-send-email-yipeng1.wang@intel.com> References: <1540494678-64299-1-git-send-email-yipeng1.wang@intel.com> <1540547626-197189-1-git-send-email-yipeng1.wang@intel.com> Subject: [dpdk-dev] [PATCH v4 1/6] hash: fix unnecessary pause X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" There is a rte_pause in hash table reset function. Since the loop is not a polling loop on shared data structure, the rte_pause is not needed. Fixes: b26473ff8f4a ("hash: add reset function") Cc: stable@dpdk.org Signed-off-by: Yipeng Wang Acked-by: Bruce Richardson --- lib/librte_hash/rte_cuckoo_hash.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c index 0648a22..5ddcccd 100644 --- a/lib/librte_hash/rte_cuckoo_hash.c +++ b/lib/librte_hash/rte_cuckoo_hash.c @@ -27,7 +27,6 @@ #include #include #include -#include #include "rte_hash.h" #include "rte_cuckoo_hash.h" @@ -574,14 +573,14 @@ rte_hash_reset(struct rte_hash *h) /* clear the free ring */ while (rte_ring_dequeue(h->free_slots, &ptr) == 0) - rte_pause(); + continue; /* clear free extendable bucket ring and memory */ if (h->ext_table_support) { memset(h->buckets_ext, 0, h->num_buckets * sizeof(struct rte_hash_bucket)); while (rte_ring_dequeue(h->free_ext_bkts, &ptr) == 0) - rte_pause(); + continue; } /* Repopulate the free slots ring. Entry zero is reserved for key misses */