vhost: fix slot index in async split virtqueue Tx

Message ID 20230223023032.681-1-cheng1.jiang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series vhost: fix slot index in async split virtqueue Tx |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot: build fail github build: failed
ci/iol-testing fail Testing issues
ci/iol-x86_64-unit-testing fail Testing issues
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Jiang, Cheng1 Feb. 23, 2023, 2:30 a.m. UTC
  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")
Cc: stable@dpdk.org

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
---
 lib/vhost/virtio_net.c | 1 +
 1 file changed, 1 insertion(+)

--
2.35.1
  

Comments

Maxime Coquelin March 2, 2023, 10:23 a.m. UTC | #1
On 2/23/23 03:30, Cheng Jiang wrote:
> 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
> ---
>   lib/vhost/virtio_net.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
> index 8caf05319e..374007a61a 100644
> --- a/lib/vhost/virtio_net.c
> +++ b/lib/vhost/virtio_net.c
> @@ -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: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  
Maxime Coquelin March 6, 2023, 2:23 p.m. UTC | #2
On 2/23/23 03:30, Cheng Jiang wrote:
> 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
> ---
>   lib/vhost/virtio_net.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
> index 8caf05319e..374007a61a 100644
> --- a/lib/vhost/virtio_net.c
> +++ b/lib/vhost/virtio_net.c
> @@ -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
> 

Applied to dpdk-next-virtio/main.

Thanks,
Maxime
  

Patch

diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
index 8caf05319e..374007a61a 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -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;
 		}