DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Tiwei Bie <tiwei.bie@intel.com>, zhihong.wang@intel.com, dev@dpdk.org
Cc: stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/2] vhost: fix IOVA access for packed ring
Date: Tue, 6 Nov 2018 11:54:09 +0100	[thread overview]
Message-ID: <b1762c25-a645-83e8-a9b4-579d69718a59@redhat.com> (raw)
In-Reply-To: <20181106064022.21566-2-tiwei.bie@intel.com>



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 <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))
> 

Ouch, good catch!

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

  reply	other threads:[~2018-11-06 10:54 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 ` [dpdk-dev] [PATCH 1/2] vhost: fix IOVA access for packed ring Tiwei Bie
2018-11-06 10:54   ` Maxime Coquelin [this message]
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=b1762c25-a645-83e8-a9b4-579d69718a59@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=tiwei.bie@intel.com \
    --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).