From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 83DB3A04DD for ; Wed, 28 Oct 2020 11:53:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 78EF4CA14; Wed, 28 Oct 2020 11:53:33 +0100 (CET) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by dpdk.org (Postfix) with ESMTP id 40848CA0C for ; Wed, 28 Oct 2020 11:53:32 +0100 (CET) Received: by mail-wm1-f45.google.com with SMTP id 13so4106475wmf.0 for ; Wed, 28 Oct 2020 03:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/eIMLgNwSY4hC8NcSNIBPOOg0Hiq8Gkn0f3YABCYAW4=; b=egH5IejrOFoPTqgDr0UBZ7r7NqxEPsjxAWzf+1dSR7M/ud9qr3DyqbrLlaO/Jq+Osa 7VHhTauPo8TKe6niF3wkmOHqHTw8wRRjB807GGoueEkXCVm3upbzZt7ZRjKqxZ0VnoZQ OHhbg0eid+TBeWqb32/mJo7UX5DETr7F43DFxQ4vzsrxpttrUCG/6iy3xCKAmcVbV21J n7naZYohhnwJ+dHzNgmGFA1nEO7/tPxFasVGkfGsDEBuyjMD96gBiQIH6SU0RMfi6Dcy zAmCcXpvFiHV+MAT90GvkKCz1VEFxLQPxUFOGUf+El1zF1xOnT64lH9rRL+eakZknq/U Ufsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/eIMLgNwSY4hC8NcSNIBPOOg0Hiq8Gkn0f3YABCYAW4=; b=lU8T+rwe9MU26uRW5iWdKqG8IoCTy98JmIstCy1vgGn2dC1NiXR8q1O9e9ZYFVwGae C31DYtsBLmrBpt8c2LmJravIkXtb22BdGGcJW303b90uU5eurB0pW5h4OCy4hNsm4B0O d9wrgOXS/i8M96vT4qkIUnnTUwMWdG/+aTOHKtKbDbdc+2w27D4t2xjd/IpjZsHUELWQ XGLj5X8rrcKtMwTWQHRLJCfXE+rs11RFI8w/9NQbnkAbCvc78fjO6afCQyixuaLDnPIQ Uzo71FfhGNmWf61qGVloZfGV34BrHnYCF+xDjz14OTR+TOkTPN/A2yaQ+qBAPxZXHGOK muCA== X-Gm-Message-State: AOAM531ZXJRCfzM1StOSHivTM/J+aRtRiOcM/ngOT+R/0xxdhzDgoEYh XgpM0JOrHefETXK8o/HtC9s= X-Google-Smtp-Source: ABdhPJzuf4egpT9winixQpxmeaPX/zZF4uN6cCwIZZeL8sUTxebL3h4Swpjisli8WdeAPJhGjABG3w== X-Received: by 2002:a05:600c:d3:: with SMTP id u19mr7634854wmm.150.1603882411029; Wed, 28 Oct 2020 03:53:31 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id q5sm6821689wrs.54.2020.10.28.03.53.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:53:30 -0700 (PDT) From: luca.boccassi@gmail.com To: Ting Xu Cc: Cristian Dumitrescu , dpdk stable Date: Wed, 28 Oct 2020 10:44:59 +0000 Message-Id: <20201028104606.3504127-140-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'table: fix hash for 32-bit' has been queued to stable release 19.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/30/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From e4510620eb2e0bca82bba9c95f424fc0ad4934a7 Mon Sep 17 00:00:00 2001 From: Ting Xu Date: Wed, 22 Jul 2020 10:16:28 +0800 Subject: [PATCH] table: fix hash for 32-bit [ upstream commit 99541c3028d741a09fe5dca95e79d8d020130173 ] When create softnic hash table with 16 keys, it failed on 32-bit environment, because the pointer field in structure rte_bucket_4_16 is only 32 bits. Add a padding field in 32-bit environment to keep the structure to a multiple of 64 bytes. Apply this to 8-byte and 32-byte key hash function as well. Fixes: 8aa327214c ("table: hash") Signed-off-by: Ting Xu Acked-by: Cristian Dumitrescu --- lib/librte_table/rte_table_hash_key16.c | 17 +++++++++++++++++ lib/librte_table/rte_table_hash_key32.c | 17 +++++++++++++++++ lib/librte_table/rte_table_hash_key8.c | 16 ++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/lib/librte_table/rte_table_hash_key16.c b/lib/librte_table/rte_table_hash_key16.c index 2cca1c924a..c4384b114d 100644 --- a/lib/librte_table/rte_table_hash_key16.c +++ b/lib/librte_table/rte_table_hash_key16.c @@ -33,6 +33,7 @@ #endif +#ifdef RTE_ARCH_64 struct rte_bucket_4_16 { /* Cache line 0 */ uint64_t signature[4 + 1]; @@ -46,6 +47,22 @@ struct rte_bucket_4_16 { /* Cache line 2 */ uint8_t data[0]; }; +#else +struct rte_bucket_4_16 { + /* Cache line 0 */ + uint64_t signature[4 + 1]; + uint64_t lru_list; + struct rte_bucket_4_16 *next; + uint32_t pad; + uint64_t next_valid; + + /* Cache line 1 */ + uint64_t key[4][2]; + + /* Cache line 2 */ + uint8_t data[0]; +}; +#endif struct rte_table_hash { struct rte_table_stats stats; diff --git a/lib/librte_table/rte_table_hash_key32.c b/lib/librte_table/rte_table_hash_key32.c index a137c50284..3e0031fe1e 100644 --- a/lib/librte_table/rte_table_hash_key32.c +++ b/lib/librte_table/rte_table_hash_key32.c @@ -33,6 +33,7 @@ #endif +#ifdef RTE_ARCH_64 struct rte_bucket_4_32 { /* Cache line 0 */ uint64_t signature[4 + 1]; @@ -46,6 +47,22 @@ struct rte_bucket_4_32 { /* Cache line 3 */ uint8_t data[0]; }; +#else +struct rte_bucket_4_32 { + /* Cache line 0 */ + uint64_t signature[4 + 1]; + uint64_t lru_list; + struct rte_bucket_4_32 *next; + uint32_t pad; + uint64_t next_valid; + + /* Cache lines 1 and 2 */ + uint64_t key[4][4]; + + /* Cache line 3 */ + uint8_t data[0]; +}; +#endif struct rte_table_hash { struct rte_table_stats stats; diff --git a/lib/librte_table/rte_table_hash_key8.c b/lib/librte_table/rte_table_hash_key8.c index 1811ad8d05..34e3ed1af9 100644 --- a/lib/librte_table/rte_table_hash_key8.c +++ b/lib/librte_table/rte_table_hash_key8.c @@ -31,6 +31,7 @@ #endif +#ifdef RTE_ARCH_64 struct rte_bucket_4_8 { /* Cache line 0 */ uint64_t signature; @@ -43,6 +44,21 @@ struct rte_bucket_4_8 { /* Cache line 1 */ uint8_t data[0]; }; +#else +struct rte_bucket_4_8 { + /* Cache line 0 */ + uint64_t signature; + uint64_t lru_list; + struct rte_bucket_4_8 *next; + uint32_t pad; + uint64_t next_valid; + + uint64_t key[4]; + + /* Cache line 1 */ + uint8_t data[0]; +}; +#endif struct rte_table_hash { struct rte_table_stats stats; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:16.082325914 +0000 +++ 0140-table-fix-hash-for-32-bit.patch 2020-10-28 10:35:11.712833086 +0000 @@ -1,8 +1,10 @@ -From 99541c3028d741a09fe5dca95e79d8d020130173 Mon Sep 17 00:00:00 2001 +From e4510620eb2e0bca82bba9c95f424fc0ad4934a7 Mon Sep 17 00:00:00 2001 From: Ting Xu Date: Wed, 22 Jul 2020 10:16:28 +0800 Subject: [PATCH] table: fix hash for 32-bit +[ upstream commit 99541c3028d741a09fe5dca95e79d8d020130173 ] + When create softnic hash table with 16 keys, it failed on 32-bit environment, because the pointer field in structure rte_bucket_4_16 is only 32 bits. Add a padding field in 32-bit environment to keep @@ -10,7 +12,6 @@ 32-byte key hash function as well. Fixes: 8aa327214c ("table: hash") -Cc: stable@dpdk.org Signed-off-by: Ting Xu Acked-by: Cristian Dumitrescu