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 D3081A0544; Fri, 2 Sep 2022 09:23:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AE12240693; Fri, 2 Sep 2022 09:23:52 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80059.outbound.protection.outlook.com [40.107.8.59]) by mails.dpdk.org (Postfix) with ESMTP id 4B54840684; Fri, 2 Sep 2022 09:23:51 +0200 (CEST) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=eLCAKXU8uo71qcPmsHX90tzrFOcflX/S/n0Wlgmwk0ItDurLLGLyl8LfIiWZ/WAwBmPbwBMeAYjrWsyf5p2kCs76gNR502viO7P7tSToUSO5kBx5MksCcNQoA2A6h/QtgWS/mjfvKl30uUsV/56MU+0/nldUekS2OCSqwcQmeCAWLpu37f0A03j/+RvpxVytK60+B50neYExJafXr5jgzh3Qiyg4xzcJz0umGwPpn4bdmXsMtDQMjg2AB6/IN4IFO7mjqq1XIU44Ts621OOGfUpjOenYZDUfhmKnRlq6rWZ2F/thDQbe3sxPb28ZOE/9S5kPJSdBVxgmH5CT3zgHqw== ARC-Message-Signature: i=2; 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=9i5bD4UV9h6ge4IsTBqrkqEn45g7ezwWqj5aaSaiJ/c=; b=QhmjpFSUa+AVlcPtHVxHc+PK9+lwabP6mo7O4dAwMLeubm5IsQzW9y7jVMGMfxxq1x6GlwmhzzSH2Viau69vvIiNk9O2YhkeHPEBltGYljped2TtyQG/wdsUKo0RavatD9/6rLsxZhRbbZEJbT4RASlBIuY5kdIFqHHEmxMr97gSFlC6YwvGzsqeRTJc54olZi5hHKO837GFdwUD+eEqog8h1Lo145sz6vt4AnfmzuVZgKNC3oHbhE1Y62QFuoOgxDo0ll4Ud0w1UfChJllh6eH+hrzkPKGvvyDcOSPTv4aRu/ytfua8JBXg9rgmvKu8911GFVH6Tmzt/OEy51jLZQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=dpdk.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9i5bD4UV9h6ge4IsTBqrkqEn45g7ezwWqj5aaSaiJ/c=; b=Yfan0Z0nARNXESlh/DWWwxpn2amPh83HJuyxLWdEUNYTsowNU9tJrhHGY+0wAWOFG5y7u3QRMPf4CmsFx7EOUAoSJUYs8Uu4LTkRX7hNkOAqmOvCE1CQvgiBBukzG1Gn8TxFfozvCTheXGvwLyRyD9pYHpJn09+cuxPFGBTy5nU= Received: from FR3P281CA0086.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::13) by DB3PR08MB9111.eurprd08.prod.outlook.com (2603:10a6:10:43c::19) 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 07:23:49 +0000 Received: from VE1EUR03FT062.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:1f:cafe::c4) by FR3P281CA0086.outlook.office365.com (2603:10a6:d10:1f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.6 via Frontend Transport; Fri, 2 Sep 2022 07:23:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT062.mail.protection.outlook.com (10.152.18.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10 via Frontend Transport; Fri, 2 Sep 2022 07:23:48 +0000 Received: ("Tessian outbound fccf984e7173:v123"); Fri, 02 Sep 2022 07:23:48 +0000 X-CR-MTA-TID: 64aa7808 Received: from dbe5a2f00e65.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3F885C75-0603-4F43-8049-1FED932BC93D.1; Fri, 02 Sep 2022 07:23:42 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id dbe5a2f00e65.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 02 Sep 2022 07:23:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ueh0oxBwdUUJYxG09nbLrQ5dQM8Xo0WWX/Sw757l0nCHBp6+4DCjCMJ5COWnxnWOWZkvSGSB17M/XARcGmEb59Yh9Lavc/Wmzv8ocfh2u1OIbBTSy1QRm5RNBSuTYW803lotp9befWanLjxyIDBULK8QuaR8kW5iA7rm1+hVNHF0QuZQIQVxVeb9I8Q8S62AGjrKWxC0aWpzeKmEE/hXoIOphOIgnoiURMxOTTVOSU0IpU3oYEVfz9GAPtVYaVmYzIWf0SQ907yX5mhNoTyormfzN+oO8THKJmQXkg1vIGBzeRa2/LbobXhmiDWYE4wVwNsj7jvbYwU/6dxFVG7BMA== 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=9i5bD4UV9h6ge4IsTBqrkqEn45g7ezwWqj5aaSaiJ/c=; b=ikjNfBfwsxAG8FYvzfXQdKVVHxth9U7JB9AayiX6CKKmi5MJ0IdVCDE4xDK8c7NOlIvoZ4gCTXw/luabDpBeZHvwAPAVDeL/yD5KsDFbd0piCKsllLvw/NsDY7Rb2aM1XchcCdNGANiG73N4jxa+HuHlLifevryuWgP+dHDasT8X9wANeIAgMdg+MH0Tnws93dAvx4pOKja8TVYPdivrDYgjomnW3B0JktBjqE8XiH2qVQoWcvv7xri0RYmc/XsqIDGv/W5gTNdLCLvtuO6kKeOO8G7TJWfaEqfk3jdvYjkoDXeHHqKhFpKCEUMaKverv7YD8nNPXso4i4NV80XvPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9i5bD4UV9h6ge4IsTBqrkqEn45g7ezwWqj5aaSaiJ/c=; b=Yfan0Z0nARNXESlh/DWWwxpn2amPh83HJuyxLWdEUNYTsowNU9tJrhHGY+0wAWOFG5y7u3QRMPf4CmsFx7EOUAoSJUYs8Uu4LTkRX7hNkOAqmOvCE1CQvgiBBukzG1Gn8TxFfozvCTheXGvwLyRyD9pYHpJn09+cuxPFGBTy5nU= Received: from AS8PR08MB7080.eurprd08.prod.outlook.com (2603:10a6:20b:401::19) by DU0PR08MB9873.eurprd08.prod.outlook.com (2603:10a6:10:421::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.14; Fri, 2 Sep 2022 07:23:39 +0000 Received: from AS8PR08MB7080.eurprd08.prod.outlook.com ([fe80::8d6b:a2d2:5fbb:e398]) by AS8PR08MB7080.eurprd08.prod.outlook.com ([fe80::8d6b:a2d2:5fbb:e398%4]) with mapi id 15.20.5588.014; Fri, 2 Sep 2022 07:23:39 +0000 From: Ruifeng Wang To: Amit Prakash Shukla , Maxime Coquelin , Chenbo Xia CC: "dev@dpdk.org" , "jerinj@marvell.com" , "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/UwADvEUAuxUOX4CwLvtRfta3Lub+A Date: Fri, 2 Sep 2022 07:23:39 +0000 Message-ID: References: <20220901084943.3075710-1-amitprakashs@marvell.com> In-Reply-To: <20220901084943.3075710-1-amitprakashs@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 339C4D2452032F48BC682AD6A07B91EE.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-MS-Office365-Filtering-Correlation-Id: 952af96c-c8e1-445c-ad4a-08da8cb41442 x-ms-traffictypediagnostic: DU0PR08MB9873:EE_|VE1EUR03FT062:EE_|DB3PR08MB9111:EE_ x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: y0z+Qb7ezBb8bZaTrpa97vOFQK+clWn5DQV5UUhroidhV6iLxmvfOiJD4SicLkuXJYrLDSdhNgT/jiAQ07H+LgVPlkayq2UuQ9lepo2O0pJKlhDhU2O1k6oQ7leDRxmV5HKEMae1Kf3eyikWyX5T7hY3xK4d3/6OWC15BUzrriahGaMy0U/wlAWpgQu696Zw6rJIuzXohn/qFj+nA3NAnIXaHNA4EeWOgYudcgAwjVuv3L5fYgjdieiNhSYt/hgNc9+H2sWfQi9bDhxAN4oQg258tEks21eWo/SZVgar/rue56udg+ajjRgKyk2Wtj767NoHV+bibUZ7/wUH3Ue+e9pLhcSxXkn8BJxtv60x+bWO6GAYIc9DX9Y5DgGG0u6JfZWdMPukyVExcm/0Gye2+YcpPkWYzlosJWJUzDC+0ureScopeKQ49tp6cYL3Ool35Z5H4t1fZ/DYf1M1S5uH872vJG9FvIKlmdfODdcWWOj2bjZalxTTMTrRj+rPLIh8q9ebMsZmLyiiLZq2zV2p/vGMkzx1cYclQwXG4iP9gA7yglfDewumzm3B5wpI76HNwoX2NlqK8WlyiM2OYmafVLW+NA+TLvGQaNI5cxbPcfkbFIgCBK3K79G4+y3XHCd/ycTbMVxGDqTU/59hDKYKdOIArABSq3Q5qyc20DGE97hYhksLQJtBcmux7nONAk2LyGprxxcEQGaeqPyZ2VWtHkBqIPu2LAcNOFC1HYATr0uThp7xB94dv4Y45w0NF43ZiPqEDMOt7gIkZPQjNg24Cg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB7080.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(136003)(366004)(346002)(376002)(396003)(39860400002)(86362001)(66946007)(66556008)(66446008)(64756008)(8676002)(4326008)(66476007)(71200400001)(76116006)(478600001)(54906003)(38070700005)(110136005)(316002)(38100700002)(122000001)(53546011)(8936002)(6506007)(52536014)(83380400001)(26005)(9686003)(186003)(5660300002)(7696005)(55016003)(33656002)(41300700001)(2906002); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9873 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a9b7b450-d0cf-4ea8-9f3f-08da8cb40ea1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rxnues7xIMRuVIsY3gZK7Czrc9X6Yecnj8ccMRfBrxLJQ4s8bnMzjbSzWDfMTDixexC90jMXMqh3HeX+w0xstMZdKTs4jUBw08eL433WOixH9u4AtISbc0rEiR+lsL3tjj4yC5IsOqbeJt0SNU9o4274QiexUlzmvWM5Ac7oMjDDfRZGZok+prl50GTLsknho0Yd4QjlJLg+ccPXWRpwZvbO3HvjKAYDSLR3sbn3/g8IbOdNpEpcSQ9vvWc8NX0SpczT33RGiG2grQ7olOJ20BBkV2DXx7Gut1si13LrMOnwGJNY+A6mx9H+A//fpgvWj5GmDIZnOHh03J//IwTb/MxISSKJ4zbcts/jUp/jJUyhlDciqpRjbor+WIEQaWEU8lRzfIoh0YwwBR8gCbdgTsQl2Dp842jWxczUwRFnhC2MOt7apLUZUP5dEWWRbY3N2zardvTrQOrrryq6m1aJ6VC+H4Yn4RAbpIxIPvxaFmF6ND5CM0MwuLx2Rgp21tycp3pROAg6Q7v/6AJr4L/43unAfFgLdVMemzkNQwW1tth69oM8ohRm1SduhUBVFz9yxngSmPB0p9eB1MaYqFYb4qsCMfdRZMlEf9xjuBsmoSeUZpCBf+DJm+a1M4dFr+VVkC98w3X/ndGxZGS6rcHRImGNw8ldXHYC1hO2LKe6jrfKs4BwjAdao2xDK2CV3qltK7CEXvyPtUKH8nG4M/VDQcLXD1A205RnZ8b9tMWjU3CZoKFnusCOfsOhHEGXT8rXsCpfNDo2VCvtSQgp83GQ+A== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230016)(4636009)(396003)(376002)(346002)(136003)(39860400002)(36840700001)(40470700004)(46966006)(40480700001)(4326008)(82310400005)(81166007)(478600001)(82740400003)(70586007)(55016003)(8676002)(70206006)(450100002)(356005)(316002)(54906003)(110136005)(186003)(336012)(36860700001)(40460700003)(83380400001)(47076005)(6506007)(33656002)(41300700001)(53546011)(7696005)(86362001)(5660300002)(9686003)(26005)(8936002)(2906002)(52536014); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2022 07:23:48.6810 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 952af96c-c8e1-445c-ad4a-08da8cb41442 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB9111 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 > -----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 Shukl= a > > Subject: [PATCH] vhost: compilation fix for GCC-12 >=20 > ../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 >=20 > Fixes: 93520085efda ("vhost: add packed ring single enqueue") > Cc: stable@dpdk.org >=20 > Signed-off-by: Amit Prakash Shukla > --- > lib/vhost/virtio_net.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index b3d954= aab4..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; >=20 > + /* 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? > + */ > + if (unlikely(size =3D=3D 0)) > + return -1; > + > while (size > 0) { Change 'while(){}' to 'do{}while()' can be a simpler solution. What do you = think? Thanks. > /* > * 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; >=20 > + /* 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