[dpdk-stable] [PATCH v2] net/virtio: fix check scatter on all Rx queues

Peng, ZhihongX zhihongx.peng at intel.com
Mon Oct 11 04:22:28 CEST 2021


> -----Original Message-----
> From: Peng, ZhihongX <zhihongx.peng at intel.com>
> Sent: Friday, October 8, 2021 1:50 PM
> To: Xia, Chenbo <chenbo.xia at intel.com>; maxime.coquelin at redhat.com
> Cc: dev at dpdk.org; ivan.ilchenko at oktetlabs.ru; Peng, ZhihongX
> <zhihongx.peng at intel.com>; stable at dpdk.org
> Subject: [PATCH v2] net/virtio: fix check scatter on all Rx queues
> 
> From: Zhihong Peng <zhihongx.peng at intel.com>
> 
> This patch fixes the wrong way to obtain virtqueue.
> The end of virtqueue cannot be judged based on whether the array is NULL.
> 
> Fixes: 4e8169eb0d2d (net/virtio: fix Rx scatter offload)
> Cc: stable at dpdk.org
> 
> Signed-off-by: Zhihong Peng <zhihongx.peng at intel.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c
> b/drivers/net/virtio/virtio_ethdev.c
> index b60eeb24ab..213110cff4 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -888,8 +888,11 @@ virtio_check_scatter_on_all_rx_queues(struct
> rte_eth_dev *dev,
>  	if (hw->vqs == NULL)
>  		return true;
> 
> -	for (qidx = 0; (vq = hw->vqs[2 * qidx +
> VTNET_SQ_RQ_QUEUE_IDX]) != NULL;
> -	     qidx++) {
> +	for (qidx = 0; qidx < hw->max_queue_pairs; qidx++) {
> +		vq = hw->vqs[2 * qidx + VTNET_SQ_RQ_QUEUE_IDX];
> +		if (vq == NULL)
> +			continue;
> +
>  		rxvq = &vq->rxq;
>  		if (rxvq->mpool == NULL)
>  			continue;
> --
> 2.25.1

Hi Maxime,
Can you give me an ack?



More information about the stable mailing list