From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH 4/7] vhost: translate iovas at vectors fill time Date: Thu, 21 Jun 2018 16:45:39 +0200 Message-ID: <87b15952-8be9-91b2-c079-f486add7e40f@redhat.com> References: <20180608103913.11517-1-maxime.coquelin@redhat.com> <20180608103913.11517-5-maxime.coquelin@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit To: zhihong.wang@intel.com, tiwei.bie@intel.com, dev@dpdk.org Return-path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 421BD1B903 for ; Thu, 21 Jun 2018 16:45:44 +0200 (CEST) In-Reply-To: <20180608103913.11517-5-maxime.coquelin@redhat.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 06/08/2018 12:39 PM, Maxime Coquelin wrote: > @@ -584,7 +578,8 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, > vq->last_avail_idx + num_buffers); > > if (copy_mbuf_to_desc(dev, vq, pkts[pkt_idx], > - buf_vec, num_buffers) < 0) { > + buf_vec, num_buffers, > + nr_vec) < 0) { FYI,there is a bug here. num_buffers and nr_vec must be swapped: static __rte_always_inline int copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq, struct rte_mbuf *m, struct buf_vector *buf_vec, uint16_t num_buffers) It can be reproduce with Kernel driver with mrg OFF and with offloads ON. Maxime > vq->shadow_used_idx -= num_buffers;