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 CCA48A00C2; Thu, 6 Oct 2022 12:21:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B30642BFB; Thu, 6 Oct 2022 12:21:40 +0200 (CEST) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by mails.dpdk.org (Postfix) with ESMTP id 2321D40042; Thu, 6 Oct 2022 12:21:39 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id AFEDD32004E7; Thu, 6 Oct 2022 06:21:37 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 06 Oct 2022 06:21:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1665051697; x= 1665138097; bh=NJSzsazx1Kx9pwobGU+fXh2XvgERKgp+mf4+4Gs9I+U=; b=H NfS1qUGa1ZnH5flSQoGD2V+GfiRl+K6PAfOK0iAZMA0ofB6+iCpJLGqruqEIIJ0W JRsPxuPOm1b39Y5M0VaycjeFFA9K8MET84EekU5m0fAzTndQIrQv4nfFDQVSsjSH c83pEb9Fd10jbUu5pOdLpo9/9yV2f+jEnY1vJ9ODkmySY5N9BGwHaWQ/AuCSg63n mgVrJfa6Tl/LPSXCXjtwR4gcZ50ZMHbWV2x1vAqikvFo9TDI23USUbBp7+650Hq8 Y88xvazhEVEMZS70GyiDNPDg2z2i4I9y3uoTkFLd5ElRUX0XVz355Wlypdh3zl1Z egnsaK2cfCFO1cgviUcpA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1665051697; x= 1665138097; bh=NJSzsazx1Kx9pwobGU+fXh2XvgERKgp+mf4+4Gs9I+U=; b=R eZ7iKbGiBvjIstERyDfk3dKzma6FU9UAFmez0Niry2eKwS8LFDFsX9uY/Y37LQmi Yy6BkmzHTSoVY6OmqdgY7sFOrgjRvLTrLYCX3ulJFap4b4nkWvGp751zG7lV4il5 dX6MxSfxbsumNmGaC3pVp9L+XoW6D/QlcrUc9t3X731D3C4m5P/kskeJ42G/3C3D CW400DGtQ7q9DPdHUggu+GsT2BBEC1zKYpBBa2q4RGKTvT18bPT9DDgVj9A9bNoY 1/lp06wk2aTXIYks36EUoOrxpRSG0bN5KANs316hJ3jNtLjtMe5E0aNixTdYC02y UX0n6x+HNnPCSxHYQyXFA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeihedgvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthhqredttddtjeenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpeegtddtleejjeegffekkeektdejvedtheevtdekiedvueeuvdei uddvleevjeeujeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Oct 2022 06:21:35 -0400 (EDT) From: Thomas Monjalon To: Maxime Coquelin Cc: dev@dpdk.org, cheng1.jiang@intel.com, chenbo.xia@intel.com, zhoumin@loongson.cn, david.marchand@redhat.com, stable@dpdk.org Subject: Re: [PATCH v3] vhost: fix build issues with GCC 12 Date: Thu, 06 Oct 2022 12:21:34 +0200 Message-ID: <3636953.MHq7AAxBmi@thomas> In-Reply-To: <20221005203524.89336-1-maxime.coquelin@redhat.com> References: <20221005151159.72366-1-maxime.coquelin@redhat.com> <20221005203524.89336-1-maxime.coquelin@redhat.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 05/10/2022 22:35, Maxime Coquelin: > This patch fixes a compilation issue met with GCC 12 on > LoongArch64: >=20 > In function =E2=80=98mbuf_to_desc=E2=80=99, > inlined from =E2=80=98vhost_enqueue_async_packed=E2=80=99 at ../../..= /dpdk/lib/vhost/virtio_net.c:1822:6, > inlined from =E2=80=98virtio_dev_rx_async_packed=E2=80=99 at ../../..= /dpdk/lib/vhost/virtio_net.c:1836:6, > inlined from =E2=80=98virtio_dev_rx_async_submit_packed=E2=80=99 at .= =2E/../../dpdk/lib/vhost/virtio_net.c:1895:7: > ../../../dpdk/lib/vhost/virtio_net.c:1159:18: error: =E2=80=98buf_vec[0].= buf_addr=E2=80=99 may be used uninitialized [-Werror=3Dmaybe-uninitialized] > 1159 | buf_addr =3D buf_vec[vec_idx].buf_addr; > | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ > ../../../dpdk/lib/vhost/virtio_net.c: In function =E2=80=98virtio_dev_rx_= async_submit_packed=E2=80=99: > ../../../dpdk/lib/vhost/virtio_net.c:1834:27: note: =E2=80=98buf_vec=E2= =80=99 declared here > 1834 | struct buf_vector buf_vec[BUF_VECTOR_MAX]; > | ^~~~~~~ >=20 > It happens because the compiler assumes that 'size' > variable in vhost_enqueue_async_packed could wrap to 0 since > 'size' is uint32_t and pkt->pkt_len too. >=20 > In practice, it would never happen since 'pkt->pkt_len' is > unlikely to be close to UINT32_MAX, but let's just change > 'size' to uint64_t to make the compiler happy without > having to add runtime checks. >=20 > This patch also fixes similar patterns in three other > places, including one that also produces similar build > issue on ARM64 in vhost_enqueue_single_packed(). >=20 > Fixes: 873e8dad6f49 ("vhost: support packed ring in async datapath") > Cc: stable@dpdk.org >=20 > Signed-off-by: Maxime Coquelin Reviewed-by: David Marchand Tested-by: Amit Prakash Shukla Applied, thanks.