From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 89A4BA04B1; Wed, 4 Nov 2020 18:05:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6522C2E8F; Wed, 4 Nov 2020 18:05:36 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 376C92C27 for ; Wed, 4 Nov 2020 18:05:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604509532; 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=vCV7R1E9sp7JPU2WbjrJIzSZxXyBMm/zaOoLrNVA+HI=; b=QNmJUICvCy5EFIZPAkWSff4zZmgGLgPllUAeY8oW2N4B+szjNStIrMMddx+6Y7dYQbAtrB Xp4xDBXYDFiEFdkUVLC3d4iFPrtOJRdfgxr518x2orF+eTdtzM3kMswNprDJPTVuUQgWVl 0FhPSioBx9ugJzNq4LG/FyZZn1e1wWQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-590-vLn3htqJMsCa0vJ00BeQ2g-1; Wed, 04 Nov 2020 12:05:29 -0500 X-MC-Unique: vLn3htqJMsCa0vJ00BeQ2g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CC2C78030AE; Wed, 4 Nov 2020 17:05:27 +0000 (UTC) Received: from [10.36.110.29] (unknown [10.36.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C768521E9E; Wed, 4 Nov 2020 17:05:26 +0000 (UTC) To: Conor Walsh , chenbo.xia@intel.com Cc: dev@dpdk.org, linglix.chen@intel.com References: <20201104170205.1688705-1-conor.walsh@intel.com> From: Maxime Coquelin Message-ID: <7dbee39e-3010-f0bb-4b3f-94ffdcb18aa1@redhat.com> Date: Wed, 4 Nov 2020 18:05:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <20201104170205.1688705-1-conor.walsh@intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v1] vhost: slot_idx needs to be initialised to fix gcc compile error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Conor, On 11/4/20 6:02 PM, Conor Walsh wrote: > When DPDK is compiled with gcc < 9 with the optimization level set to 1 > gcc sees slot_idx as possibly being uninitialised. To correct this error > slot_idx has been initialised to 0. > > Signed-off-by: Conor Walsh > --- > lib/librte_vhost/virtio_net.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c > index 3a019b7446..bef39180b5 100644 > --- a/lib/librte_vhost/virtio_net.c > +++ b/lib/librte_vhost/virtio_net.c > @@ -1491,7 +1491,7 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev, > struct iovec *dst_iovec = vec_pool + (VHOST_MAX_ASYNC_VEC >> 1); > struct rte_vhost_iov_iter *src_it = it_pool; > struct rte_vhost_iov_iter *dst_it = it_pool + 1; > - uint16_t n_free_slot, slot_idx; > + uint16_t n_free_slot, slot_idx = 0; > uint16_t pkt_err = 0; > uint16_t segs_await = 0; > struct async_inflight_info *pkts_info = vq->async_pkts_info; > Same patch has already been submitted and merged: https://patches.dpdk.org/patch/82281/ Thanks, Maxime