Skip to contentSkip to conversation

net/virtio: disable event suppression when reconnect

PATCH In review Marvin Liu 3 participants 7 messages May 15, 2020 Network drivers

lore
Share & tools
lore

Marvin Liu

author
#0 lore raw

PATCH 1/1 net/virtio: disable event suppression when reconnect

Event suppression should be disabled after virtqueue initialization. It can be enabled by calling rte_eth_dev_rx_intr_enable later.

drivers/net/virtio/virtqueue.c +2 -0
index 408bba236a..2702e120ee 100644
@@ -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;
 }
Signature · 1 line
2.17.1
#1 lore raw

Hi Marvin,

Comments inline.
Thanks for the fix.

Best Regards,
Xiao

Quoted 10 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Marvin Liu
Sent: Friday, May 15, 2020 9:41 AM
To: [email protected]; Ye, Xiaolong <[email protected]>; Wang, Zhihong <[email protected]>
Cc: [email protected]; Liu, Yong <[email protected]>
Subject: [dpdk-dev] [PATCH] net/virtio: disable event suppression when reconnect

Event suppression should be disabled after virtqueue initialization. It

s/Event suppression/interrupt/g

Quoted 24 lines

can be enabled by calling rte_eth_dev_rx_intr_enable later.

drivers/net/virtio/virtqueue.c +2 -1
index 408bba236a..2702e120ee 100644
@@ -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;
 }
--
Quoted 1 line

2.17.1

Can we backport it to LTS by cc stable?

author
#2 lore raw

Thanks for reminder, xiao. v2 will cc stable branch.
As spec mentioned, notification is more precise in semantic. Will do /event suppression/event notification/s.

Regards,
Marvin

Quoted 59 lines

-----Original Message-----
From: Wang, Xiao W <[email protected]>
Sent: Friday, May 15, 2020 9:53 AM
To: Liu, Yong <[email protected]>; [email protected]; Ye, Xiaolong <[email protected]>; Wang, Zhihong <[email protected]>
Cc: [email protected]; Liu, Yong <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] net/virtio: disable event suppression when reconnect

Hi Marvin,

Comments inline.
Thanks for the fix.

Best Regards,
Xiao

Quoted 10 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Marvin Liu
Sent: Friday, May 15, 2020 9:41 AM
To: [email protected]; Ye, Xiaolong <[email protected]>; Wang, Zhihong <[email protected]>
Cc: [email protected]; Liu, Yong <[email protected]>
Subject: [dpdk-dev] [PATCH] net/virtio: disable event suppression when reconnect

Event suppression should be disabled after virtqueue initialization. It

s/Event suppression/interrupt/g

Quoted 24 lines

can be enabled by calling rte_eth_dev_rx_intr_enable later.

drivers/net/virtio/virtqueue.c +2 -1
index 408bba236a..2702e120ee 100644
@@ -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;
 }
--
Quoted 1 line

2.17.1

Can we backport it to LTS by cc stable?

author
#3 lore raw

PATCH v2 1/1 net/virtio: fix unexpected event after reconnect

In reply to Marvin Liu

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")

---
v2: commit log update and cc stable

drivers/net/virtio/virtqueue.c +2 -0
index 0b4e3bf3e..02c8b9fc5 100644
@@ -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;
 }
Signature · 1 line
2.17.1
Acked-by on v2 1/1
#4 lore raw

Re: [dpdk-dev] [PATCH v2] net/virtio: fix unexpected event after reconnect

Hi,

Best Regards,
Xiao

Quoted 41 lines

-----Original Message-----
From: Liu, Yong <[email protected]>
Sent: Friday, May 15, 2020 10:35 AM
To: [email protected]; Ye, Xiaolong <[email protected]>; Wang, Zhihong <[email protected]>; Wang, Xiao W <[email protected]>
Cc: [email protected]; Liu, Yong <[email protected]>; [email protected]
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")

---
v2: commit log update and cc stable

drivers/net/virtio/virtqueue.c +2 -1
index 0b4e3bf3e..02c8b9fc5 100644
@@ -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;
 }
--
Quoted 1 line

2.17.1

Reviewed-by on v2 1/1
#5 lore raw

Re: [dpdk-dev] [PATCH v2] net/virtio: fix unexpected event after reconnect

In reply to Marvin Liu
Quoted 9 lines · Marvin Liu

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")

Thanks,
Maxime

#6 lore raw

Re: [dpdk-dev] [PATCH v2] net/virtio: fix unexpected event after reconnect

In reply to Marvin Liu
Quoted 11 lines · Marvin Liu

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")

---
v2: commit log update and cc stable

Applied to dpdk-next-virtio/master.

Thanks,
Maxime