[dpdk-dev] [PATCH 02/17] net/virtio: don't call virtio_disable_intr() for packed queues

Tiwei Bie tiwei.bie at intel.com
Mon Mar 19 09:06:46 CET 2018


On Fri, Mar 16, 2018 at 04:21:05PM +0100, Jens Freimann wrote:
> When VIRTIO_F_PACKED_RING is set, don't call virtio_disable_intr().
> This function accesses data structures which are not
> available when packed virtqueues are enabled.

Packed ring has event suppression structures.

Thanks

> 
> Signed-off-by: Jens Freimann <jfreimann at redhat.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index ce4f53d..19536eb 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -313,12 +313,11 @@ struct rte_virtio_xstats_name_off {
>  		vq->vq_desc_tail_idx = (uint16_t)(vq->vq_nentries - 1);
>  
>  		vring_desc_init(vr->desc, size);
> +		/*
> +		 * Disable device(host) interrupting guest
> +		 */
> +		virtqueue_disable_intr(vq);
>  	}
> -
> -	/*
> -	 * Disable device(host) interrupting guest
> -	 */
> -	virtqueue_disable_intr(vq);
>  }
>  
>  static int
> @@ -736,7 +735,8 @@ struct rte_virtio_xstats_name_off {
>  	struct virtnet_rx *rxvq = dev->data->rx_queues[queue_id];
>  	struct virtqueue *vq = rxvq->vq;
>  
> -	virtqueue_disable_intr(vq);
> +	if (!vtpci_packed_queue(vq->hw))
> +		virtqueue_disable_intr(vq);
>  	return 0;
>  }
>  
> -- 
> 1.8.3.1
> 


More information about the dev mailing list