[v2] net/virtio: fix unexpected event after reconnect

Message ID 20200515023507.46543-1-yong.liu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series [v2] net/virtio: fix unexpected event after reconnect |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/travis-robot warning Travis build: failed
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues

Commit Message

Marvin Liu May 15, 2020, 2:35 a.m. UTC
  Event notification should be disabled after virtqueue initialization and
enabled by calling rte_eth_dev_rx_intr_enable later. When virtio user
device reconnecting to vhost, virtqueue_disable_intr should be called to
disable event notification.

Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode")
Cc: stable@dpdk.org

Signed-off-by: Marvin Liu <yong.liu@intel.com>
---
v2: commit log update and cc stable
  

Comments

Xiao Wang May 15, 2020, 2:46 a.m. UTC | #1
Hi,

Best Regards,
Xiao

> -----Original Message-----
> From: Liu, Yong <yong.liu@intel.com>
> Sent: Friday, May 15, 2020 10:35 AM
> To: maxime.coquelin@redhat.com; Ye, Xiaolong <xiaolong.ye@intel.com>;
> Wang, Zhihong <zhihong.wang@intel.com>; Wang, Xiao W
> <xiao.w.wang@intel.com>
> Cc: dev@dpdk.org; Liu, Yong <yong.liu@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] net/virtio: fix unexpected event after reconnect
> 
> Event notification should be disabled after virtqueue initialization and
> enabled by calling rte_eth_dev_rx_intr_enable later. When virtio user
> device reconnecting to vhost, virtqueue_disable_intr should be called to
> disable event notification.
> 
> Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Marvin Liu <yong.liu@intel.com>
> ---
> v2: commit log update and cc stable
> 
> diff --git a/drivers/net/virtio/virtqueue.c b/drivers/net/virtio/virtqueue.c
> index 0b4e3bf3e..02c8b9fc5 100644
> --- a/drivers/net/virtio/virtqueue.c
> +++ b/drivers/net/virtio/virtqueue.c
> @@ -174,6 +174,7 @@ virtqueue_rxvq_reset_packed(struct virtqueue *vq)
> 
>  	vring_desc_init_packed(vq, size);
> 
> +	virtqueue_disable_intr(vq);
>  	return 0;
>  }
> 
> @@ -210,5 +211,6 @@ virtqueue_txvq_reset_packed(struct virtqueue *vq)
> 
>  	vring_desc_init_packed(vq, size);
> 
> +	virtqueue_disable_intr(vq);
>  	return 0;
>  }
> --
> 2.17.1

Acked-by: Xiao Wang <xiao.w.wang@intel.com>
  
Maxime Coquelin May 15, 2020, 7:51 a.m. UTC | #2
On 5/15/20 4:35 AM, Marvin Liu wrote:
> Event notification should be disabled after virtqueue initialization and
> enabled by calling rte_eth_dev_rx_intr_enable later. When virtio user
> device reconnecting to vhost, virtqueue_disable_intr should be called to
> disable event notification.
> 
> Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Marvin Liu <yong.liu@intel.com>


Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  
Maxime Coquelin May 15, 2020, 8:37 a.m. UTC | #3
On 5/15/20 4:35 AM, Marvin Liu wrote:
> Event notification should be disabled after virtqueue initialization and
> enabled by calling rte_eth_dev_rx_intr_enable later. When virtio user
> device reconnecting to vhost, virtqueue_disable_intr should be called to
> disable event notification.
> 
> Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Marvin Liu <yong.liu@intel.com>
> ---
> v2: commit log update and cc stable

Applied to dpdk-next-virtio/master.

Thanks,
Maxime
  

Patch

diff --git a/drivers/net/virtio/virtqueue.c b/drivers/net/virtio/virtqueue.c
index 0b4e3bf3e..02c8b9fc5 100644
--- a/drivers/net/virtio/virtqueue.c
+++ b/drivers/net/virtio/virtqueue.c
@@ -174,6 +174,7 @@  virtqueue_rxvq_reset_packed(struct virtqueue *vq)
 
 	vring_desc_init_packed(vq, size);
 
+	virtqueue_disable_intr(vq);
 	return 0;
 }
 
@@ -210,5 +211,6 @@  virtqueue_txvq_reset_packed(struct virtqueue *vq)
 
 	vring_desc_init_packed(vq, size);
 
+	virtqueue_disable_intr(vq);
 	return 0;
 }