DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tiwei Bie <tiwei.bie@intel.com>
To: maxime.coquelin@redhat.com, zhihong.wang@intel.com, dev@dpdk.org
Cc: stable@dpdk.org
Subject: [dpdk-dev] [PATCH 1/2] vhost: fix IOVA access for packed ring
Date: Tue,  6 Nov 2018 14:40:21 +0800	[thread overview]
Message-ID: <20181106064022.21566-2-tiwei.bie@intel.com> (raw)
In-Reply-To: <20181106064022.21566-1-tiwei.bie@intel.com>

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 <tiwei.bie@intel.com>
---
 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))
-- 
2.19.1

  reply	other threads:[~2018-11-06  6:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06  6:40 [dpdk-dev] [PATCH 0/2] Some fixes for virtio and vhost Tiwei Bie
2018-11-06  6:40 ` Tiwei Bie [this message]
2018-11-06 10:54   ` [dpdk-dev] [PATCH 1/2] vhost: fix IOVA access for packed ring Maxime Coquelin
2018-11-06  6:40 ` [dpdk-dev] [PATCH 2/2] net/virtio-user: fix typo in error message Tiwei Bie
2018-11-08 12:18   ` Jens Freimann
2018-11-09 14:52 ` [dpdk-dev] [PATCH 0/2] Some fixes for virtio and vhost Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181106064022.21566-2-tiwei.bie@intel.com \
    --to=tiwei.bie@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).