From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 6BC8949E0; Tue, 6 Nov 2018 11:54:13 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1BDDC074EE7; Tue, 6 Nov 2018 10:54:12 +0000 (UTC) Received: from [10.36.112.40] (ovpn-112-40.ams2.redhat.com [10.36.112.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 24135104C456; Tue, 6 Nov 2018 10:54:10 +0000 (UTC) To: Tiwei Bie , zhihong.wang@intel.com, dev@dpdk.org Cc: stable@dpdk.org References: <20181106064022.21566-1-tiwei.bie@intel.com> <20181106064022.21566-2-tiwei.bie@intel.com> From: Maxime Coquelin Message-ID: Date: Tue, 6 Nov 2018 11:54:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181106064022.21566-2-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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 06 Nov 2018 10:54:12 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 1/2] vhost: fix IOVA access for packed ring 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: Tue, 06 Nov 2018 10:54:13 -0000 On 11/6/18 7:40 AM, Tiwei Bie wrote: > We should apply for RO access when receiving packets from the > VM and apply for RW access when sending packets to the VM. > > Fixes: a922401f35cc ("vhost: add Rx support for packed ring") > Fixes: ae999ce49dcb ("vhost: add Tx support for packed ring") > Cc: stable@dpdk.org > > Signed-off-by: Tiwei Bie > --- > lib/librte_vhost/virtio_net.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c > index 8ad30c94a..5e1a1a727 100644 > --- a/lib/librte_vhost/virtio_net.c > +++ b/lib/librte_vhost/virtio_net.c > @@ -598,7 +598,7 @@ reserve_avail_buf_packed(struct virtio_net *dev, struct vhost_virtqueue *vq, > avail_idx, &desc_count, > buf_vec, &vec_idx, > &buf_id, &len, > - VHOST_ACCESS_RO) < 0)) > + VHOST_ACCESS_RW) < 0)) > return -1; > > len = RTE_MIN(len, size); > @@ -1503,7 +1503,7 @@ virtio_dev_tx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq, > vq->last_avail_idx, &desc_count, > buf_vec, &nr_vec, > &buf_id, &dummy_len, > - VHOST_ACCESS_RW) < 0)) > + VHOST_ACCESS_RO) < 0)) > break; > > if (likely(dev->dequeue_zero_copy == 0)) > Ouch, good catch! Reviewed-by: Maxime Coquelin Thanks, Maxime