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 421BD1B903 for ; Thu, 21 Jun 2018 16:45:44 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB9AA400B458; Thu, 21 Jun 2018 14:45:43 +0000 (UTC) Received: from [10.36.112.46] (ovpn-112-46.ams2.redhat.com [10.36.112.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C39782026D6B; Thu, 21 Jun 2018 14:45:40 +0000 (UTC) To: zhihong.wang@intel.com, tiwei.bie@intel.com, dev@dpdk.org References: <20180608103913.11517-1-maxime.coquelin@redhat.com> <20180608103913.11517-5-maxime.coquelin@redhat.com> From: Maxime Coquelin Message-ID: <87b15952-8be9-91b2-c079-f486add7e40f@redhat.com> Date: Thu, 21 Jun 2018 16:45:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180608103913.11517-5-maxime.coquelin@redhat.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.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 21 Jun 2018 14:45:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 21 Jun 2018 14:45:43 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH 4/7] vhost: translate iovas at vectors fill time 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: Thu, 21 Jun 2018 14:45:44 -0000 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;