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 A03E645D13; Fri, 15 Nov 2024 15:21:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 52A6C42FF3; Fri, 15 Nov 2024 15:21:59 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id B296042FF3 for ; Fri, 15 Nov 2024 15:21:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731680517; 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=Q1hIykB7qtEGm02S+WPJAYK4IvpU8Dy+nrKIeGDQTGo=; b=e6we2iapBjNsfZTFvBjv4rRVBle9hDvPigaSS5nOTvFd370vjZCaf2qA+ztDQ8eSkwAfKP jW109bgGePbsB2B0kAs1xhzYYX3YFvkbG+BVevFuYadZGNlw2nwveMxSVnZKe1RNqR9jSZ kLPqij7Sn+F3IpPql90JaXa8vi+eqeM= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-533-vtXVDigLNSWrQ456YFrNJA-1; Fri, 15 Nov 2024 09:21:56 -0500 X-MC-Unique: vtXVDigLNSWrQ456YFrNJA-1 X-Mimecast-MFC-AGG-ID: vtXVDigLNSWrQ456YFrNJA Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2fb45ca974bso5051471fa.2 for ; Fri, 15 Nov 2024 06:21:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731680514; x=1732285314; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q1hIykB7qtEGm02S+WPJAYK4IvpU8Dy+nrKIeGDQTGo=; b=MrHHYkKco6slQpuL/ZzuD+yAK5vAxHM0eIWxDLMf1WzmPrxcxfjJI0dPrtROemK7iH Vgrv3522iREVSTteql/so2JJCR6sCYCydLI0UZilCl6PV/UwAD0NuWyDNbmKFSFT3wp5 RH3WppwIHKorw+W4GK3lXCP78PUGBaHGVgviQB02M2LYpz0lE/0xzga9R+XNRRQyS1Zz 8dYEuog/X0Bm19XLxQcU6JSX+OxxnG5wydA5KQUuiswN6xZRT6p1Ah4sbKbstQPD2IAs XLH89SrsnQik1O5SKhosW3P2H8bLPPF3Q+qZfJ9V2ST0G/NXjtZaVj86G8BB51KxVFAw Xb8g== X-Gm-Message-State: AOJu0Yx9/w/1mZaP/seL8Icn62yQoPLjgPx+WJbxkBFg2ohsQXKpHUjG /75ax6VbVrx0A+f0XaxYBrEoNmixEs/gIWgdgXRkSVKHhZR6BahfzDh+Nw/teEJk7CL9eu6gWei pxX4wnjJBUy7dn2mk0dwAuOU8cUSN5nbltzApkOfhQfJ1QVuszG+4GJ9xhW8io8gsksfrMlGZV/ ZYsOAO8iRBmCq6Os0= X-Received: by 2002:a05:651c:b27:b0:2fe:f8e1:5127 with SMTP id 38308e7fff4ca-2ff60665f0cmr15503271fa.9.1731680514257; Fri, 15 Nov 2024 06:21:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlLVWZfIUWAk4EY1CtfniXtVZ9fB6RNywS+aWNl92dzSvXUr/yri5UjeXD01D+vQr4IbTPPK2bhC1Y0hk+oDU= X-Received: by 2002:a05:651c:b27:b0:2fe:f8e1:5127 with SMTP id 38308e7fff4ca-2ff60665f0cmr15503081fa.9.1731680513634; Fri, 15 Nov 2024 06:21:53 -0800 (PST) MIME-Version: 1.0 References: <1731448959-18046-1-git-send-email-andremue@linux.microsoft.com> <1731514983-31238-1-git-send-email-andremue@linux.microsoft.com> In-Reply-To: <1731514983-31238-1-git-send-email-andremue@linux.microsoft.com> From: David Marchand Date: Fri, 15 Nov 2024 15:21:42 +0100 Message-ID: Subject: Re: [PATCH v2] rcu: shift 64-bit constant to avoid implicit 32 to 64 bit conversion To: Andre Muezerie Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com, doug.foster@arm.com X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: VrwlQjNcHYMIa1LojsYy2djGRLK4eAqgaTorPILqDMQ_1731680515 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Wed, Nov 13, 2024 at 5:24=E2=80=AFPM Andre Muezerie wrote: > > ../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= . > > Fixes: 64994b56cfd7 ("rcu: add RCU library supporting QSBR mechanism") > > Signed-off-by: Andre Muezerie > Reviewed-by: Honnappa Nagarahalli > Reviewed-by: Morten Br=C3=B8rup Just a nit, EAL provides a macro: lib/eal/include/rte_bitops.h:#define RTE_BIT64(nr) (UINT64_C(1) << (nr)) Does this change allow to build the rcu library with MSVC? I see it is disabled in meson. --=20 David Marchand