Skip to contentSkip to conversation

net/virtio-user: restore callfds index for Rx interrupts

PATCH In review Yuan Wang 4 participants 4 messages Jul 4, 2022 – Jul 5, 2022 Network drivers

lore
Share & tools
lore

Yuan Wang

author
#0 lore raw

PATCH 1/1 net/virtio-user: restore callfds index for Rx interrupts

The callfds[] array stores eventfds sequentially for Rx and Tx vq.

Fixes d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/virtio/virtio_user/virtio_user_dev.c +1 -1
index 35aa76b1ff..f9cada05e4 100644
@@ -417,7 +417,7 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)
 
 	for (i = 0; i < dev->max_queue_pairs; ++i) {
 		if (rte_intr_efds_index_set(eth_dev->intr_handle, i,
-				dev->callfds[i]))
+				dev->callfds[2 * i + VTNET_SQ_RQ_QUEUE_IDX]))
 			return -rte_errno;
 	}
 
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Yuan Wang

The callfds[] array stores eventfds sequentially for Rx and Tx vq.

Fixes d61138d4f0e2 ("drivers: remove direct access to interrupt handle")

Good catch...

This is what I had fixed in 848e93d9001e ("net/virtio-user: fix Rx interrupts with multi-queue").
I suppose the issue has been reintroduced when rebasing Harman series.

Quoted 9 lines
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/virtio/virtio_user/virtio_user_dev.c +0 -0
index 35aa76b1ff..f9cada05e4 100644

drivers/net/virtio/virtio_user/virtio_user_dev.c virtio_user_fill_intr_handle(struct virtio_user_dev *dev) · line 422

Quoted 7 lines
drivers/net/virtio/virtio_user/virtio_user_dev.c +1 -1
@@ -417,7 +417,7 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)
 
        for (i = 0; i < dev->max_queue_pairs; ++i) {
                if (rte_intr_efds_index_set(eth_dev->intr_handle, i,
-                               dev->callfds[i]))
+                               dev->callfds[2 * i + VTNET_SQ_RQ_QUEUE_IDX]))
                        return -rte_errno;
        }
Signature · 1 line
David Marchand
#2 lore raw

04/07/2022 09:42, David Marchand:

Quoted 7 lines · Yuan Wang
Quoted 6 lines

The callfds[] array stores eventfds sequentially for Rx and Tx vq.

Fixes d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
Quoted 7 lines
Quoted 1 line

Good catch...

This is what I had fixed in 848e93d9001e ("net/virtio-user: fix Rx interrupts with multi-queue").
I suppose the issue has been reintroduced when rebasing Harman series.

Then we can re-use your commit title which better convey what is fixed from a user perspective:
net/virtio-user: fix Rx interrupts with multi-queue

#3 lore raw
In reply to Yuan Wang
Quoted 15 lines · Yuan Wang

The callfds[] array stores eventfds sequentially for Rx and Tx vq.

Fixes d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
---
  drivers/net/virtio/virtio_user/virtio_user_dev.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/virtio/virtio_user/virtio_user_dev.c +0 -0
index 35aa76b1ff..f9cada05e4 100644

drivers/net/virtio/virtio_user/virtio_user_dev.c virtio_user_fill_intr_handle(struct virtio_user_dev *dev) · line 423

Quoted 8 lines
drivers/net/virtio/virtio_user/virtio_user_dev.c +1 -1
@@ -417,7 +417,7 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)
 
  	for (i = 0; i < dev->max_queue_pairs; ++i) {
  		if (rte_intr_efds_index_set(eth_dev->intr_handle, i,
-				dev->callfds[i]))
+				dev->callfds[2 * i + VTNET_SQ_RQ_QUEUE_IDX]))
  			return -rte_errno;
  	}
 

Thanks Yuan, good catch!
Applied to dpdk-next-virtio/main.

Maxime