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 99F1CA0544; Fri, 2 Sep 2022 13:57:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 41F0E40695; Fri, 2 Sep 2022 13:57:25 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 0EE7D40693; Fri, 2 Sep 2022 13:57:23 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2828AroN007268; Fri, 2 Sep 2022 04:57:20 -0700 Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2170.outbound.protection.outlook.com [104.47.57.170]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3jb3kujqd9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Sep 2022 04:57:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SaZJsEs4AadQ3tlFtKWwU0cv9Imlz2NZ+p2JzH+easdvar+6rIs5ZNPw0lIPYvbbJQpogtaQFr5/vqXGAvZU6Q2LmUk8DeYud/+YcLhLUBi0LIHxftPepDSXkeKxLCIgk6+Mbm1VRBWDVmJ+aD4UR+sOkSjkcb8IhIOhaHjAsvAg4SIBAfOW7ge/DqY4pdFnGKgcMkMFLH6/0dtVVnksNpdsv0K68+YzkozfqYDAXRXBOIUf3EyZNazcgcGLhAgcC1HCJ4U66vocB5ZwwtNbpnWkTIf1w6zaF8Cj263sYWYiS0G8q99dgWgV7GgrHP+Q3hOm50cm/eBIbWpXJ4Rdvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=OifdAr/L6kxm1AprtoP8ghXcr0lx4fJEbaHuFZK5560=; b=XK48p9n310LJC6zCDswYKYFIX2ql6z6Cy2n/i8WZbsFmCXy46R0KLCg4wxs8SSw2TTFomscc9/ibp6f/OEe2vsN4Ir0G/pWYg9T+jIxQBWLrB6AjRfBso7LTRQATLbmrNM/cemFU1O8qrh913Af3L6YzpGufB7Ke60g/rumaQ7hRnhgy5owcTCIa6jnxz6khoIr3pFfjOn2NOkZa3yTKo3TBwDbJw9BMvaoqN2L2XwZyK7F+2SvuRRAW93NpripGF7hT7sNEAVx25jpvrdYsDhPBe29vi9xoeDxDFLg94kqctHdC78lB+/ubSeP9wFvUZfI1n1bo1Ew6snVCCAmHDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OifdAr/L6kxm1AprtoP8ghXcr0lx4fJEbaHuFZK5560=; b=JZq8iFeKj7E1IppQIQDw3t/kdR9n53aTmRk6DyZ1UnueVbhtFjAGW16+go8jLb2FJajaetnbE3pR31judYU/sLmP0y0NCo1X2QXoXp1y6NsotAeGgU3M08dYoSUVZ3c0vxdTGq0v6yV9WeesO+Sr6X+DKAaeEPPD3fMm9UOc83Y= Received: from PH0PR18MB5167.namprd18.prod.outlook.com (2603:10b6:510:168::7) by MN2PR18MB2736.namprd18.prod.outlook.com (2603:10b6:208:a4::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10; Fri, 2 Sep 2022 11:57:16 +0000 Received: from PH0PR18MB5167.namprd18.prod.outlook.com ([fe80::41ab:ee68:284f:3be2]) by PH0PR18MB5167.namprd18.prod.outlook.com ([fe80::41ab:ee68:284f:3be2%3]) with mapi id 15.20.5588.011; Fri, 2 Sep 2022 11:57:15 +0000 From: Amit Prakash Shukla To: Ruifeng Wang , Maxime Coquelin , Chenbo Xia CC: "dev@dpdk.org" , Jerin Jacob Kollanukkaran , "stable@dpdk.org" , nd Subject: RE: [PATCH] vhost: compilation fix for GCC-12 Thread-Topic: [PATCH] vhost: compilation fix for GCC-12 Thread-Index: AQHYvd/NMOO23+EThEWGkQI6T+199K3LvhiAgABCKCA= Date: Fri, 2 Sep 2022 11:57:15 +0000 Message-ID: References: <20220901084943.3075710-1-amitprakashs@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5206a814-c91b-4570-1cf7-08da8cda4749 x-ms-traffictypediagnostic: MN2PR18MB2736:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NDMcTLBVwgQLZkrRTYN5BPl2O9AIWVekk5oZhoNbx+E41LoJY5MAYbKAcMxf49jw0Um1rIUAILWt8lcboI66znoMVLx7v+Md83iqpbec1hQMaN2MQl4ICXVyFGm2WF1a0nrO2abdB17C0OyGWFNCnlCEy/gCXC7oQ8RfbhvNJUnbPmV7b9cx94U9Rp5l9R6TqTqbnF3K4Hf2m6UUGUeefjMWFiZ9iAOpdZxemu1H+tToLHeoCai6cGdtCLM0O4AIR2NGv/rPfaGXl5niAok7qXIIkf3WJYsXR3f8Lh3u+kYNIUd+sYnUlGVJrXl/Rzct1ncOID53Q7zZ6Spbhh+7R6zRnGgTAtFu0YnJMGmYU7OXZ0GQ21Ug4l2v8mzNbn3pefWHuaATxCvaORmIcXTs3jkuliu9w9i+AS25VRmrnnaNUFWRzn/xZrKWgnqZsvGnH4lXjrqR65EcgVHW/yKik79bSVMILnmGQ+6hq80OYCiMIa3hwNOBL0rAdTX3G0xMXzXklPBWVecrqbN3aU0tySZnUW7FTUpjqOQ/63CKsTYBiaC8Rv68ZMqVzPLxNlM5HSt77iPTBWU2XLNSlAGlhJV7MWennXGuaVF/ijM3XX0IpK4fXytQd7XywHMDAZqGOGj65IFAQgZsqCMu1yR5YeGqqQu3W2Ujw/Fmzm1QVv+ecuAhdBTaeUVeWdLFalLgpFKJSpoFZ2Nd/SUDMnnbXDTxWxTnTuaGVCkWYA9GV9Vwz/XJ1FrVCRBXecs2Vg6P+1sAWVmpqFKce8ZI3DXpYg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB5167.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(366004)(39860400002)(396003)(136003)(346002)(376002)(33656002)(186003)(52536014)(66946007)(66446008)(76116006)(66476007)(66556008)(478600001)(64756008)(8936002)(86362001)(9686003)(7696005)(6506007)(8676002)(26005)(2906002)(53546011)(5660300002)(41300700001)(122000001)(4326008)(316002)(38070700005)(38100700002)(55016003)(71200400001)(54906003)(110136005)(83380400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9QWkbAOE0XUxcrxchU4uYLDOLsUG2aeqV2DmHGNjeYAwYBJxM4USJsZ7cx5e?= =?us-ascii?Q?pGJP2tYOzmYRpzgbyxegPQ7UfuV+sKLMwRxeHmSQT9kItht88I2g8cyIL5Gk?= =?us-ascii?Q?jQ3sHjv73OyP811xQ1G/arqADCMfuycsN5PmQoM7lCqQrCvfFPv7/bnqpnDx?= =?us-ascii?Q?05l39wniLNPHFxM50PbWLxmXgsF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ascii?Q?HO9tCoi1+K5941pA58Cz6S0H5EJD2lOuU/MTERE+TubFEIcmloZaVMIMECtV?= =?us-ascii?Q?oFpeW33kRtMC0YfzqsMBgqZHiVZzqTrkAKv2RgebaeGcKmQUKUh9uL0hHsMR?= =?us-ascii?Q?9RJ2n1v5Hvtd3uDCUAbgHHNWgBJ7Mglh1ZXgDGjVKdpScKtdmytphL5ypkso?= =?us-ascii?Q?Db0oNkPnsE6z2i3OPqQm+he2yAshoJaoheXBAw7DG4Sp36Lyz7p+EfqH/FfK?= =?us-ascii?Q?6AzNAcMqDHrCAeGGOk6ba/qM1BAJe35h15MPs+sYLsTGv6Zd1FmZBQF9VaXQ?= =?us-ascii?Q?wg08R2qeFGCM9jQMF4igs8xAPbXfjTmAgiAYEoawty4fYYm1y/yJ2ObZhqPx?= =?us-ascii?Q?Vvrs44JXczwIqKG9C+pOQ08xfP+0tcoKIJt7WT/QH5EqEtzg8TnU866C/9ck?= =?us-ascii?Q?Z4FGdFVyIGVklQMid4ftxFTB556T7SvEsnt3wnwcQPkW7Yi62L6cllqenU2+?= =?us-ascii?Q?vxdvKakRPzn4iftJ2M8d9yevHn34GvgQIcMtAzv7?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB5167.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5206a814-c91b-4570-1cf7-08da8cda4749 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2022 11:57:15.2454 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: RqxI1vucC4D3HeLynm+ZMDk5I/phoMCnKIfagGoYw1lBzq4+o1ZrplFGiViWeD9JmoJkmQKE60wlW9RIHFJbsSYq9KWfjFRCXUGeGe3E6k4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2736 X-Proofpoint-ORIG-GUID: MfR2bYGXdGsN0oi75qs8hATt-hm_IjgO X-Proofpoint-GUID: MfR2bYGXdGsN0oi75qs8hATt-hm_IjgO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-09-02_02,2022-08-31_03,2022-06-22_01 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 Thanks Ruifeng for the code review and feedback. Please find my response in= line. > -----Original Message----- > From: Ruifeng Wang > Sent: Friday, September 2, 2022 12:54 PM > To: Amit Prakash Shukla ; Maxime Coquelin > ; Chenbo Xia > Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran ; > stable@dpdk.org; nd > Subject: [EXT] RE: [PATCH] vhost: compilation fix for GCC-12 >=20 > External Email >=20 > ---------------------------------------------------------------------- > > -----Original Message----- > > From: Amit Prakash Shukla > > Sent: Thursday, September 1, 2022 4:50 PM > > To: Maxime Coquelin ; Chenbo Xia > > > > Cc: dev@dpdk.org; jerinj@marvell.com; stable@dpdk.org; Amit Prakash > > Shukla > > Subject: [PATCH] vhost: compilation fix for GCC-12 > > > > ../lib/vhost/virtio_net.c:941:35: error: > > 'buf_vec[0].buf_len' may be used uninitialized > > [-Werror=3Dmaybe-uninitialized] > > 941 | buf_len =3D buf_vec[vec_idx].buf_len; > > | ~~~~~~~~~~~~~~~~^~~~~~~~ > > ../lib/vhost/virtio_net.c: In function 'virtio_dev_rx_packed': > > ../lib/vhost/virtio_net.c:1285:27: note: 'buf_vec' declared here > > 1285 | struct buf_vector buf_vec[BUF_VECTOR_MAX]; > > | ^~~~~~~ > > cc1: all warnings being treated as errors > > > > Fixes: 93520085efda ("vhost: add packed ring single enqueue") > > Cc: stable@dpdk.org > > > > Signed-off-by: Amit Prakash Shukla > > --- > > lib/vhost/virtio_net.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index > > b3d954aab4..0220bc923c > > 100644 > > --- a/lib/vhost/virtio_net.c > > +++ b/lib/vhost/virtio_net.c > > @@ -1069,6 +1069,12 @@ vhost_enqueue_single_packed(struct virtio_net > *dev, > > else > > max_tries =3D 1; > > > > + /* To avoid GCC-12 warning. > > + * GCC-12 is not evaluating sizeof at compile time. > Is this a compiler behavior change against previous versions? > I tried to find some clue from gcc-12 doc but got nothing. Can you point = me to > any material? Apologies for the wrong wordings in the comment. In the comment I mean, it = seems like=20 point at which sizeof gets evaluated during compilation has changed. I am n= ot sure on it though. I too could not find documentation regarding the same. >=20 > > + */ > > + if (unlikely(size =3D=3D 0)) > > + return -1; > > + > > while (size > 0) { > Change 'while(){}' to 'do{}while()' can be a simpler solution. What do yo= u > think? I agree, solution suggested by you is better than the one in patch. I will = make the suggested changes as part of v2. Thanks. >=20 > Thanks. >=20 > > /* > > * if we tried all available ring items, and still @@ -1574,6 > > +1580,12 @@ vhost_enqueue_async_packed(struct virtio_net *dev, > > else > > max_tries =3D 1; > > > > + /* To avoid GCC-12 warning. > > + * GCC-12 is not evaluating sizeof at compile time. > > + */ > > + if (unlikely(size =3D=3D 0)) > > + return -1; > > + > > while (size > 0) { > > /* > > * if we tried all available ring items, and still > > -- > > 2.25.1