DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio: reconfigure LSC handler when required
@ 2021-08-30 15:13 David Marchand
  2021-08-31 15:54 ` [dpdk-dev] [PATCH v2 0/2] virtio-user interrupt fixes David Marchand
  0 siblings, 1 reply; 7+ messages in thread
From: David Marchand @ 2021-08-30 15:13 UTC (permalink / raw)
  To: dev; +Cc: stable, Maxime Coquelin, Chenbo Xia, Jianfeng Tan, Yuanhan Liu

There is no reason to re-register a interrupt handler for LSC if this
feature was not requested in the first place.
A simple usecase is when asking for Rx interrupts without LSC interrupt.

Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/virtio/virtio_ethdev.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index e58085a2c9..314a291e8c 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1684,13 +1684,15 @@ virtio_configure_intr(struct rte_eth_dev *dev)
 		}
 	}
 
-	/* Re-register callback to update max_intr */
-	rte_intr_callback_unregister(dev->intr_handle,
-				     virtio_interrupt_handler,
-				     dev);
-	rte_intr_callback_register(dev->intr_handle,
-				   virtio_interrupt_handler,
-				   dev);
+	if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {
+		/* Re-register callback to update max_intr */
+		rte_intr_callback_unregister(dev->intr_handle,
+					     virtio_interrupt_handler,
+					     dev);
+		rte_intr_callback_register(dev->intr_handle,
+					   virtio_interrupt_handler,
+					   dev);
+	}
 
 	/* DO NOT try to remove this! This function will enable msix, or QEMU
 	 * will encounter SIGSEGV when DRIVER_OK is sent.
-- 
2.23.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH v2 0/2] virtio-user interrupt fixes
  2021-08-30 15:13 [dpdk-dev] [PATCH] net/virtio: reconfigure LSC handler when required David Marchand
@ 2021-08-31 15:54 ` David Marchand
  2021-08-31 15:54   ` [dpdk-dev] [PATCH v2 1/2] net/virtio: reconfigure LSC handler when required David Marchand
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: David Marchand @ 2021-08-31 15:54 UTC (permalink / raw)
  To: dev; +Cc: ci, Maxime Coquelin, Chenbo Xia

Trying to use virtio-user as a replacement for taps in OVS, I ended up
with some fixes on the interrupt side.
The patches for OVS are not ready yet, but sending the DPDK fixes in
any case.

@CI guys:
Patch 2 probably means there is a hole in the virtio-user interrupt
test plan in DTS (I could not find a setup with
virtio-user+rx interrupts+multi queue).


-- 
David Marchand

David Marchand (2):
  net/virtio: reconfigure LSC handler when required
  net/virtio: fix virtio-user Rx interrupts with multi queue

 drivers/net/virtio/virtio_ethdev.c               | 16 +++++++++-------
 drivers/net/virtio/virtio_user/virtio_user_dev.c |  2 +-
 2 files changed, 10 insertions(+), 8 deletions(-)

-- 
2.23.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH v2 1/2] net/virtio: reconfigure LSC handler when required
  2021-08-31 15:54 ` [dpdk-dev] [PATCH v2 0/2] virtio-user interrupt fixes David Marchand
@ 2021-08-31 15:54   ` David Marchand
  2021-09-14  8:36     ` Maxime Coquelin
  2021-08-31 15:54   ` [dpdk-dev] [PATCH v2 2/2] net/virtio: fix virtio-user Rx interrupts with multi queue David Marchand
  2021-09-14 11:27   ` [dpdk-dev] [PATCH v2 0/2] virtio-user interrupt fixes Maxime Coquelin
  2 siblings, 1 reply; 7+ messages in thread
From: David Marchand @ 2021-08-31 15:54 UTC (permalink / raw)
  To: dev; +Cc: stable, Maxime Coquelin, Chenbo Xia, Jianfeng Tan, Yuanhan Liu

There is no reason to re-register a interrupt handler for LSC if this
feature was not requested in the first place.
A simple usecase is when asking for Rx interrupts without LSC interrupt.

Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/virtio/virtio_ethdev.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index e58085a2c9..314a291e8c 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1684,13 +1684,15 @@ virtio_configure_intr(struct rte_eth_dev *dev)
 		}
 	}
 
-	/* Re-register callback to update max_intr */
-	rte_intr_callback_unregister(dev->intr_handle,
-				     virtio_interrupt_handler,
-				     dev);
-	rte_intr_callback_register(dev->intr_handle,
-				   virtio_interrupt_handler,
-				   dev);
+	if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {
+		/* Re-register callback to update max_intr */
+		rte_intr_callback_unregister(dev->intr_handle,
+					     virtio_interrupt_handler,
+					     dev);
+		rte_intr_callback_register(dev->intr_handle,
+					   virtio_interrupt_handler,
+					   dev);
+	}
 
 	/* DO NOT try to remove this! This function will enable msix, or QEMU
 	 * will encounter SIGSEGV when DRIVER_OK is sent.
-- 
2.23.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH v2 2/2] net/virtio: fix virtio-user Rx interrupts with multi queue
  2021-08-31 15:54 ` [dpdk-dev] [PATCH v2 0/2] virtio-user interrupt fixes David Marchand
  2021-08-31 15:54   ` [dpdk-dev] [PATCH v2 1/2] net/virtio: reconfigure LSC handler when required David Marchand
@ 2021-08-31 15:54   ` David Marchand
  2021-09-14  8:39     ` Maxime Coquelin
  2021-09-14 11:27   ` [dpdk-dev] [PATCH v2 0/2] virtio-user interrupt fixes Maxime Coquelin
  2 siblings, 1 reply; 7+ messages in thread
From: David Marchand @ 2021-08-31 15:54 UTC (permalink / raw)
  To: dev; +Cc: stable, Maxime Coquelin, Chenbo Xia, Jianfeng Tan

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

Fixes: 3d4fb6fd2505 ("net/virtio-user: support Rx interrupt")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 16c58710d7..89f8b2271f 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -416,7 +416,7 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)
 	}
 
 	for (i = 0; i < dev->max_queue_pairs; ++i)
-		eth_dev->intr_handle->efds[i] = dev->callfds[i];
+		eth_dev->intr_handle->efds[i] = dev->callfds[2 * i];
 	eth_dev->intr_handle->nb_efd = dev->max_queue_pairs;
 	eth_dev->intr_handle->max_intr = dev->max_queue_pairs + 1;
 	eth_dev->intr_handle->type = RTE_INTR_HANDLE_VDEV;
-- 
2.23.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] net/virtio: reconfigure LSC handler when required
  2021-08-31 15:54   ` [dpdk-dev] [PATCH v2 1/2] net/virtio: reconfigure LSC handler when required David Marchand
@ 2021-09-14  8:36     ` Maxime Coquelin
  0 siblings, 0 replies; 7+ messages in thread
From: Maxime Coquelin @ 2021-09-14  8:36 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: stable, Chenbo Xia, Jianfeng Tan, Yuanhan Liu



On 8/31/21 5:54 PM, David Marchand wrote:
> There is no reason to re-register a interrupt handler for LSC if this
> feature was not requested in the first place.
> A simple usecase is when asking for Rx interrupts without LSC interrupt.
> 
> Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index e58085a2c9..314a291e8c 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1684,13 +1684,15 @@ virtio_configure_intr(struct rte_eth_dev *dev)
>  		}
>  	}
>  
> -	/* Re-register callback to update max_intr */
> -	rte_intr_callback_unregister(dev->intr_handle,
> -				     virtio_interrupt_handler,
> -				     dev);
> -	rte_intr_callback_register(dev->intr_handle,
> -				   virtio_interrupt_handler,
> -				   dev);
> +	if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {
> +		/* Re-register callback to update max_intr */
> +		rte_intr_callback_unregister(dev->intr_handle,
> +					     virtio_interrupt_handler,
> +					     dev);
> +		rte_intr_callback_register(dev->intr_handle,
> +					   virtio_interrupt_handler,
> +					   dev);
> +	}
>  
>  	/* DO NOT try to remove this! This function will enable msix, or QEMU
>  	 * will encounter SIGSEGV when DRIVER_OK is sent.
> 

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

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/2] net/virtio: fix virtio-user Rx interrupts with multi queue
  2021-08-31 15:54   ` [dpdk-dev] [PATCH v2 2/2] net/virtio: fix virtio-user Rx interrupts with multi queue David Marchand
@ 2021-09-14  8:39     ` Maxime Coquelin
  0 siblings, 0 replies; 7+ messages in thread
From: Maxime Coquelin @ 2021-09-14  8:39 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: stable, Chenbo Xia, Jianfeng Tan



On 8/31/21 5:54 PM, David Marchand wrote:
> The callfds[] array stores eventfds sequentially for Rx and Tx vq.
> 
> Fixes: 3d4fb6fd2505 ("net/virtio-user: support Rx interrupt")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  drivers/net/virtio/virtio_user/virtio_user_dev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> index 16c58710d7..89f8b2271f 100644
> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> @@ -416,7 +416,7 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)
>  	}
>  
>  	for (i = 0; i < dev->max_queue_pairs; ++i)
> -		eth_dev->intr_handle->efds[i] = dev->callfds[i];
> +		eth_dev->intr_handle->efds[i] = dev->callfds[2 * i];
>  	eth_dev->intr_handle->nb_efd = dev->max_queue_pairs;
>  	eth_dev->intr_handle->max_intr = dev->max_queue_pairs + 1;
>  	eth_dev->intr_handle->type = RTE_INTR_HANDLE_VDEV;
> 

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

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v2 0/2] virtio-user interrupt fixes
  2021-08-31 15:54 ` [dpdk-dev] [PATCH v2 0/2] virtio-user interrupt fixes David Marchand
  2021-08-31 15:54   ` [dpdk-dev] [PATCH v2 1/2] net/virtio: reconfigure LSC handler when required David Marchand
  2021-08-31 15:54   ` [dpdk-dev] [PATCH v2 2/2] net/virtio: fix virtio-user Rx interrupts with multi queue David Marchand
@ 2021-09-14 11:27   ` Maxime Coquelin
  2 siblings, 0 replies; 7+ messages in thread
From: Maxime Coquelin @ 2021-09-14 11:27 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: ci, Chenbo Xia



On 8/31/21 5:54 PM, David Marchand wrote:
> Trying to use virtio-user as a replacement for taps in OVS, I ended up
> with some fixes on the interrupt side.
> The patches for OVS are not ready yet, but sending the DPDK fixes in
> any case.
> 
> @CI guys:
> Patch 2 probably means there is a hole in the virtio-user interrupt
> test plan in DTS (I could not find a setup with
> virtio-user+rx interrupts+multi queue).
> 
> 

Applied to dpdk-next-virtio/main.

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-14 11:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 15:13 [dpdk-dev] [PATCH] net/virtio: reconfigure LSC handler when required David Marchand
2021-08-31 15:54 ` [dpdk-dev] [PATCH v2 0/2] virtio-user interrupt fixes David Marchand
2021-08-31 15:54   ` [dpdk-dev] [PATCH v2 1/2] net/virtio: reconfigure LSC handler when required David Marchand
2021-09-14  8:36     ` Maxime Coquelin
2021-08-31 15:54   ` [dpdk-dev] [PATCH v2 2/2] net/virtio: fix virtio-user Rx interrupts with multi queue David Marchand
2021-09-14  8:39     ` Maxime Coquelin
2021-09-14 11:27   ` [dpdk-dev] [PATCH v2 0/2] virtio-user interrupt fixes Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).