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 AE08AA0544; Fri, 2 Sep 2022 14:42:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 460EE40693; Fri, 2 Sep 2022 14:42:07 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 82FD740685; Fri, 2 Sep 2022 14:42:04 +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 2827gR2b004306; Fri, 2 Sep 2022 05:42:00 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=Zcl6dOjfaxSqJcjQQ6KkeNdILolpvb35JP2FjwgFZFE=; b=azNljI4X5h6QiB1vfHPPVLM+VgeyG0wIPXN/EpH5h4u4DxvxakKMqGE/8ncVOz8NTkLi m98+p35Z96NJQXc9FYzczyCg62lwFYbTITBmIKyy3d1XTBEZmIp8SJcorGxaoeoI2Gns Yq4tq+sfjQ0z43KKkKBnenuySGuHFQKK9Wub+ibvXREW/QFZOZggYzgolM4XpsE1q+g6 m6b9cCaMTN3tyZjw/WgEgHP70WmClTZx5QEin+7c8Lgol7uV3pCzRW7Qx/ozfXjRfn2f jd5MgpZEBPQNlm+hpP7+bAbLRXjR9XIRuMJ6wxC5Fjwm5i9R2AvOFRCZxPh9Agx+Uuu9 sQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3jb3kujuyf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 02 Sep 2022 05:42:00 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 2 Sep 2022 05:41:58 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Fri, 2 Sep 2022 05:41:58 -0700 Received: from localhost.localdomain (unknown [10.28.36.157]) by maili.marvell.com (Postfix) with ESMTP id 5104C5B6935; Fri, 2 Sep 2022 05:41:56 -0700 (PDT) From: Amit Prakash Shukla To: Maxime Coquelin , Chenbo Xia CC: , , , , Amit Prakash Shukla Subject: [PATCH v2] vhost: compilation fix for GCC-12 Date: Fri, 2 Sep 2022 18:11:52 +0530 Message-ID: <20220902124152.3231904-1-amitprakashs@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220901084943.3075710-1-amitprakashs@marvell.com> References: <20220901084943.3075710-1-amitprakashs@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: yleyPiS5nQqkEnlO-E5CgqfsVN6MjswM X-Proofpoint-GUID: yleyPiS5nQqkEnlO-E5CgqfsVN6MjswM 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 ../lib/vhost/virtio_net.c:941:35: error: 'buf_vec[0].buf_len' may be used uninitialized [-Werror=maybe-uninitialized] 941 | buf_len = 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 --- v2: - Changes for code review suggestion lib/vhost/virtio_net.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index b3d954aab4..9b77d3d10f 100644 --- a/lib/vhost/virtio_net.c +++ b/lib/vhost/virtio_net.c @@ -1069,7 +1069,7 @@ vhost_enqueue_single_packed(struct virtio_net *dev, else max_tries = 1; - while (size > 0) { + do { /* * if we tried all available ring items, and still * can't get enough buf, it means something abnormal @@ -1097,7 +1097,7 @@ vhost_enqueue_single_packed(struct virtio_net *dev, avail_idx += desc_count; if (avail_idx >= vq->size) avail_idx -= vq->size; - } + } while (size > 0); if (mbuf_to_desc(dev, vq, pkt, buf_vec, nr_vec, num_buffers, false) < 0) return -1; @@ -1574,7 +1574,7 @@ vhost_enqueue_async_packed(struct virtio_net *dev, else max_tries = 1; - while (size > 0) { + do { /* * if we tried all available ring items, and still * can't get enough buf, it means something abnormal @@ -1601,7 +1601,7 @@ vhost_enqueue_async_packed(struct virtio_net *dev, avail_idx += desc_count; if (avail_idx >= vq->size) avail_idx -= vq->size; - } + } while (size > 0); if (unlikely(mbuf_to_desc(dev, vq, pkt, buf_vec, nr_vec, *nr_buffers, true) < 0)) return -1; -- 2.25.1