From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D432F431A0 for ; Thu, 19 Oct 2023 02:00:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CD708402C8; Thu, 19 Oct 2023 02:00:11 +0200 (CEST) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) by mails.dpdk.org (Postfix) with ESMTP id 084D840291 for ; Thu, 19 Oct 2023 02:00:11 +0200 (CEST) Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2b95d5ee18dso106368671fa.1 for ; Wed, 18 Oct 2023 17:00:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697673610; x=1698278410; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tWuDfxgF5nM4ZSWPpTHYf9JimZLuYVNOC0dovajJsTo=; b=K1fe6cc6a94Zceghe04o4flutPdMK63VbXjaFdBIkkaF85+OXGNXOBbGHdfmgype0m VkWvZMmMsc9bBuYDDB8dHv7hbsK71KV8XQCgW3Llu4+AaEYpuxFT8gcwvRvg31FOZJtd ER/B8wUyNb2+L2qQTTTPK5Dvx3ealyqbV2VJANwqsWB5B2x4/KO2PO3oh/aHPTV3d1c1 bL0qUPfPUfK2ZtWkwUpIIfP049qUYUbsiGyMPyfHKAJ0czTRnPjyA6uS/LAUwNXnT3i2 uNcmHZJzTxyTBEPxdkgoCFnha1sz2ZlRDA7SKXHZZMe4lBmegxuckxkCM0vxLIc+07Jk 1DBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697673610; x=1698278410; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tWuDfxgF5nM4ZSWPpTHYf9JimZLuYVNOC0dovajJsTo=; b=W0GM3nhDf9IfYWkP4bgl6Vz4fCatcSg34bTQgmCR1srRgDyTFsJN97oHa/r5F1j53X zu19mmYKXEpIpmYFDwT4Y16CygWZE2gFQLDqtivEuOWUYvdNeh7PKv9ooVcLG54gYegg GTbWirR/sUUdyYhUomrrBHAfGboRCnO1x3HT4aDYMKBB//cmbIJE8lmqMWf5m0B46CdC RH4ZLS5U8ZX3qxOtzVWPppk1mRBLQm6uWVBfNdoSWX9ssJ5ECmL3joqHjA6hf9BC+HLE DjXoQTDTNjrIkU6QCHdGzk78TE5ILtACGlY8XciICBXhj6wCdd2sqNcDaEx5YqmnRnzX /ZXA== X-Gm-Message-State: AOJu0YyutPxQNSYoediWAaqdtroLeFRqNJMeuj1wxL0zBjFQZCmW1Yp9 WpaCs2A5FBuVGRmHHSShBvw= X-Google-Smtp-Source: AGHT+IGaQ801mHDFoWpHfrPzMwvRXvsMjZ42DutL5g7U3nkQ7EqlztYJiDQ0p9d+vuFRmg5HMwGdDg== X-Received: by 2002:a05:651c:4d0:b0:2b9:ea17:558b with SMTP id e16-20020a05651c04d000b002b9ea17558bmr279931lji.16.1697673610375; Wed, 18 Oct 2023 17:00:10 -0700 (PDT) Received: from localhost ([137.220.119.58]) by smtp.gmail.com with ESMTPSA id fc8-20020a05600c524800b0040535648639sm2960829wmb.36.2023.10.18.17.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 17:00:09 -0700 (PDT) From: luca.boccassi@gmail.com To: Jieqiang Wang Cc: Feifei Wang , Ruifeng Wang , Bruce Richardson , dpdk stable Subject: patch 'hash: align SSE lookup to scalar implementation' has been queued to stable release 20.11.10 Date: Thu, 19 Oct 2023 00:59:00 +0100 Message-Id: <20231018235930.3144-11-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231018235930.3144-1-luca.boccassi@gmail.com> References: <20231018235930.3144-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 20.11.10 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/21/23. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/733bc367addec56156086b338e17d9c0f21145ea Thanks. Luca Boccassi --- >From 733bc367addec56156086b338e17d9c0f21145ea Mon Sep 17 00:00:00 2001 From: Jieqiang Wang Date: Sat, 7 Oct 2023 15:36:34 +0800 Subject: [PATCH] hash: align SSE lookup to scalar implementation [ upstream commit e93bbaa72cca7ec912d756afdf10e393f9d71791 ] __mm_cmpeq_epi16 returns 0xFFFF if the corresponding 16-bit elements are equal. In original SSE2 implementation for function compare_signatures, it utilizes _mm_movemask_epi8 to create mask from the MSB of each 8-bit element, while we should only care about the MSB of lower 8-bit in each 16-bit element. For example, if the comparison result is all equal, SSE2 path returns 0xFFFF while NEON and default scalar path return 0x5555. Although this bug is not causing any negative effects since the caller function solely examines the trailing zeros of each match mask, we recommend this fix to ensure consistency with NEON and default scalar code behaviors. Fixes: c7d93df552c2 ("hash: use partial-key hashing") Signed-off-by: Feifei Wang Signed-off-by: Jieqiang Wang Reviewed-by: Ruifeng Wang Acked-by: Bruce Richardson --- lib/librte_hash/rte_cuckoo_hash.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c index cff4242f79..95c3e6c2f4 100644 --- a/lib/librte_hash/rte_cuckoo_hash.c +++ b/lib/librte_hash/rte_cuckoo_hash.c @@ -1866,11 +1866,15 @@ compare_signatures(uint32_t *prim_hash_matches, uint32_t *sec_hash_matches, _mm_load_si128( (__m128i const *)prim_bkt->sig_current), _mm_set1_epi16(sig))); + /* Extract the even-index bits only */ + *prim_hash_matches &= 0x5555; /* Compare all signatures in the bucket */ *sec_hash_matches = _mm_movemask_epi8(_mm_cmpeq_epi16( _mm_load_si128( (__m128i const *)sec_bkt->sig_current), _mm_set1_epi16(sig))); + /* Extract the even-index bits only */ + *sec_hash_matches &= 0x5555; break; #elif defined(__ARM_NEON) case RTE_HASH_COMPARE_NEON: { -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-10-19 00:28:56.792228058 +0100 +++ 0011-hash-align-SSE-lookup-to-scalar-implementation.patch 2023-10-19 00:28:56.205804204 +0100 @@ -1 +1 @@ -From e93bbaa72cca7ec912d756afdf10e393f9d71791 Mon Sep 17 00:00:00 2001 +From 733bc367addec56156086b338e17d9c0f21145ea Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit e93bbaa72cca7ec912d756afdf10e393f9d71791 ] + @@ -20 +21,0 @@ -Cc: stable@dpdk.org @@ -27 +28 @@ - lib/hash/rte_cuckoo_hash.c | 4 ++++ + lib/librte_hash/rte_cuckoo_hash.c | 4 ++++ @@ -30,5 +31,5 @@ -diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c -index d92a903bb3..19b23f2a97 100644 ---- a/lib/hash/rte_cuckoo_hash.c -+++ b/lib/hash/rte_cuckoo_hash.c -@@ -1868,11 +1868,15 @@ compare_signatures(uint32_t *prim_hash_matches, uint32_t *sec_hash_matches, +diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c +index cff4242f79..95c3e6c2f4 100644 +--- a/lib/librte_hash/rte_cuckoo_hash.c ++++ b/lib/librte_hash/rte_cuckoo_hash.c +@@ -1866,11 +1866,15 @@ compare_signatures(uint32_t *prim_hash_matches, uint32_t *sec_hash_matches,