Some fixes for virtio and vhost
cover Some fixes for virtio and vhost
Tiwei Bie (2):
vhost: fix IOVA access for packed ring
net/virtio-user: fix typo in error message
drivers/net/virtio/virtio_user_ethdev.c | 2 +- lib/librte_vhost/virtio_net.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.19.1
PATCH 1/2 vhost: fix IOVA access for packed ring
We should apply for RO access when receiving packets from the VM and apply for RW access when sending packets to the VM.
--- lib/librte_vhost/virtio_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_vhost/virtio_net.c +2 -2
@@ -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 ))
Signature · 1 line
2.19.1
Re: [PATCH 1/2] vhost: fix IOVA access for packed ring
Quoted 27 lines · Tiwei Bie
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")Signed-off-by Tiwei Bie <[email protected]>--- lib/librte_vhost/virtio_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/librte_vhost/virtio_net.c +1
-1@@ -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);
lib/librte_vhost/virtio_net.c virtio_dev_tx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq, · line 1509
Quoted 8 lines
lib/librte_vhost/virtio_net.c +1
-1@@ -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!
Thanks,
Maxime
PATCH 2/2 net/virtio-user: fix typo in error message
In reply to Tiwei BieThe param we are checking is VIRTIO_USER_ARG_PATH, instead of VIRTIO_USER_ARG_QUEUE_SIZE.
--- drivers/net/virtio/virtio_user_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/virtio/virtio_user_ethdev.c +1 -1
@@ -484,7 +484,7 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev) } }else {PMD_INIT_LOG (ERR ,"arg %s is mandatory for virtio_user" , -VIRTIO_USER_ARG_QUEUE_SIZE ); +VIRTIO_USER_ARG_PATH ); goto end; }
Signature · 1 line
2.19.1
Re: [PATCH 2/2] net/virtio-user: fix typo in error message
Quoted 11 lines · Tiwei Bie
The param we are checking is
VIRTIO_USER_ARG_PATH, instead ofVIRTIO_USER_ARG_QUEUE_SIZE.Fixes ce2eabdd43ec ("net/virtio-user: add virtual device")Signed-off-by Tiwei Bie <[email protected]>---
drivers/net/virtio/virtio_user_ethdev.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Maxime Coquelin
AppliedQuoted 8 lines · Tiwei Bie
Tiwei Bie (2):
vhost: fix IOVA access for packed ring
net/virtio-user: fix typo in error messagedrivers/net/virtio/virtio_user_ethdev.c | 2 +- lib/librte_vhost/virtio_net.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Applied to dpdk-next-virtio/master
Thanks,
Maxime