From patchwork Tue Jun 25 21:15:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 167757 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp40446ilk; Tue, 25 Jun 2019 14:16:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQWEDhFNayGhTHKeR+mhUiFXO5qygtGKFnTrpsLJ8x4S7jAoluIey5HTuvzoetiaEIavzR X-Received: by 2002:a1c:5f87:: with SMTP id t129mr298987wmb.150.1561497362734; Tue, 25 Jun 2019 14:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561497362; cv=none; d=google.com; s=arc-20160816; b=Tvv2PW0ZOPV8RGb9Zk+speUaa7IDsuao+WrQAwn/FH/B5pQ5lzTAPt9pwtYyVTSGCt y+DZfF0J5WEcRbmZdSn9SUH7fHYL0TmlhR4LoT93qoaokigAmCh7p+4YZ/nrv4PdamHg 1uxfK1ij7WMHhIBMTsCi46DK/0H9roH5rRUmWvkJw+zAGqXv0/iunU7U+V5ll/PVg7wN ee0MtR+n2wGj/w4CQedY+VxTu7Dksiy/gbhsuN7z9M8gLSqVDX559Vn/bB9cboxuOuys p29pEQSmrL9nCorE9Um5s7A9dkgqLhhAx/ntlp0F484clmXauAs3lC36YGspTrUl1gp9 Emig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=49OU9oztnzmhPSrA/rdADjzSaSU9BFWOV9g8IWmdHEY=; b=N8fvupmJfFOaCOSr3PQpxCkxsNZsP4+kJhzlhM1xn2kMGHt4I72rVhOrzhsRzx+Vbb sr5EoD0gYyAPFT6oRga6gBwHY38PB9IbA/jvySgpq07+H4cX4+lCmtQ6NTJQY3DAP+eY ttGX9xPTkwbqaJcxdtK4kuf7DYEKY6+QvWwt8/oMJgHiYDnlemTmvdCveLV/gkmxbYib oHKztLLQHOEauoVSYv9iW5xan9jyUgMSsmiHqoEUFm1kjlq5TnALJt5KfCN0WZTfRNYY u4vmnCIpUfonbeBQ69/Xzy6TrkGNppAPKzgzK6Y1DuzSn3LDSmtK90nkenroDMESyUWq fW7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id k8si1174983wrx.382.2019.06.25.14.16.02; Tue, 25 Jun 2019 14:16:02 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E76771B9AF; Tue, 25 Jun 2019 23:15:46 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id C4C581B99D; Tue, 25 Jun 2019 23:15:40 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2AD89106F; Tue, 25 Jun 2019 14:15:40 -0700 (PDT) Received: from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com [10.118.12.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 195F73F7D8; Tue, 25 Jun 2019 14:15:40 -0700 (PDT) From: Honnappa Nagarahalli To: yipeng1.wang@intel.com, sameh.gobriel@intel.com, bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com, honnappa.nagarahalli@arm.com Cc: gavin.hu@arm.com, ruifeng.wang@arm.com, dev@dpdk.org, nd@arm.com, stable@dpdk.org Date: Tue, 25 Jun 2019 16:15:20 -0500 Message-Id: <20190625211520.43181-4-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190625211520.43181-1-honnappa.nagarahalli@arm.com> References: <20190625211520.43181-1-honnappa.nagarahalli@arm.com> Subject: [dpdk-dev] [PATCH 3/3] lib/hash: adjust tbl_chng_cnt position 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" tbl_chng_cnt is one of the first elements of the structure used in the lookup. Move it to the beginning of the cache line to gain performance. Fixes: e605a1d36 ("hash: add lock-free r/w concurrency") Cc: stable@dpdk.org Signed-off-by: Honnappa Nagarahalli Reviewed-by: Gavin Hu Tested-by: Ruifeng Wang --- lib/librte_hash/rte_cuckoo_hash.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/lib/librte_hash/rte_cuckoo_hash.h b/lib/librte_hash/rte_cuckoo_hash.h index fb19bb27d..af6451b5c 100644 --- a/lib/librte_hash/rte_cuckoo_hash.h +++ b/lib/librte_hash/rte_cuckoo_hash.h @@ -170,7 +170,9 @@ struct rte_hash { /* Fields used in lookup */ - uint32_t key_len __rte_cache_aligned; + uint32_t *tbl_chng_cnt __rte_cache_aligned; + /**< Indicates if the hash table changed from last read. */ + uint32_t key_len; /**< Length of hash key. */ uint8_t hw_trans_mem_support; /**< If hardware transactional memory is used. */ @@ -218,8 +220,6 @@ struct rte_hash { * is piggy-backed to freeing of the key index. */ uint32_t *ext_bkt_to_free; - uint32_t *tbl_chng_cnt; - /**< Indicates if the hash table changed from last read. */ } __rte_cache_aligned; struct queue_node {