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 169BD45D41; Tue, 19 Nov 2024 10:59:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CEC8A427D7; Tue, 19 Nov 2024 10:59:43 +0100 (CET) Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.156]) by mails.dpdk.org (Postfix) with ESMTP id 3D43F40268 for ; Tue, 19 Nov 2024 10:59:42 +0100 (CET) Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfhigh.stl.internal (Postfix) with ESMTP id 6A698254018A; Tue, 19 Nov 2024 04:59:41 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Tue, 19 Nov 2024 04:59:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1732010381; x=1732096781; bh=YSJjY8UGUiOW7Be1xUx+yQYQdPpUmirWClzGp52Lhb4=; b= pey5CjgNDJISVD0D9HJ0U/BKA5reuAHvg2hTb+Ojckjx743WNFiQFyX3q2E/SCSW mc74tP97ddcyJVjxH/29LUVkhR6tKvvV3cpXwGziXYRKZvOzJswomVbE+99GZYbc k1hPWW9439wpEFt8K+D7/pVaU8XoV47FPujc7ndPtkkTalz6IY1TnCZYlFk8vIje dPMlkk0ng6ozSXU/FSGMEbw/dYJW9OXkgxrS6fu2lJx1dcTTgwLRaPbhuBtZFapc AaEaOAZ7yW30eJV8RE3snYK0napc/27rG3ATytP4xoFgv+kcnSJ+8t0iuzRKVmWU b+uuGEZc7dWVw2vrSANx3w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1732010381; x= 1732096781; bh=YSJjY8UGUiOW7Be1xUx+yQYQdPpUmirWClzGp52Lhb4=; b=f z40dqow+t6LAFf4Mo9S/z6YULOWX71OMMRyyPo6Z+rcGlXTozLV5bEhRR8pXiuH0 w/uSV7x8MqYcE9d0Lajru88piHAjgHnLCCVMlHemlRl8wsohmQzPrRGHrwtGUsL8 e/1SGb6EcewOM36dgtFyBuw+JkrKXew4yqO9VUFMCP6ikrK355Be6lhIbzHFPKM0 VqZw8Jq/xOdR4VFV19X0VGRXDiaycRBrmrCoDNs50ZhgyjaYVUMEDjpgfvK/a74S INPyg5DqRmGFD3aQKxyJENzWHg/Yf3BcQmoARkMLMA7eF4o+V4W4gWfcQu432tKh 750o1zWbTzAj5DO2h8mjQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrfedvgddtlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtqhertddttdejnecu hfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlh honhdrnhgvtheqnecuggftrfgrthhtvghrnhepgedttdeljeejgeffkeekkedtjeevtdeh vedtkeeivdeuuedvieduvdelveejueejnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthdpnhgs pghrtghpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprghnughrvg hmuhgvsehlihhnuhigrdhmihgtrhhoshhofhhtrdgtohhmpdhrtghpthhtohepuggvvhes ughpughkrdhorhhgpdhrtghpthhtohephhhonhhnrghpphgrrdhnrghgrghrrghhrghllh hisegrrhhmrdgtohhmpdhrtghpthhtohepughouhhgrdhfohhsthgvrhesrghrmhdrtgho mhdprhgtphhtthhopegurghvihgurdhmrghrtghhrghnugesrhgvughhrghtrdgtohhm X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Nov 2024 04:59:40 -0500 (EST) From: Thomas Monjalon To: Andre Muezerie Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com, doug.foster@arm.com, david.marchand@redhat.com Subject: Re: [PATCH v3] rcu: shift 64-bit constant to avoid implicit 32 to 64 bit conversion Date: Tue, 19 Nov 2024 10:59:39 +0100 Message-ID: <1953283.6tgchFWduM@thomas> In-Reply-To: <1731684330-5735-1-git-send-email-andremue@linux.microsoft.com> References: <1731448959-18046-1-git-send-email-andremue@linux.microsoft.com> <1731684330-5735-1-git-send-email-andremue@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 15/11/2024 16:25, Andre Muezerie: > ../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?) >=20 > 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). >=20 > From reading the code this is also a bugfix: > (1 << id), where id =3D thread_id & 0x3f, was wrong when thread_id > 0x1f. >=20 > Fixes: 64994b56cfd7 ("rcu: add RCU library supporting QSBR mechanism") >=20 > Signed-off-by: Andre Muezerie > Reviewed-by: Honnappa Nagarahalli > Reviewed-by: Morten Br=C3=B8rup Applied, thanks.