net/virtio: fix unexpected event after reconnect
authorMarvin Liu <yong.liu@intel.com>
Fri, 15 May 2020 02:35:07 +0000 (10:35 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 18 May 2020 18:35:57 +0000 (20:35 +0200)
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>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtqueue.c

index 408bba2..2702e12 100644 (file)
@@ -175,6 +175,7 @@ virtqueue_rxvq_reset_packed(struct virtqueue *vq)
 
        vring_desc_init_packed(vq, size);
 
+       virtqueue_disable_intr(vq);
        return 0;
 }
 
@@ -211,5 +212,6 @@ virtqueue_txvq_reset_packed(struct virtqueue *vq)
 
        vring_desc_init_packed(vq, size);
 
+       virtqueue_disable_intr(vq);
        return 0;
 }