From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 888351B19; Wed, 12 Sep 2018 08:57:59 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BCC4740216F5; Wed, 12 Sep 2018 06:57:58 +0000 (UTC) Received: from [10.36.112.35] (ovpn-112-35.ams2.redhat.com [10.36.112.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7F8E62156701; Wed, 12 Sep 2018 06:57:57 +0000 (UTC) To: Tiwei Bie , zhihong.wang@intel.com, dev@dpdk.org Cc: stable@dpdk.org References: <20180906045927.12619-1-tiwei.bie@intel.com> From: Maxime Coquelin Message-ID: Date: Wed, 12 Sep 2018 08:57:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180906045927.12619-1-tiwei.bie@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 12 Sep 2018 06:57:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 12 Sep 2018 06:57:58 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH] vhost: fix return value on enqueue path 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: , X-List-Received-Date: Wed, 12 Sep 2018 06:57:59 -0000 On 09/06/2018 06:59 AM, Tiwei Bie wrote: > Fixes: 62250c1d0978 ("vhost: extract split ring handling from Rx and Tx functions") > Fixes: a922401f35cc ("vhost: add Rx support for packed ring") > Cc: stable@dpdk.org > > Signed-off-by: Tiwei Bie > --- > lib/librte_vhost/virtio_net.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) Good catch! Thanks for the fix. Reviewed-by: Maxime Coquelin > diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c > index 99c7afc88..4bfae76a6 100644 > --- a/lib/librte_vhost/virtio_net.c > +++ b/lib/librte_vhost/virtio_net.c > @@ -888,6 +888,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, > struct rte_mbuf **pkts, uint32_t count) > { > struct vhost_virtqueue *vq; > + uint32_t nb_tx = 0; > > VHOST_LOG_DEBUG(VHOST_DATA, "(%d) %s\n", dev->vid, __func__); > if (unlikely(!is_valid_virt_queue_idx(queue_id, 0, dev->nr_vring))) { > @@ -915,9 +916,9 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, > goto out; > > if (vq_is_packed(dev)) > - count = virtio_dev_rx_packed(dev, vq, pkts, count); > + nb_tx = virtio_dev_rx_packed(dev, vq, pkts, count); > else > - count = virtio_dev_rx_split(dev, vq, pkts, count); > + nb_tx = virtio_dev_rx_split(dev, vq, pkts, count); > > out: > if (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)) > @@ -926,7 +927,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, > out_access_unlock: > rte_spinlock_unlock(&vq->access_lock); > > - return count; > + return nb_tx; > } > > uint16_t >