From patchwork Thu Sep 6 17:12:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 146116 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp126080ljw; Thu, 6 Sep 2018 10:12:37 -0700 (PDT) X-Google-Smtp-Source: ANB0VdailGWe4RXHgWh/uLF0Htd2o7VG0Id0aAc2NaYDazUSKV09t72nSNjL8iP/WoK1qXh+2+tq X-Received: by 2002:a1c:7e13:: with SMTP id z19-v6mr2632164wmc.156.1536253957187; Thu, 06 Sep 2018 10:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536253957; cv=none; d=google.com; s=arc-20160816; b=fv0gh/j5Ew5Lf6PnFfD6JfBinAdqP5C4LBOiRc5S0MIb7VkQopcMcmumi5pPTlMIcj nZg7atY4VotbcJ0FrdvLbJtlQ1MfckmqzLlm+qIBhhOL13r8ocO2g+51O4MLaJLGPNkG qbhsM6Fl3qpXsoFbGaR3c6BYTDWPHxkzMf2tKIHInP7DWG/JS+n6oia/qorphDjPWjKZ pn6710SiNPwBZc/nvgtrIPi0mz5TU/rzb3O1Iptby+6S6aTkFCZ702zUW/drWcd1PlJN GWgZmx+TrlOSQLazagTvkcvFJms53ssr+uO78guAu2wEVEzX+aj70pWuUCvNeRJyd85O BVvw== 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=YjLGn6/Hbns7UlGHvb8WY/F7VhAmRV6UvqdoyQwGuCQ=; b=TcRisjTXCJnifHo/z9VYxzg2cB3sC4JY6Q8TNn8GBkvXwIStow16/PC/ILZ1op22cY 7ahM4rvn2HCOjZ8wYAkFQIB47cQ3wgTZH7qu+NYq/6P2jj2LhEKQNQuw0KzhExOdQwrY mX7khfVAffAg8HsHsOmaZSPKCCZlRvaKZjXe+ESetxOQj59yv0nrXRzfEK5wnaXFut0b 7UtsRrpTlUtPzw4mGMUXkf2hR68z2kjjn0/DFmhP9wYXqIrvxd1wJ5NuUrPNtAqMq9Na CfvR+EQxbuqqeYe30ubIScR6r1htYukXKBrbr+lKgvhC6oOe69kngtKE7WmVp5tkDMHj u6NA== 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 n18-v6si5178869wrq.29.2018.09.06.10.12.36; Thu, 06 Sep 2018 10:12:37 -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 348834C80; Thu, 6 Sep 2018 19:12:32 +0200 (CEST) Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id 31D2D4C77 for ; Thu, 6 Sep 2018 19:12:30 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8BB047A9; Thu, 6 Sep 2018 10:12:29 -0700 (PDT) Received: from 2p2660v4-1.austin.arm.com (2p2660v4-1.austin.arm.com [10.118.12.164]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1E2333F557; Thu, 6 Sep 2018 10:12:29 -0700 (PDT) From: Honnappa Nagarahalli To: bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com Cc: dev@dpdk.org, honnappa.nagarahalli@dpdk.org, gavin.hu@arm.com, steve.capper@arm.com, ola.liljedahl@arm.com, nd@arm.com, Honnappa Nagarahalli Date: Thu, 6 Sep 2018 12:12:15 -0500 Message-Id: <1536253938-192391-2-git-send-email-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536253938-192391-1-git-send-email-honnappa.nagarahalli@arm.com> References: <1536253938-192391-1-git-send-email-honnappa.nagarahalli@arm.com> Subject: [dpdk-dev] [PATCH 1/4] hash: correct key store element alignment 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" Correct the key store array element alignment. This is required to make 'pdata' in 'struct rte_hash_key' align on the correct boundary. Signed-off-by: Honnappa Nagarahalli Reviewed-by: Gavin Hu Reviewed-by: Ola Liljedahl Reviewed-by: Steve Capper --- lib/librte_hash/rte_cuckoo_hash.c | 4 +++- lib/librte_hash/rte_cuckoo_hash.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c index f7b86c8..33acfc9 100644 --- a/lib/librte_hash/rte_cuckoo_hash.c +++ b/lib/librte_hash/rte_cuckoo_hash.c @@ -189,7 +189,9 @@ rte_hash_create(const struct rte_hash_parameters *params) goto err_unlock; } - const uint32_t key_entry_size = sizeof(struct rte_hash_key) + params->key_len; + const uint32_t key_entry_size = + RTE_ALIGN(sizeof(struct rte_hash_key) + params->key_len, + KEY_ALIGNMENT); const uint64_t key_tbl_size = (uint64_t) key_entry_size * num_key_slots; k = rte_zmalloc_socket(NULL, key_tbl_size, diff --git a/lib/librte_hash/rte_cuckoo_hash.h b/lib/librte_hash/rte_cuckoo_hash.h index b43f467..b0c7ef9 100644 --- a/lib/librte_hash/rte_cuckoo_hash.h +++ b/lib/librte_hash/rte_cuckoo_hash.h @@ -125,7 +125,7 @@ struct rte_hash_key { }; /* Variable key size */ char key[0]; -} __attribute__((aligned(KEY_ALIGNMENT))); +}; /* All different signature compare functions */ enum rte_hash_sig_compare_function {