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 477E945E6A for ; Tue, 10 Dec 2024 15:29:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 18DE9402C8; Tue, 10 Dec 2024 15:29:28 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2071.outbound.protection.outlook.com [40.107.237.71]) by mails.dpdk.org (Postfix) with ESMTP id 1BB41402C8 for ; Tue, 10 Dec 2024 15:29:27 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aoF+4krS44YduyR4qh+4tWeqevd+RMnzfC26433gtwvLsas8GolIe8FSb5/BKC1XXYdE0TFaYd3FnR+myphbPQJdxOWDRdv/C0ML8egSEsfKRwqPFhJJrSVyzoDYiYofkFZDD+jbB9e3kznP+mgwMTuvOFCdIQZ6nKb3Vo7RYjt7jADqTwdsBx9udrzF3slxOygGaGJoJ1AipSVBf5Spsyx1qpwT5tynvt2ptTITYfmRxvz6u0zbPg9nJL+bCY8E/2h43VpPQ01URCPRmzx8CqPF1STKj/iV1gDpZfJ6GE9iKH6o4S62KsCaZl7p+JQPu0YKAHJeRhofDRN8RSNnfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+EXpDBWlhimGYR8vbru5w++SrZnw2h+SExbzxWREXQw=; b=Pf+S9P/bn1sD+oIlTXuOtGFAGSxEzrke3z0mWRyyPfz9/UuZMkFsEcRplvA+BHa054HYAY+wo+dJkgwkImmvaR16/Cr/68dv1vAerfMRz1yZUr5pZ5AK/FTqz0VLNnSMOOzoUHZ+7x/PoJ0i9S4e73Vi0ROCUZz+7pJOH6YbPK9UWKe5FnCeBH/GUBVoWOqzKDnwIFy/kjVMI1mz7c7ZnSBOMwVcgxrcNvfdTvYlLJDHwTwJhilYgchTMdHLKQJ09taaDqbSoMV70wc1oUHkMNlglS2RsDDRGcxgId3HGXkzyzJd25XmGaeiUYQqGoqZxHhLJO+7Vmw09nIBI/ttpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+EXpDBWlhimGYR8vbru5w++SrZnw2h+SExbzxWREXQw=; b=XmGEtjgz0HqMMFXT8bnvob05P8j3P93cZb+xODmHijr2z5PPzind55G47EeFjrwz0TykZojpF7TlC6nlbJlm/7CLsJ8yWtfKxFmmuWCpSWPLJtTwn7z2/7OJDjsjp/fxI1ciA8cNtcyFsBIKkcxJA0mz7yDpIY651nNVJSoosXmJkWR57MOjwTHzUu4XbdoWgkCZTLX/7dpG1KW825Xvryab2h50SyVKFNul0aht2aY13nqf4U3+BjZr4uFTSNS6ECUdTzBpq2TD5drcgX9Ay5QHwZz5GUNJ/6rTT1XAAP9jN1oul/R4TVooTldF3n6U0TyR26+UCuyKAEr9kNkLaw== Received: from CH3PR12MB8658.namprd12.prod.outlook.com (2603:10b6:610:175::8) by PH7PR12MB9175.namprd12.prod.outlook.com (2603:10b6:510:2e6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Tue, 10 Dec 2024 14:29:24 +0000 Received: from CH3PR12MB8658.namprd12.prod.outlook.com ([fe80::d5cc:cc84:5e00:2f42]) by CH3PR12MB8658.namprd12.prod.outlook.com ([fe80::d5cc:cc84:5e00:2f42%3]) with mapi id 15.20.8230.016; Tue, 10 Dec 2024 14:29:24 +0000 From: Xueming Li To: Andre Muezerie , "stable@dpdk.org" Subject: Re: [PATCH 23.11] rcu: fix implicit conversion in bit shift Thread-Topic: [PATCH 23.11] rcu: fix implicit conversion in bit shift Thread-Index: AQHbSlL459njmcArT0WpQ69eVUXjfLLfitx5 Date: Tue, 10 Dec 2024 14:29:23 +0000 Message-ID: References: <20241207082033.489453-1-xuemingl@nvidia.com> <1733759798-21176-1-git-send-email-andremue@linux.microsoft.com> In-Reply-To: <1733759798-21176-1-git-send-email-andremue@linux.microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH3PR12MB8658:EE_|PH7PR12MB9175:EE_ x-ms-office365-filtering-correlation-id: ca879cb9-4793-4c28-36cf-08dd19270b3f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|7053199007|8096899003|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?dgsMvAKppGH61rTXRpFFOFLjF+fCP0rQqz0lrPGLqW54e99C/Iv5+1hWe2?= =?iso-8859-1?Q?4FZDh+eA5sKQTAiEf2hpCG2lZMAK3RVj4U+tQO0QigBgcM87b4bnmw6ZZ1?= =?iso-8859-1?Q?GQz63y617VKWV7HNaGXorKYsRsElQRhrU3vtQ77WZO2QaNqwfNJocarwAv?= =?iso-8859-1?Q?5elUSWmse6MPy92JFhNrKV27SpVNTtc3+fq8AuN/hdgw8L52bQ7AdpyeWq?= =?iso-8859-1?Q?r8LT8ht6wBgFJhLtFzsoxELlaeLkQ2pdCb6DBCjit5wZEF0wpQLzb7tftB?= =?iso-8859-1?Q?rYSa0k0f2Hym1yUev+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rB1/dZpL?= =?iso-8859-1?Q?e3yAYSK+RIR2NXrBthDgRFdhwtqOlHI9aotK7oXJY5xUNMXHMBuSmUjMhq?= =?iso-8859-1?Q?3WDMsV7ZolmthpkpuKzha/VfLKFgnreFLTfjVR5doZIKOY9eiWBCBmgRuy?= =?iso-8859-1?Q?WGDtf+b+E2T1IFCpuqewktCY71rZ5qZxsnH5FhxKXc6vkx44HrWuyL3P2B?= =?iso-8859-1?Q?Ohbpxfe66349MYSn9wmsFW6T9GKwg0cFWmI9SnniTj/BR4GLu4pm5GehYT?= =?iso-8859-1?Q?LGbdgU55tNHtpy5Advm3p/Eh0DYCl3tUBlIVxg=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH3PR12MB8658.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(7053199007)(8096899003)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?V8jSd1W7dFTMCivzFcM40rsuBEk7D+H4TZjCEwu/1ja2oTx5UikjZNhJRf?= =?iso-8859-1?Q?7XT7S6a3R/BpNXARF/Hz5j8KU7c613KJdc/cPObOFsTNyCY2p+HLfviL+7?= =?iso-8859-1?Q?bxemklnw7Md2N1jNzUWIo6mlAo2we0Ll3Ytg+n0lhotkyOH0b8mCf7nhp/?= =?iso-8859-1?Q?54cZXSXDsEXnaSNKIjjohZhjNyqObv9Wg7ppIGO0FyvQVLG0hte7SNDgXx?= =?iso-8859-1?Q?/6ajeyxp71/3A7fyAVpmNwAP/jZAa4gf5HMKXIabABlMWbfHKeF8PYt5UU?= =?iso-8859-1?Q?DBlRLoNxoiQy8XxoHPrfQx4XL6NqsaKNmKErJ8feaXRi6k00VnBzB0em4X?= =?iso-8859-1?Q?xO0Nh9sWSKck8uLKPoxpaqLVrJjeclPuyFiNEq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-1?Q?+Wni7PXykC8Mvg3nksij6u0fBCwQEURbxZDRToclH4AT1mwsL3GmfKl9Uw?= =?iso-8859-1?Q?tFA0H/xkwvBiyX7nHDr5r++op7yD2fTC+M7mE+QL0M1EldZmqD12AM9hIj?= =?iso-8859-1?Q?Y97moejoTyjME3NBULyUHNAGGTI/o5o10AFAGRl4gNEq4bppycbE8+Mv8Y?= =?iso-8859-1?Q?pZrR1S8r/o+pVZwBMbrqhv9WbPfzOv27PSY9RKWrKhS4WN0CPlkG1xBvsc?= =?iso-8859-1?Q?KL/dckLyostZ3ra9cgPKNBxiXnXd7NZsbATj8PffVNFLinfTp9mzyi7GV/?= =?iso-8859-1?Q?WDmGEIEypEOY4n8lbGFKBbsrC2DmNODKkcyTGIGhVbdNstaScWx+U5Iasp?= =?iso-8859-1?Q?DcvNQgU+9Hoin+TF/1E+tq/oRfc49Ez10r?= Content-Type: multipart/alternative; boundary="_000_CH3PR12MB86587EE6EFD997F68F469FCDA13D2CH3PR12MB8658namp_" MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH3PR12MB8658.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca879cb9-4793-4c28-36cf-08dd19270b3f X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Dec 2024 14:29:23.9166 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bv+KAN96H/VHGkyHWSEWjKpzJupUx7hqL8w+sZ7QauYqqJZtOei5L4rp82ULJdGhYxwaJO6BqJPM0g0H5rLUCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB9175 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 --_000_CH3PR12MB86587EE6EFD997F68F469FCDA13D2CH3PR12MB8658namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Andre, Thanks for your help, patch enqueued to 23.11 LTS patch list. Regards, Xueming ________________________________ From: Andre Muezerie Sent: Monday, December 9, 2024 11:56 PM To: stable@dpdk.org Cc: Andre Muezerie Subject: [PATCH 23.11] rcu: fix implicit conversion in bit shift [ upstream commit ffe827f38e6e0be8a307d7ef9c0e1347874f0af7 ] ../lib/rcu/rte_rcu_qsbr.c(101): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) ../lib/rcu/rte_rcu_qsbr.c(107): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) ../lib/rcu/rte_rcu_qsbr.c(145): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) These warnings are being issued by the MSVC compiler. Since the result is being stored in a variable of type uint64_t, it makes sense to shift a 64-bit number instead of shifting a 32-bit number and then having the compiler to convert the result implicitly to 64 bits. UINT64_C was used in the fix as it is the portable way to define a 64-bit constant (ULL suffix is architecture dependent). >From reading the code this is also a bugfix: (1 << id), where id =3D thread_id & 0x3f, was wrong when thread_id > 0x1f. Signed-off-by: Andre Muezerie --- lib/rcu/rte_rcu_qsbr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/rcu/rte_rcu_qsbr.c b/lib/rcu/rte_rcu_qsbr.c index 41a44be4b9..e46ce7958e 100644 --- a/lib/rcu/rte_rcu_qsbr.c +++ b/lib/rcu/rte_rcu_qsbr.c @@ -104,11 +104,11 @@ rte_rcu_qsbr_thread_register(struct rte_rcu_qsbr *v, = unsigned int thread_id) /* Check if the thread is already registered */ old_bmap =3D rte_atomic_load_explicit(__RTE_QSBR_THRID_ARRAY_ELM(v= , i), rte_memory_order_relaxed); - if (old_bmap & 1UL << id) + if (old_bmap & RTE_BIT64(id)) return 0; do { - new_bmap =3D old_bmap | (1UL << id); + new_bmap =3D old_bmap | RTE_BIT64(id); success =3D rte_atomic_compare_exchange_strong_explicit( __RTE_QSBR_THRID_ARRAY_ELM(v, i), &old_bmap, new_bmap, @@ -117,7 +117,7 @@ rte_rcu_qsbr_thread_register(struct rte_rcu_qsbr *v, un= signed int thread_id) if (success) rte_atomic_fetch_add_explicit(&v->num_threads, 1, rte_memory_order_relaxe= d); - else if (old_bmap & (1UL << id)) + else if (old_bmap & RTE_BIT64(id)) /* Someone else registered this thread. * Counter should not be incremented. */ @@ -156,11 +156,11 @@ rte_rcu_qsbr_thread_unregister(struct rte_rcu_qsbr *v= , unsigned int thread_id) /* Check if the thread is already unregistered */ old_bmap =3D rte_atomic_load_explicit(__RTE_QSBR_THRID_ARRAY_ELM(v= , i), rte_memory_order_relaxed); - if (!(old_bmap & (1UL << id))) + if (!(old_bmap & RTE_BIT64(id))) return 0; do { - new_bmap =3D old_bmap & ~(1UL << id); + new_bmap =3D old_bmap & ~RTE_BIT64(id); /* Make sure any loads of the shared data structure are * completed before removal of the thread from the list of * reporting threads. @@ -173,7 +173,7 @@ rte_rcu_qsbr_thread_unregister(struct rte_rcu_qsbr *v, = unsigned int thread_id) if (success) rte_atomic_fetch_sub_explicit(&v->num_threads, 1, rte_memory_order_relaxe= d); - else if (!(old_bmap & (1UL << id))) + else if (!(old_bmap & RTE_BIT64(id))) /* Someone else unregistered this thread. * Counter should not be incremented. */ @@ -234,7 +234,7 @@ rte_rcu_qsbr_dump(FILE *f, struct rte_rcu_qsbr *v) t =3D rte_ctz64(bmap); fprintf(f, "%u ", id + t); - bmap &=3D ~(1UL << t); + bmap &=3D ~RTE_BIT64(t); } } @@ -261,7 +261,7 @@ rte_rcu_qsbr_dump(FILE *f, struct rte_rcu_qsbr *v) rte_atomic_load_explicit( &v->qsbr_cnt[id + t].lock_cnt, rte_memory_order_relaxed)); - bmap &=3D ~(1UL << t); + bmap &=3D ~RTE_BIT64(t); } } -- 2.47.0.vfs.0.3 --_000_CH3PR12MB86587EE6EFD997F68F469FCDA13D2CH3PR12MB8658namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Andre,

Thanks for your help, patch enqueued to 23.11 LTS patch list.

Regards,
Xueming


From: Andre Muezerie <an= dremue@linux.microsoft.com>
Sent: Monday, December 9, 2024 11:56 PM
To: stable@dpdk.org <stable@dpdk.org>
Cc: Andre Muezerie <andremue@linux.microsoft.com>
Subject: [PATCH 23.11] rcu: fix implicit conversion in bit shift
 
[ upstream commit ffe827f38e6e0be8a307d7ef9c0e1347= 874f0af7 ]

../lib/rcu/rte_rcu_qsbr.c(101): warning C4334: '<<': result of 32-bit=
 shift implicitly converted to 64 bits (was 64-bit shift intended?) ../lib/rcu/rte_rcu_qsbr.c(107): warning C4334: '<<': result of 32-bit=
 shift implicitly converted to 64 bits (was 64-bit shift intended?) ../lib/rcu/rte_rcu_qsbr.c(145): warning C4334: '<<': result of 32-bit=
 shift implicitly converted to 64 bits (was 64-bit shift intended?)
These warnings are being issued by the MSVC compiler. Since the result is being stored in a variable of type uint64_t, it makes sense to shift a
64-bit number instead of shifting a 32-bit number and then having the
compiler to convert the result implicitly to 64 bits.
UINT64_C was used in the fix as it is the portable way to define a 64-bit constant (ULL suffix is architecture dependent).

>From reading the code this is also a bugfix:
(1 << id), where id =3D thread_id & 0x3f, was wrong when thread_i= d > 0x1f.

Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
 lib/rcu/rte_rcu_qsbr.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/rcu/rte_rcu_qsbr.c b/lib/rcu/rte_rcu_qsbr.c
index 41a44be4b9..e46ce7958e 100644
--- a/lib/rcu/rte_rcu_qsbr.c
+++ b/lib/rcu/rte_rcu_qsbr.c
@@ -104,11 +104,11 @@ rte_rcu_qsbr_thread_register(struct rte_rcu_qsbr *v, = unsigned int thread_id)
         /* Check if the thread is = already registered */
         old_bmap =3D rte_atomic_lo= ad_explicit(__RTE_QSBR_THRID_ARRAY_ELM(v, i),
            &nb= sp;            =             &nb= sp;   rte_memory_order_relaxed);
-       if (old_bmap & 1UL << id) +       if (old_bmap & RTE_BIT64(id))
            &nb= sp;    return 0;
 
         do {
-            &n= bsp;  new_bmap =3D old_bmap | (1UL << id);
+            &n= bsp;  new_bmap =3D old_bmap | RTE_BIT64(id);
            &nb= sp;    success =3D rte_atomic_compare_exchange_strong_explic= it(
            &nb= sp;            =             &nb= sp;   __RTE_QSBR_THRID_ARRAY_ELM(v, i),
            &nb= sp;            =             &nb= sp;   &old_bmap, new_bmap,
@@ -117,7 +117,7 @@ rte_rcu_qsbr_thread_register(struct rte_rcu_qsbr *v, un= signed int thread_id)
            &nb= sp;    if (success)
            &nb= sp;            rte_a= tomic_fetch_add_explicit(&v->num_threads,
            &nb= sp;            =             &nb= sp;           1, rte_memo= ry_order_relaxed);
-            &n= bsp;  else if (old_bmap & (1UL << id))
+            &n= bsp;  else if (old_bmap & RTE_BIT64(id))
            &nb= sp;            /* So= meone else registered this thread.
            &nb= sp;            = * Counter should not be incremented.
            &nb= sp;            = */
@@ -156,11 +156,11 @@ rte_rcu_qsbr_thread_unregister(struct rte_rcu_qsbr *v= , unsigned int thread_id)
         /* Check if the thread is = already unregistered */
         old_bmap =3D rte_atomic_lo= ad_explicit(__RTE_QSBR_THRID_ARRAY_ELM(v, i),
            &nb= sp;            =             &nb= sp;   rte_memory_order_relaxed);
-       if (!(old_bmap & (1UL << id= )))
+       if (!(old_bmap & RTE_BIT64(id)))<= br>             &nb= sp;    return 0;
 
         do {
-            &n= bsp;  new_bmap =3D old_bmap & ~(1UL << id);
+            &n= bsp;  new_bmap =3D old_bmap & ~RTE_BIT64(id);
            &nb= sp;    /* Make sure any loads of the shared data structure a= re
            &nb= sp;     * completed before removal of the thread from t= he list of
            &nb= sp;     * reporting threads.
@@ -173,7 +173,7 @@ rte_rcu_qsbr_thread_unregister(struct rte_rcu_qsbr *v, = unsigned int thread_id)
            &nb= sp;    if (success)
            &nb= sp;            rte_a= tomic_fetch_sub_explicit(&v->num_threads,
            &nb= sp;            =             &nb= sp;           1, rte_memo= ry_order_relaxed);
-            &n= bsp;  else if (!(old_bmap & (1UL << id)))
+            &n= bsp;  else if (!(old_bmap & RTE_BIT64(id)))
            &nb= sp;            /* So= meone else unregistered this thread.
            &nb= sp;            = * Counter should not be incremented.
            &nb= sp;            = */
@@ -234,7 +234,7 @@ rte_rcu_qsbr_dump(FILE *f, struct rte_rcu_qsbr *v)
            &nb= sp;            t =3D= rte_ctz64(bmap);
            &nb= sp;            fprin= tf(f, "%u ", id + t);
 
-            &n= bsp;          bmap &=3D ~(= 1UL << t);
+            &n= bsp;          bmap &=3D ~R= TE_BIT64(t);
            &nb= sp;    }
         }
 
@@ -261,7 +261,7 @@ rte_rcu_qsbr_dump(FILE *f, struct rte_rcu_qsbr *v)
            &nb= sp;            =         rte_atomic_load_explicit(
            &nb= sp;            =             &nb= sp;   &v->qsbr_cnt[id + t].lock_cnt,
            &nb= sp;            =             &nb= sp;   rte_memory_order_relaxed));
-            &n= bsp;          bmap &=3D ~(= 1UL << t);
+            &n= bsp;          bmap &=3D ~R= TE_BIT64(t);
            &nb= sp;    }
         }
 
--
2.47.0.vfs.0.3

--_000_CH3PR12MB86587EE6EFD997F68F469FCDA13D2CH3PR12MB8658namp_--