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 83C0EA04B1 for ; Thu, 5 Nov 2020 13:42:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 57BEFC7FC; Thu, 5 Nov 2020 13:42:31 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id C9E14C7FC for ; Thu, 5 Nov 2020 13:42:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604580149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=91ewnSOpyU00WG5mNYrdn+nku4IouKR7GmY91k6KhGE=; b=Yr5n0rOYYPPoaA7Ayj2+axTo/a8t6AJ0KkfI8zpAwRLT5KJuUvpYLAbYWl5IBfBktxZW65 y8u26UkL4J2oZDHMQrGBskL6ToxbBqARZeBjhWH38dd8EO6wx56a28sxuRQWM6nZ/fwMTR gHqGQWla8k66viWvCw8IeF1wZvkhXJk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-149-NYHAAX1GMIeU3y9jObejwQ-1; Thu, 05 Nov 2020 07:42:25 -0500 X-MC-Unique: NYHAAX1GMIeU3y9jObejwQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 66B5D107465C; Thu, 5 Nov 2020 12:42:24 +0000 (UTC) Received: from rh.redhat.com (ovpn-113-249.ams2.redhat.com [10.36.113.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60C925C3E1; Thu, 5 Nov 2020 12:42:23 +0000 (UTC) From: Kevin Traynor To: Ting Xu Cc: Cristian Dumitrescu , dpdk stable Date: Thu, 5 Nov 2020 12:40:09 +0000 Message-Id: <20201105124015.306404-62-ktraynor@redhat.com> In-Reply-To: <20201105124015.306404-1-ktraynor@redhat.com> References: <20201105124015.306404-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-stable] patch 'table: fix hash for 32-bit' has been queued to LTS release 18.11.11 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 LTS release 18.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/10/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. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/1cf178210b226de4415713f9eb60a1626604c5a4 Thanks. Kevin. --- >From 1cf178210b226de4415713f9eb60a1626604c5a4 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 @@ -34,4 +34,5 @@ #endif +#ifdef RTE_ARCH_64 struct rte_bucket_4_16 { /* Cache line 0 */ @@ -47,4 +48,20 @@ struct rte_bucket_4_16 { 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 { 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 @@ -34,4 +34,5 @@ #endif +#ifdef RTE_ARCH_64 struct rte_bucket_4_32 { /* Cache line 0 */ @@ -47,4 +48,20 @@ struct rte_bucket_4_32 { 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 { 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 @@ -32,4 +32,5 @@ #endif +#ifdef RTE_ARCH_64 struct rte_bucket_4_8 { /* Cache line 0 */ @@ -44,4 +45,19 @@ struct rte_bucket_4_8 { 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 { -- 2.26.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-05 12:38:55.670762856 +0000 +++ 0062-table-fix-hash-for-32-bit.patch 2020-11-05 12:38:54.261896036 +0000 @@ -1 +1 @@ -From 99541c3028d741a09fe5dca95e79d8d020130173 Mon Sep 17 00:00:00 2001 +From 1cf178210b226de4415713f9eb60a1626604c5a4 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 99541c3028d741a09fe5dca95e79d8d020130173 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org