Skip to contentSkip to conversation

vhost: fix slot index in async split virtqueue Tx

PATCH Applied Cheng Jiang 2 participants 3 messages Feb 23, 2023 – Mar 6, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost: fix slot index in async split virtqueue Tx

The slot_idx in the asynchronous Vhost split virtqueue dequeue data path is supposed to be decreased by 1 when desc_to_mbuf() fails.

Fixes 84d5204310d7 ("vhost: support async dequeue for split ring")
---
 lib/vhost/virtio_net.c | 1 +
 1 file changed, 1 insertion(+)
lib/vhost/virtio_net.c +1 -0
index 8caf05319e..374007a61a 100644
@@ -3720,6 +3720,7 @@ virtio_dev_tx_async_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
 				allocerr_warned = true;
 			}
 			dropped = true;
+			slot_idx--;
 			break;
 		}
 

--
2.35.1

Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Cheng Jiang

The slot_idx in the asynchronous Vhost split virtqueue dequeue data path is supposed to be decreased by 1 when desc_to_mbuf() fails.

Fixes 84d5204310d7 ("vhost: support async dequeue for split ring")
---
  lib/vhost/virtio_net.c | 1 +
  1 file changed, 1 insertion(+)
lib/vhost/virtio_net.c +1 -1
index 8caf05319e..374007a61a 100644
@@ -3720,6 +3720,7 @@ virtio_dev_tx_async_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
  				allocerr_warned = true;
  			}
  			dropped = true;
+			slot_idx--;
  			break;
  		}
 
--
Quoted 2 lines

2.35.1

Thanks,
Maxime

#2 lore raw
In reply to Cheng Jiang
Quoted 24 lines · Cheng Jiang

The slot_idx in the asynchronous Vhost split virtqueue dequeue data path is supposed to be decreased by 1 when desc_to_mbuf() fails.

Fixes 84d5204310d7 ("vhost: support async dequeue for split ring")
---
  lib/vhost/virtio_net.c | 1 +
  1 file changed, 1 insertion(+)
lib/vhost/virtio_net.c +1 -1
index 8caf05319e..374007a61a 100644
@@ -3720,6 +3720,7 @@ virtio_dev_tx_async_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
  				allocerr_warned = true;
  			}
  			dropped = true;
+			slot_idx--;
  			break;
  		}
 
--
Quoted 2 lines

2.35.1

Applied to dpdk-next-virtio/main.

Thanks,
Maxime