From patchwork Fri Oct 12 06:31:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 148718 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp368230lji; Thu, 11 Oct 2018 23:32:36 -0700 (PDT) X-Google-Smtp-Source: ACcGV60/mS2Y9x2KaDfu7f+e83aOUUlbC5Jn/fCc0KaGQ1sVa1g5WpvDv8UemKEiA1k0nKyv2dta X-Received: by 2002:a50:a6d5:: with SMTP id f21-v6mr6893809edc.225.1539325956867; Thu, 11 Oct 2018 23:32:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539325956; cv=none; d=google.com; s=arc-20160816; b=je7EWgPHprBzB2XLvEyuvSJSsy4nJyIqzXHKs8pCzXn74kFqqovYULSS4V/t9Scmym 3IbVV0nk8LAFq6gAi9rhsDjCnPhCq/ryHde0xcJZw8Cn1j/hwl4plnlKICYYpAqXN4yu JwEzJZXXb4tuoQ/o40e4W47x2HhI3F5RuoEhMKQcMhkapb0SQIdWnufmcd77Yds4V8AT ztofTJn9ow9BeugEw61pYSdAsVJAcKWFhebixWGstJEFcVU8Ls4a8Q2XlHqi3P3miGNX KbSisjBUD4S/h2cKDEAejnPh9p16UB7IDEtKg1jU6cyazmTTvzQqtnsSrDzQdkedlBkv 66Xw== 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=evikmZaVurXm9knpYgMdLzxCY8RbrJdW+xEjINcXuJw=; b=D4SxrhNSpuf2MwLd3iA9DF9UyJDEySfBc/wyaHyI5qB/nacOKo+wkKWZf28Pn3iC4J TpcYa3+grmYpj9qcNVU58/93HXpn6WN7gAW/lna/UtZ7cHQNnRZXBqdN8AhJl50M8bjN CArCBdJBGd2tfQnN8FRkweQdZoZwiewxo/jdAeKd0paEmSGtHphREizkmy3qqL1dcPea dmgmbnA0j9QtmFErxYZmxR5mgPC3EpklPTJWM5l9hK+rZwLt9EUyxr6ZbYPBy8XCMQqY EOoEuRRm8/BvJv5LLTFCLMvFWGzOm2R+Q97SyWTF1uzrgXQQM+L1tLsgWasicKFkZo4z 1Chw== 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 h22-v6si503587eda.202.2018.10.11.23.32.36; Thu, 11 Oct 2018 23:32:36 -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 1CD8A1B116; Fri, 12 Oct 2018 08:32:17 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id 0522C6833 for ; Fri, 12 Oct 2018 08:32:11 +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 7735EEBD; Thu, 11 Oct 2018 23:32:10 -0700 (PDT) Received: from 2p2660v4-1.austin.arm.com (2p2660v4-1.austin.arm.com [10.118.12.190]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 127D63F5B3; Thu, 11 Oct 2018 23:32:10 -0700 (PDT) From: Honnappa Nagarahalli To: bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com Cc: dev@dpdk.org, yipeng1.wang@intel.com, honnappa.nagarahalli@arm.com, dharmik.thakkar@arm.com, gavin.hu@arm.com, nd@arm.com Date: Fri, 12 Oct 2018 01:31:54 -0500 Message-Id: <1539325918-125438-4-git-send-email-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539325918-125438-1-git-send-email-honnappa.nagarahalli@arm.com> References: <1539325918-125438-1-git-send-email-honnappa.nagarahalli@arm.com> Subject: [dpdk-dev] [PATCH v3 3/7] 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 Reviewed-by: Yipeng Wang diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c index 8de0de3..13646d0 100644 --- a/lib/librte_hash/rte_cuckoo_hash.c +++ b/lib/librte_hash/rte_cuckoo_hash.c @@ -279,7 +279,9 @@ rte_hash_create(const struct rte_hash_parameters *params) rte_ring_sp_enqueue(r_ext, (void *)((uintptr_t) i)); } - 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 5225402..b823d37 100644 --- a/lib/librte_hash/rte_cuckoo_hash.h +++ b/lib/librte_hash/rte_cuckoo_hash.h @@ -123,7 +123,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 {