From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 8A971A0526;
	Thu,  9 Jul 2020 03:39:51 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id AE5CC1DA57;
	Thu,  9 Jul 2020 03:39:50 +0200 (CEST)
Received: from mga04.intel.com (mga04.intel.com [192.55.52.120])
 by dpdk.org (Postfix) with ESMTP id EDECD1D9DA;
 Thu,  9 Jul 2020 03:39:47 +0200 (CEST)
IronPort-SDR: gH9flcBoOY65Y0caLxUeT2BOsifZ/7w4js8KDYFhLDJnyQrCbOf3WAcFyYL6eu0796P590LUSn
 L3hEInkBhWnw==
X-IronPort-AV: E=McAfee;i="6000,8403,9676"; a="145415476"
X-IronPort-AV: E=Sophos;i="5.75,330,1589266800"; d="scan'208";a="145415476"
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga006.jf.intel.com ([10.7.209.51])
 by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 08 Jul 2020 18:39:46 -0700
IronPort-SDR: vv0rWq5WCkVL7p9OPS6NNLmcToQWMuoK0UvNmDxPaaWWfRCyQNVDCafMAIXD4gz68afnY4MK7H
 IMoNrNUcEF8w==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.75,330,1589266800"; d="scan'208";a="283977696"
Received: from dpdk-xuting-second.sh.intel.com ([10.67.116.154])
 by orsmga006.jf.intel.com with ESMTP; 08 Jul 2020 18:39:44 -0700
From: Ting Xu <ting.xu@intel.com>
To: dev@dpdk.org
Cc: cristian.dumitrescu@intel.com, Ting Xu <ting.xu@intel.com>, stable@dpdk.org
Date: Thu,  9 Jul 2020 09:43:34 +0800
Message-Id: <20200709014334.13543-1-ting.xu@intel.com>
X-Mailer: git-send-email 2.17.1
Subject: [dpdk-dev] [PATCH v1] lib/table: fix cache alignment issue
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>,
 <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>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

When create softnic hash table with 16 keys, it failed on 32bit
environment because of the structure rte_bucket_4_16 alignment
issue. Add __rte_cache_aligned to ensure correct cache align.

Fixes: 8aa327214c ("table: hash")
Cc: stable@dpdk.org

Signed-off-by: Ting Xu <ting.xu@intel.com>
---
 lib/librte_table/rte_table_hash_key16.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_table/rte_table_hash_key16.c b/lib/librte_table/rte_table_hash_key16.c
index 2cca1c924..5e1665c15 100644
--- a/lib/librte_table/rte_table_hash_key16.c
+++ b/lib/librte_table/rte_table_hash_key16.c
@@ -44,7 +44,7 @@ struct rte_bucket_4_16 {
 	uint64_t key[4][2];
 
 	/* Cache line 2 */
-	uint8_t data[0];
+	uint8_t data[0] __rte_cache_aligned;
 };
 
 struct rte_table_hash {
-- 
2.17.1