All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup
@ 2022-04-15 21:05 ` Jeff Evanson
  0 siblings, 0 replies; 12+ messages in thread
From: Jeff Evanson @ 2022-04-15 21:05 UTC (permalink / raw)
  To: Jesse Brandeburg, Tony Nguyen, David S. Miller, Jakub Kicinski,
	intel-wired-lan, netdev, linux-kernel
  Cc: jeff.evanson, jeff.evanson

in igc_xsk_wakeup, trigger the proper interrupt based on whether flags
contains XDP_WAKEUP_RX and/or XDP_WAKEUP_TX

Signed-off-by: Jeff Evanson <jeff.evanson@qsc.com>
---
 drivers/net/ethernet/intel/igc/igc_main.c | 36 +++++++++++++++++------
 1 file changed, 27 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index a36a18c84aeb..d706de95dc06 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -6073,7 +6073,7 @@ static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter,
 int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
 {
 	struct igc_adapter *adapter = netdev_priv(dev);
-	struct igc_q_vector *q_vector;
+	struct igc_q_vector *txq_vector = 0, *rxq_vector = 0;
 	struct igc_ring *ring;
 
 	if (test_bit(__IGC_DOWN, &adapter->state))
@@ -6082,17 +6082,35 @@ int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
 	if (!igc_xdp_is_enabled(adapter))
 		return -ENXIO;
 
-	if (queue_id >= adapter->num_rx_queues)
-		return -EINVAL;
+	if (flags & XDP_WAKEUP_RX) {
+		if (queue_id >= adapter->num_rx_queues)
+			return -EINVAL;
 
-	ring = adapter->rx_ring[queue_id];
+		ring = adapter->rx_ring[queue_id];
+		if (!ring->xsk_pool)
+			return -ENXIO;
 
-	if (!ring->xsk_pool)
-		return -ENXIO;
+		rxq_vector = ring->q_vector;
+	}
+
+	if (flags & XDP_WAKEUP_TX) {
+		if (queue_id >= adapter->num_tx_queues)
+			return -EINVAL;
+
+		ring = adapter->tx_ring[queue_id];
+		if (!ring->xsk_pool)
+			return -ENXIO;
+
+		txq_vector = ring->q_vector;
+	}
+
+	if (rxq_vector &&
+	    !napi_if_scheduled_mark_missed(&rxq_vector->napi))
+		igc_trigger_rxtxq_interrupt(adapter, rxq_vector);
 
-	q_vector = adapter->q_vector[queue_id];
-	if (!napi_if_scheduled_mark_missed(&q_vector->napi))
-		igc_trigger_rxtxq_interrupt(adapter, q_vector);
+	if (txq_vector && txq_vector != rxq_vector &&
+	    !napi_if_scheduled_mark_missed(&txq_vector->napi))
+		igc_trigger_rxtxq_interrupt(adapter, txq_vector);
 
 	return 0;
 }
-- 
2.17.1


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

* [Intel-wired-lan] [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup
@ 2022-04-15 21:05 ` Jeff Evanson
  0 siblings, 0 replies; 12+ messages in thread
From: Jeff Evanson @ 2022-04-15 21:05 UTC (permalink / raw)
  To: intel-wired-lan

in igc_xsk_wakeup, trigger the proper interrupt based on whether flags
contains XDP_WAKEUP_RX and/or XDP_WAKEUP_TX

Signed-off-by: Jeff Evanson <jeff.evanson@qsc.com>
---
 drivers/net/ethernet/intel/igc/igc_main.c | 36 +++++++++++++++++------
 1 file changed, 27 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index a36a18c84aeb..d706de95dc06 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -6073,7 +6073,7 @@ static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter,
 int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
 {
 	struct igc_adapter *adapter = netdev_priv(dev);
-	struct igc_q_vector *q_vector;
+	struct igc_q_vector *txq_vector = 0, *rxq_vector = 0;
 	struct igc_ring *ring;
 
 	if (test_bit(__IGC_DOWN, &adapter->state))
@@ -6082,17 +6082,35 @@ int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
 	if (!igc_xdp_is_enabled(adapter))
 		return -ENXIO;
 
-	if (queue_id >= adapter->num_rx_queues)
-		return -EINVAL;
+	if (flags & XDP_WAKEUP_RX) {
+		if (queue_id >= adapter->num_rx_queues)
+			return -EINVAL;
 
-	ring = adapter->rx_ring[queue_id];
+		ring = adapter->rx_ring[queue_id];
+		if (!ring->xsk_pool)
+			return -ENXIO;
 
-	if (!ring->xsk_pool)
-		return -ENXIO;
+		rxq_vector = ring->q_vector;
+	}
+
+	if (flags & XDP_WAKEUP_TX) {
+		if (queue_id >= adapter->num_tx_queues)
+			return -EINVAL;
+
+		ring = adapter->tx_ring[queue_id];
+		if (!ring->xsk_pool)
+			return -ENXIO;
+
+		txq_vector = ring->q_vector;
+	}
+
+	if (rxq_vector &&
+	    !napi_if_scheduled_mark_missed(&rxq_vector->napi))
+		igc_trigger_rxtxq_interrupt(adapter, rxq_vector);
 
-	q_vector = adapter->q_vector[queue_id];
-	if (!napi_if_scheduled_mark_missed(&q_vector->napi))
-		igc_trigger_rxtxq_interrupt(adapter, q_vector);
+	if (txq_vector && txq_vector != rxq_vector &&
+	    !napi_if_scheduled_mark_missed(&txq_vector->napi))
+		igc_trigger_rxtxq_interrupt(adapter, txq_vector);
 
 	return 0;
 }
-- 
2.17.1


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

* Re: [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup
  2022-04-15 21:05 ` [Intel-wired-lan] " Jeff Evanson
@ 2022-04-18 17:44   ` Vinicius Costa Gomes
  -1 siblings, 0 replies; 12+ messages in thread
From: Vinicius Costa Gomes @ 2022-04-18 17:44 UTC (permalink / raw)
  To: Jeff Evanson, Jesse Brandeburg, Tony Nguyen, David S. Miller,
	Jakub Kicinski, intel-wired-lan, netdev, linux-kernel
  Cc: jeff.evanson, jeff.evanson

Jeff Evanson <jeff.evanson@gmail.com> writes:

> in igc_xsk_wakeup, trigger the proper interrupt based on whether flags
> contains XDP_WAKEUP_RX and/or XDP_WAKEUP_TX
>
> Signed-off-by: Jeff Evanson <jeff.evanson@qsc.com>
> ---
>  drivers/net/ethernet/intel/igc/igc_main.c | 36 +++++++++++++++++------
>  1 file changed, 27 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index a36a18c84aeb..d706de95dc06 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -6073,7 +6073,7 @@ static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter,
>  int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
>  {
>  	struct igc_adapter *adapter = netdev_priv(dev);
> -	struct igc_q_vector *q_vector;
> +	struct igc_q_vector *txq_vector = 0, *rxq_vector = 0;
>  	struct igc_ring *ring;
>  
>  	if (test_bit(__IGC_DOWN, &adapter->state))
> @@ -6082,17 +6082,35 @@ int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
>  	if (!igc_xdp_is_enabled(adapter))
>  		return -ENXIO;
>  
> -	if (queue_id >= adapter->num_rx_queues)
> -		return -EINVAL;
> +	if (flags & XDP_WAKEUP_RX) {
> +		if (queue_id >= adapter->num_rx_queues)
> +			return -EINVAL;
>  
> -	ring = adapter->rx_ring[queue_id];
> +		ring = adapter->rx_ring[queue_id];
> +		if (!ring->xsk_pool)
> +			return -ENXIO;
>  
> -	if (!ring->xsk_pool)
> -		return -ENXIO;
> +		rxq_vector = ring->q_vector;
> +	}
> +
> +	if (flags & XDP_WAKEUP_TX) {
> +		if (queue_id >= adapter->num_tx_queues)
> +			return -EINVAL;
> +
> +		ring = adapter->tx_ring[queue_id];
> +		if (!ring->xsk_pool)
> +			return -ENXIO;
> +
> +		txq_vector = ring->q_vector;
> +	}
> +
> +	if (rxq_vector &&
> +	    !napi_if_scheduled_mark_missed(&rxq_vector->napi))
> +		igc_trigger_rxtxq_interrupt(adapter, rxq_vector);
>  
> -	q_vector = adapter->q_vector[queue_id];
> -	if (!napi_if_scheduled_mark_missed(&q_vector->napi))
> -		igc_trigger_rxtxq_interrupt(adapter, q_vector);
> +	if (txq_vector && txq_vector != rxq_vector &&
> +	    !napi_if_scheduled_mark_missed(&txq_vector->napi))
> +		igc_trigger_rxtxq_interrupt(adapter, txq_vector);

Two things:
 - My imagination was not able to produce a scenario where this commit
 would solve any problems. Can you explain better the case where the
 current code would cause the wrong interrupt to be generated (or miss
 generating an interrupt)? (this should be in the commit message)
 - I think that with this patch applied, there would cases (both TX and
 RX flags set) that we cause two writes into the EICS register. That
 could cause unnecessary wakeups.

>  
>  	return 0;
>  }
> -- 
> 2.17.1
>

Cheers,
-- 
Vinicius

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

* [Intel-wired-lan] [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup
@ 2022-04-18 17:44   ` Vinicius Costa Gomes
  0 siblings, 0 replies; 12+ messages in thread
From: Vinicius Costa Gomes @ 2022-04-18 17:44 UTC (permalink / raw)
  To: intel-wired-lan

Jeff Evanson <jeff.evanson@gmail.com> writes:

> in igc_xsk_wakeup, trigger the proper interrupt based on whether flags
> contains XDP_WAKEUP_RX and/or XDP_WAKEUP_TX
>
> Signed-off-by: Jeff Evanson <jeff.evanson@qsc.com>
> ---
>  drivers/net/ethernet/intel/igc/igc_main.c | 36 +++++++++++++++++------
>  1 file changed, 27 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index a36a18c84aeb..d706de95dc06 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -6073,7 +6073,7 @@ static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter,
>  int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
>  {
>  	struct igc_adapter *adapter = netdev_priv(dev);
> -	struct igc_q_vector *q_vector;
> +	struct igc_q_vector *txq_vector = 0, *rxq_vector = 0;
>  	struct igc_ring *ring;
>  
>  	if (test_bit(__IGC_DOWN, &adapter->state))
> @@ -6082,17 +6082,35 @@ int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
>  	if (!igc_xdp_is_enabled(adapter))
>  		return -ENXIO;
>  
> -	if (queue_id >= adapter->num_rx_queues)
> -		return -EINVAL;
> +	if (flags & XDP_WAKEUP_RX) {
> +		if (queue_id >= adapter->num_rx_queues)
> +			return -EINVAL;
>  
> -	ring = adapter->rx_ring[queue_id];
> +		ring = adapter->rx_ring[queue_id];
> +		if (!ring->xsk_pool)
> +			return -ENXIO;
>  
> -	if (!ring->xsk_pool)
> -		return -ENXIO;
> +		rxq_vector = ring->q_vector;
> +	}
> +
> +	if (flags & XDP_WAKEUP_TX) {
> +		if (queue_id >= adapter->num_tx_queues)
> +			return -EINVAL;
> +
> +		ring = adapter->tx_ring[queue_id];
> +		if (!ring->xsk_pool)
> +			return -ENXIO;
> +
> +		txq_vector = ring->q_vector;
> +	}
> +
> +	if (rxq_vector &&
> +	    !napi_if_scheduled_mark_missed(&rxq_vector->napi))
> +		igc_trigger_rxtxq_interrupt(adapter, rxq_vector);
>  
> -	q_vector = adapter->q_vector[queue_id];
> -	if (!napi_if_scheduled_mark_missed(&q_vector->napi))
> -		igc_trigger_rxtxq_interrupt(adapter, q_vector);
> +	if (txq_vector && txq_vector != rxq_vector &&
> +	    !napi_if_scheduled_mark_missed(&txq_vector->napi))
> +		igc_trigger_rxtxq_interrupt(adapter, txq_vector);

Two things:
 - My imagination was not able to produce a scenario where this commit
 would solve any problems. Can you explain better the case where the
 current code would cause the wrong interrupt to be generated (or miss
 generating an interrupt)? (this should be in the commit message)
 - I think that with this patch applied, there would cases (both TX and
 RX flags set) that we cause two writes into the EICS register. That
 could cause unnecessary wakeups.

>  
>  	return 0;
>  }
> -- 
> 2.17.1
>

Cheers,
-- 
Vinicius

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

* RE: [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup
  2022-04-18 17:44   ` [Intel-wired-lan] " Vinicius Costa Gomes
@ 2022-04-18 23:03     ` Jeff Evanson
  -1 siblings, 0 replies; 12+ messages in thread
From: Jeff Evanson @ 2022-04-18 23:03 UTC (permalink / raw)
  To: Vinicius Costa Gomes, Jeff Evanson, Jesse Brandeburg,
	Tony Nguyen, David S. Miller, Jakub Kicinski, intel-wired-lan,
	netdev, linux-kernel
  Cc: jeff.evanson

Hi Vinicius. Thank you for the reply.

The scenario only happens when the transmit queue interrupt is mapped to a different interrupt from the receive queue. In the case where XDP_WAKEUP_TX is set in the flags argument, the previous code would only trigger the interrupt for the receive queue, causing the transmit queue's napi_struct to never be scheduled.

In the scenario where XDP_WAKEUP_TX and XDP_WAKEUP_RX are both set in flags, the receive interrupt is always triggered and the transmit interrupt is only triggered when the transmit q_vector differs from the receive q_vector.

Regards,
Jeff Evanson

-----Original Message-----
From: Vinicius Costa Gomes <vinicius.gomes@intel.com> 
Sent: Monday, April 18, 2022 11:45 AM
To: Jeff Evanson <jeff.evanson@gmail.com>; Jesse Brandeburg <jesse.brandeburg@intel.com>; Tony Nguyen <anthony.l.nguyen@intel.com>; David S. Miller <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org
Cc: Jeff Evanson <Jeff.Evanson@qsc.com>; jeff.evanson@gmail.com
Subject: Re: [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup

-External-

Jeff Evanson <jeff.evanson@gmail.com> writes:

> in igc_xsk_wakeup, trigger the proper interrupt based on whether flags 
> contains XDP_WAKEUP_RX and/or XDP_WAKEUP_TX
>
> Signed-off-by: Jeff Evanson <jeff.evanson@qsc.com>
> ---
>  drivers/net/ethernet/intel/igc/igc_main.c | 36 
> +++++++++++++++++------
>  1 file changed, 27 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c 
> b/drivers/net/ethernet/intel/igc/igc_main.c
> index a36a18c84aeb..d706de95dc06 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -6073,7 +6073,7 @@ static void igc_trigger_rxtxq_interrupt(struct 
> igc_adapter *adapter,  int igc_xsk_wakeup(struct net_device *dev, u32 
> queue_id, u32 flags)  {
>  	struct igc_adapter *adapter = netdev_priv(dev);
> -	struct igc_q_vector *q_vector;
> +	struct igc_q_vector *txq_vector = 0, *rxq_vector = 0;
>  	struct igc_ring *ring;
>  
>  	if (test_bit(__IGC_DOWN, &adapter->state)) @@ -6082,17 +6082,35 @@ 
> int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
>  	if (!igc_xdp_is_enabled(adapter))
>  		return -ENXIO;
>  
> -	if (queue_id >= adapter->num_rx_queues)
> -		return -EINVAL;
> +	if (flags & XDP_WAKEUP_RX) {
> +		if (queue_id >= adapter->num_rx_queues)
> +			return -EINVAL;
>  
> -	ring = adapter->rx_ring[queue_id];
> +		ring = adapter->rx_ring[queue_id];
> +		if (!ring->xsk_pool)
> +			return -ENXIO;
>  
> -	if (!ring->xsk_pool)
> -		return -ENXIO;
> +		rxq_vector = ring->q_vector;
> +	}
> +
> +	if (flags & XDP_WAKEUP_TX) {
> +		if (queue_id >= adapter->num_tx_queues)
> +			return -EINVAL;
> +
> +		ring = adapter->tx_ring[queue_id];
> +		if (!ring->xsk_pool)
> +			return -ENXIO;
> +
> +		txq_vector = ring->q_vector;
> +	}
> +
> +	if (rxq_vector &&
> +	    !napi_if_scheduled_mark_missed(&rxq_vector->napi))
> +		igc_trigger_rxtxq_interrupt(adapter, rxq_vector);
>  
> -	q_vector = adapter->q_vector[queue_id];
> -	if (!napi_if_scheduled_mark_missed(&q_vector->napi))
> -		igc_trigger_rxtxq_interrupt(adapter, q_vector);
> +	if (txq_vector && txq_vector != rxq_vector &&
> +	    !napi_if_scheduled_mark_missed(&txq_vector->napi))
> +		igc_trigger_rxtxq_interrupt(adapter, txq_vector);

Two things:
 - My imagination was not able to produce a scenario where this commit  would solve any problems. Can you explain better the case where the  current code would cause the wrong interrupt to be generated (or miss  generating an interrupt)? (this should be in the commit message)
 - I think that with this patch applied, there would cases (both TX and  RX flags set) that we cause two writes into the EICS register. That  could cause unnecessary wakeups.

>  
>  	return 0;
>  }
> --
> 2.17.1
>

Cheers,
-- 
Vinicius


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

* [Intel-wired-lan] [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup
@ 2022-04-18 23:03     ` Jeff Evanson
  0 siblings, 0 replies; 12+ messages in thread
From: Jeff Evanson @ 2022-04-18 23:03 UTC (permalink / raw)
  To: intel-wired-lan

Hi Vinicius. Thank you for the reply.

The scenario only happens when the transmit queue interrupt is mapped to a different interrupt from the receive queue. In the case where XDP_WAKEUP_TX is set in the flags argument, the previous code would only trigger the interrupt for the receive queue, causing the transmit queue's napi_struct to never be scheduled.

In the scenario where XDP_WAKEUP_TX and XDP_WAKEUP_RX are both set in flags, the receive interrupt is always triggered and the transmit interrupt is only triggered when the transmit q_vector differs from the receive q_vector.

Regards,
Jeff Evanson

-----Original Message-----
From: Vinicius Costa Gomes <vinicius.gomes@intel.com> 
Sent: Monday, April 18, 2022 11:45 AM
To: Jeff Evanson <jeff.evanson@gmail.com>; Jesse Brandeburg <jesse.brandeburg@intel.com>; Tony Nguyen <anthony.l.nguyen@intel.com>; David S. Miller <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; intel-wired-lan at lists.osuosl.org; netdev at vger.kernel.org; linux-kernel at vger.kernel.org
Cc: Jeff Evanson <Jeff.Evanson@qsc.com>; jeff.evanson at gmail.com
Subject: Re: [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup

-External-

Jeff Evanson <jeff.evanson@gmail.com> writes:

> in igc_xsk_wakeup, trigger the proper interrupt based on whether flags 
> contains XDP_WAKEUP_RX and/or XDP_WAKEUP_TX
>
> Signed-off-by: Jeff Evanson <jeff.evanson@qsc.com>
> ---
>  drivers/net/ethernet/intel/igc/igc_main.c | 36 
> +++++++++++++++++------
>  1 file changed, 27 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c 
> b/drivers/net/ethernet/intel/igc/igc_main.c
> index a36a18c84aeb..d706de95dc06 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -6073,7 +6073,7 @@ static void igc_trigger_rxtxq_interrupt(struct 
> igc_adapter *adapter,  int igc_xsk_wakeup(struct net_device *dev, u32 
> queue_id, u32 flags)  {
>  	struct igc_adapter *adapter = netdev_priv(dev);
> -	struct igc_q_vector *q_vector;
> +	struct igc_q_vector *txq_vector = 0, *rxq_vector = 0;
>  	struct igc_ring *ring;
>  
>  	if (test_bit(__IGC_DOWN, &adapter->state)) @@ -6082,17 +6082,35 @@ 
> int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
>  	if (!igc_xdp_is_enabled(adapter))
>  		return -ENXIO;
>  
> -	if (queue_id >= adapter->num_rx_queues)
> -		return -EINVAL;
> +	if (flags & XDP_WAKEUP_RX) {
> +		if (queue_id >= adapter->num_rx_queues)
> +			return -EINVAL;
>  
> -	ring = adapter->rx_ring[queue_id];
> +		ring = adapter->rx_ring[queue_id];
> +		if (!ring->xsk_pool)
> +			return -ENXIO;
>  
> -	if (!ring->xsk_pool)
> -		return -ENXIO;
> +		rxq_vector = ring->q_vector;
> +	}
> +
> +	if (flags & XDP_WAKEUP_TX) {
> +		if (queue_id >= adapter->num_tx_queues)
> +			return -EINVAL;
> +
> +		ring = adapter->tx_ring[queue_id];
> +		if (!ring->xsk_pool)
> +			return -ENXIO;
> +
> +		txq_vector = ring->q_vector;
> +	}
> +
> +	if (rxq_vector &&
> +	    !napi_if_scheduled_mark_missed(&rxq_vector->napi))
> +		igc_trigger_rxtxq_interrupt(adapter, rxq_vector);
>  
> -	q_vector = adapter->q_vector[queue_id];
> -	if (!napi_if_scheduled_mark_missed(&q_vector->napi))
> -		igc_trigger_rxtxq_interrupt(adapter, q_vector);
> +	if (txq_vector && txq_vector != rxq_vector &&
> +	    !napi_if_scheduled_mark_missed(&txq_vector->napi))
> +		igc_trigger_rxtxq_interrupt(adapter, txq_vector);

Two things:
 - My imagination was not able to produce a scenario where this commit  would solve any problems. Can you explain better the case where the  current code would cause the wrong interrupt to be generated (or miss  generating an interrupt)? (this should be in the commit message)
 - I think that with this patch applied, there would cases (both TX and  RX flags set) that we cause two writes into the EICS register. That  could cause unnecessary wakeups.

>  
>  	return 0;
>  }
> --
> 2.17.1
>

Cheers,
-- 
Vinicius


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

* Re: [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup
  2022-04-15 21:05 ` [Intel-wired-lan] " Jeff Evanson
@ 2022-04-19 13:33   ` Paolo Abeni
  -1 siblings, 0 replies; 12+ messages in thread
From: Paolo Abeni @ 2022-04-19 13:33 UTC (permalink / raw)
  To: Jeff Evanson, Jesse Brandeburg, Tony Nguyen, David S. Miller,
	Jakub Kicinski, intel-wired-lan, netdev, linux-kernel
  Cc: jeff.evanson

On Fri, 2022-04-15 at 15:05 -0600, Jeff Evanson wrote:
> in igc_xsk_wakeup, trigger the proper interrupt based on whether flags
> contains XDP_WAKEUP_RX and/or XDP_WAKEUP_TX
> 
> Signed-off-by: Jeff Evanson <jeff.evanson@qsc.com>
> ---
>  drivers/net/ethernet/intel/igc/igc_main.c | 36 +++++++++++++++++------
>  1 file changed, 27 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index a36a18c84aeb..d706de95dc06 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -6073,7 +6073,7 @@ static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter,
>  int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
>  {
>  	struct igc_adapter *adapter = netdev_priv(dev);
> -	struct igc_q_vector *q_vector;
> +	struct igc_q_vector *txq_vector = 0, *rxq_vector = 0;

Since a v2 is likely required - see even Vinicius's comments on patch
1/2 - please reorder the above to respect the reverse x-mas tree order
and fix the sparse warning introduced above (s/ = 0/ = NULL/)

Thanks!

Paolo


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

* [Intel-wired-lan] [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup
@ 2022-04-19 13:33   ` Paolo Abeni
  0 siblings, 0 replies; 12+ messages in thread
From: Paolo Abeni @ 2022-04-19 13:33 UTC (permalink / raw)
  To: intel-wired-lan

On Fri, 2022-04-15 at 15:05 -0600, Jeff Evanson wrote:
> in igc_xsk_wakeup, trigger the proper interrupt based on whether flags
> contains XDP_WAKEUP_RX and/or XDP_WAKEUP_TX
> 
> Signed-off-by: Jeff Evanson <jeff.evanson@qsc.com>
> ---
>  drivers/net/ethernet/intel/igc/igc_main.c | 36 +++++++++++++++++------
>  1 file changed, 27 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index a36a18c84aeb..d706de95dc06 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -6073,7 +6073,7 @@ static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter,
>  int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
>  {
>  	struct igc_adapter *adapter = netdev_priv(dev);
> -	struct igc_q_vector *q_vector;
> +	struct igc_q_vector *txq_vector = 0, *rxq_vector = 0;

Since a v2 is likely required - see even Vinicius's comments on patch
1/2 - please reorder the above to respect the reverse x-mas tree order
and fix the sparse warning introduced above (s/ = 0/ = NULL/)

Thanks!

Paolo


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

* Re: [Intel-wired-lan] [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup
  2022-04-15 21:05 ` [Intel-wired-lan] " Jeff Evanson
@ 2022-04-19 14:19   ` Paul Menzel
  -1 siblings, 0 replies; 12+ messages in thread
From: Paul Menzel @ 2022-04-19 14:19 UTC (permalink / raw)
  To: Jeff Evanson
  Cc: Jesse Brandeburg, Tony Nguyen, David S. Miller, Jakub Kicinski,
	intel-wired-lan, netdev, linux-kernel, jeff.evanson

Dear Jeff,


Thank you for your patch.


Am 15.04.22 um 23:05 schrieb Jeff Evanson:

1.  Add a From tag(?), so your company instead of gmail.com email is used?
2.  Please add a prefix to the commit message summary. See `git log 
--oneline drivers/net/ethernet/igc` for examples.

> in igc_xsk_wakeup, trigger the proper interrupt based on whether flags
> contains XDP_WAKEUP_RX and/or XDP_WAKEUP_TX

Nit. Please add a dot/period to the end of sentences.

Can you please add a paragraph on what system you experienced the 
problem, and how to verify your fix?

> Signed-off-by: Jeff Evanson <jeff.evanson@qsc.com>
> ---
>   drivers/net/ethernet/intel/igc/igc_main.c | 36 +++++++++++++++++------
>   1 file changed, 27 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index a36a18c84aeb..d706de95dc06 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -6073,7 +6073,7 @@ static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter,
>   int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
>   {
>   	struct igc_adapter *adapter = netdev_priv(dev);
> -	struct igc_q_vector *q_vector;
> +	struct igc_q_vector *txq_vector = 0, *rxq_vector = 0;

Should you use NULL instead of 0?


Kind regards,

Paul


>   	struct igc_ring *ring;
>   
>   	if (test_bit(__IGC_DOWN, &adapter->state))
> @@ -6082,17 +6082,35 @@ int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
>   	if (!igc_xdp_is_enabled(adapter))
>   		return -ENXIO;
>   
> -	if (queue_id >= adapter->num_rx_queues)
> -		return -EINVAL;
> +	if (flags & XDP_WAKEUP_RX) {
> +		if (queue_id >= adapter->num_rx_queues)
> +			return -EINVAL;
>   
> -	ring = adapter->rx_ring[queue_id];
> +		ring = adapter->rx_ring[queue_id];
> +		if (!ring->xsk_pool)
> +			return -ENXIO;
>   
> -	if (!ring->xsk_pool)
> -		return -ENXIO;
> +		rxq_vector = ring->q_vector;
> +	}
> +
> +	if (flags & XDP_WAKEUP_TX) {
> +		if (queue_id >= adapter->num_tx_queues)
> +			return -EINVAL;
> +
> +		ring = adapter->tx_ring[queue_id];
> +		if (!ring->xsk_pool)
> +			return -ENXIO;
> +
> +		txq_vector = ring->q_vector;
> +	}
> +
> +	if (rxq_vector &&
> +	    !napi_if_scheduled_mark_missed(&rxq_vector->napi))
> +		igc_trigger_rxtxq_interrupt(adapter, rxq_vector);
>   
> -	q_vector = adapter->q_vector[queue_id];
> -	if (!napi_if_scheduled_mark_missed(&q_vector->napi))
> -		igc_trigger_rxtxq_interrupt(adapter, q_vector);
> +	if (txq_vector && txq_vector != rxq_vector &&
> +	    !napi_if_scheduled_mark_missed(&txq_vector->napi))
> +		igc_trigger_rxtxq_interrupt(adapter, txq_vector);
>   
>   	return 0;
>   }

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

* [Intel-wired-lan] [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup
@ 2022-04-19 14:19   ` Paul Menzel
  0 siblings, 0 replies; 12+ messages in thread
From: Paul Menzel @ 2022-04-19 14:19 UTC (permalink / raw)
  To: intel-wired-lan

Dear Jeff,


Thank you for your patch.


Am 15.04.22 um 23:05 schrieb Jeff Evanson:

1.  Add a From tag(?), so your company instead of gmail.com email is used?
2.  Please add a prefix to the commit message summary. See `git log 
--oneline drivers/net/ethernet/igc` for examples.

> in igc_xsk_wakeup, trigger the proper interrupt based on whether flags
> contains XDP_WAKEUP_RX and/or XDP_WAKEUP_TX

Nit. Please add a dot/period to the end of sentences.

Can you please add a paragraph on what system you experienced the 
problem, and how to verify your fix?

> Signed-off-by: Jeff Evanson <jeff.evanson@qsc.com>
> ---
>   drivers/net/ethernet/intel/igc/igc_main.c | 36 +++++++++++++++++------
>   1 file changed, 27 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index a36a18c84aeb..d706de95dc06 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -6073,7 +6073,7 @@ static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter,
>   int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
>   {
>   	struct igc_adapter *adapter = netdev_priv(dev);
> -	struct igc_q_vector *q_vector;
> +	struct igc_q_vector *txq_vector = 0, *rxq_vector = 0;

Should you use NULL instead of 0?


Kind regards,

Paul


>   	struct igc_ring *ring;
>   
>   	if (test_bit(__IGC_DOWN, &adapter->state))
> @@ -6082,17 +6082,35 @@ int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
>   	if (!igc_xdp_is_enabled(adapter))
>   		return -ENXIO;
>   
> -	if (queue_id >= adapter->num_rx_queues)
> -		return -EINVAL;
> +	if (flags & XDP_WAKEUP_RX) {
> +		if (queue_id >= adapter->num_rx_queues)
> +			return -EINVAL;
>   
> -	ring = adapter->rx_ring[queue_id];
> +		ring = adapter->rx_ring[queue_id];
> +		if (!ring->xsk_pool)
> +			return -ENXIO;
>   
> -	if (!ring->xsk_pool)
> -		return -ENXIO;
> +		rxq_vector = ring->q_vector;
> +	}
> +
> +	if (flags & XDP_WAKEUP_TX) {
> +		if (queue_id >= adapter->num_tx_queues)
> +			return -EINVAL;
> +
> +		ring = adapter->tx_ring[queue_id];
> +		if (!ring->xsk_pool)
> +			return -ENXIO;
> +
> +		txq_vector = ring->q_vector;
> +	}
> +
> +	if (rxq_vector &&
> +	    !napi_if_scheduled_mark_missed(&rxq_vector->napi))
> +		igc_trigger_rxtxq_interrupt(adapter, rxq_vector);
>   
> -	q_vector = adapter->q_vector[queue_id];
> -	if (!napi_if_scheduled_mark_missed(&q_vector->napi))
> -		igc_trigger_rxtxq_interrupt(adapter, q_vector);
> +	if (txq_vector && txq_vector != rxq_vector &&
> +	    !napi_if_scheduled_mark_missed(&txq_vector->napi))
> +		igc_trigger_rxtxq_interrupt(adapter, txq_vector);
>   
>   	return 0;
>   }

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

* RE: [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup
  2022-04-18 23:03     ` [Intel-wired-lan] " Jeff Evanson
@ 2022-04-19 17:03       ` Vinicius Costa Gomes
  -1 siblings, 0 replies; 12+ messages in thread
From: Vinicius Costa Gomes @ 2022-04-19 17:03 UTC (permalink / raw)
  To: Jeff Evanson, Jeff Evanson, Jesse Brandeburg, Tony Nguyen,
	David S. Miller, Jakub Kicinski, intel-wired-lan, netdev,
	linux-kernel
  Cc: jeff.evanson

Hi Jeff,

Jeff Evanson <Jeff.Evanson@qsc.com> writes:

> Hi Vinicius. Thank you for the reply.
>
> The scenario only happens when the transmit queue interrupt is mapped
> to a different interrupt from the receive queue. In the case where
> XDP_WAKEUP_TX is set in the flags argument, the previous code would
> only trigger the interrupt for the receive queue, causing the transmit
> queue's napi_struct to never be scheduled.

This is a good explanation, adding it to the commit message for the v2
would be a good idea.

>
> In the scenario where XDP_WAKEUP_TX and XDP_WAKEUP_RX are both set in
> flags, the receive interrupt is always triggered and the transmit
> interrupt is only triggered when the transmit q_vector differs from
> the receive q_vector.

I missed that condition when I looked at the patch. Sorry about that.
Makes more sense now.

Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>

>
> Regards,
> Jeff Evanson
>
> -----Original Message-----
> From: Vinicius Costa Gomes <vinicius.gomes@intel.com> 
> Sent: Monday, April 18, 2022 11:45 AM
> To: Jeff Evanson <jeff.evanson@gmail.com>; Jesse Brandeburg <jesse.brandeburg@intel.com>; Tony Nguyen <anthony.l.nguyen@intel.com>; David S. Miller <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Cc: Jeff Evanson <Jeff.Evanson@qsc.com>; jeff.evanson@gmail.com
> Subject: Re: [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup
>
> -External-
>
> Jeff Evanson <jeff.evanson@gmail.com> writes:
>
>> in igc_xsk_wakeup, trigger the proper interrupt based on whether flags 
>> contains XDP_WAKEUP_RX and/or XDP_WAKEUP_TX
>>
>> Signed-off-by: Jeff Evanson <jeff.evanson@qsc.com>
>> ---
>>  drivers/net/ethernet/intel/igc/igc_main.c | 36 
>> +++++++++++++++++------
>>  1 file changed, 27 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c 
>> b/drivers/net/ethernet/intel/igc/igc_main.c
>> index a36a18c84aeb..d706de95dc06 100644
>> --- a/drivers/net/ethernet/intel/igc/igc_main.c
>> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
>> @@ -6073,7 +6073,7 @@ static void igc_trigger_rxtxq_interrupt(struct 
>> igc_adapter *adapter,  int igc_xsk_wakeup(struct net_device *dev, u32 
>> queue_id, u32 flags)  {
>>  	struct igc_adapter *adapter = netdev_priv(dev);
>> -	struct igc_q_vector *q_vector;
>> +	struct igc_q_vector *txq_vector = 0, *rxq_vector = 0;
>>  	struct igc_ring *ring;
>>  
>>  	if (test_bit(__IGC_DOWN, &adapter->state)) @@ -6082,17 +6082,35 @@ 
>> int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
>>  	if (!igc_xdp_is_enabled(adapter))
>>  		return -ENXIO;
>>  
>> -	if (queue_id >= adapter->num_rx_queues)
>> -		return -EINVAL;
>> +	if (flags & XDP_WAKEUP_RX) {
>> +		if (queue_id >= adapter->num_rx_queues)
>> +			return -EINVAL;
>>  
>> -	ring = adapter->rx_ring[queue_id];
>> +		ring = adapter->rx_ring[queue_id];
>> +		if (!ring->xsk_pool)
>> +			return -ENXIO;
>>  
>> -	if (!ring->xsk_pool)
>> -		return -ENXIO;
>> +		rxq_vector = ring->q_vector;
>> +	}
>> +
>> +	if (flags & XDP_WAKEUP_TX) {
>> +		if (queue_id >= adapter->num_tx_queues)
>> +			return -EINVAL;
>> +
>> +		ring = adapter->tx_ring[queue_id];
>> +		if (!ring->xsk_pool)
>> +			return -ENXIO;
>> +
>> +		txq_vector = ring->q_vector;
>> +	}
>> +
>> +	if (rxq_vector &&
>> +	    !napi_if_scheduled_mark_missed(&rxq_vector->napi))
>> +		igc_trigger_rxtxq_interrupt(adapter, rxq_vector);
>>  
>> -	q_vector = adapter->q_vector[queue_id];
>> -	if (!napi_if_scheduled_mark_missed(&q_vector->napi))
>> -		igc_trigger_rxtxq_interrupt(adapter, q_vector);
>> +	if (txq_vector && txq_vector != rxq_vector &&
>> +	    !napi_if_scheduled_mark_missed(&txq_vector->napi))
>> +		igc_trigger_rxtxq_interrupt(adapter, txq_vector);
>
> Two things:
>  - My imagination was not able to produce a scenario where this commit  would solve any problems. Can you explain better the case where the  current code would cause the wrong interrupt to be generated (or miss  generating an interrupt)? (this should be in the commit message)
>  - I think that with this patch applied, there would cases (both TX and  RX flags set) that we cause two writes into the EICS register. That  could cause unnecessary wakeups.
>
>>  
>>  	return 0;
>>  }
>> --
>> 2.17.1
>>
>
> Cheers,
> -- 
> Vinicius
>

-- 
Vinicius

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

* [Intel-wired-lan] [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup
@ 2022-04-19 17:03       ` Vinicius Costa Gomes
  0 siblings, 0 replies; 12+ messages in thread
From: Vinicius Costa Gomes @ 2022-04-19 17:03 UTC (permalink / raw)
  To: intel-wired-lan

Hi Jeff,

Jeff Evanson <Jeff.Evanson@qsc.com> writes:

> Hi Vinicius. Thank you for the reply.
>
> The scenario only happens when the transmit queue interrupt is mapped
> to a different interrupt from the receive queue. In the case where
> XDP_WAKEUP_TX is set in the flags argument, the previous code would
> only trigger the interrupt for the receive queue, causing the transmit
> queue's napi_struct to never be scheduled.

This is a good explanation, adding it to the commit message for the v2
would be a good idea.

>
> In the scenario where XDP_WAKEUP_TX and XDP_WAKEUP_RX are both set in
> flags, the receive interrupt is always triggered and the transmit
> interrupt is only triggered when the transmit q_vector differs from
> the receive q_vector.

I missed that condition when I looked at the patch. Sorry about that.
Makes more sense now.

Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>

>
> Regards,
> Jeff Evanson
>
> -----Original Message-----
> From: Vinicius Costa Gomes <vinicius.gomes@intel.com> 
> Sent: Monday, April 18, 2022 11:45 AM
> To: Jeff Evanson <jeff.evanson@gmail.com>; Jesse Brandeburg <jesse.brandeburg@intel.com>; Tony Nguyen <anthony.l.nguyen@intel.com>; David S. Miller <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; intel-wired-lan at lists.osuosl.org; netdev at vger.kernel.org; linux-kernel at vger.kernel.org
> Cc: Jeff Evanson <Jeff.Evanson@qsc.com>; jeff.evanson at gmail.com
> Subject: Re: [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup
>
> -External-
>
> Jeff Evanson <jeff.evanson@gmail.com> writes:
>
>> in igc_xsk_wakeup, trigger the proper interrupt based on whether flags 
>> contains XDP_WAKEUP_RX and/or XDP_WAKEUP_TX
>>
>> Signed-off-by: Jeff Evanson <jeff.evanson@qsc.com>
>> ---
>>  drivers/net/ethernet/intel/igc/igc_main.c | 36 
>> +++++++++++++++++------
>>  1 file changed, 27 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c 
>> b/drivers/net/ethernet/intel/igc/igc_main.c
>> index a36a18c84aeb..d706de95dc06 100644
>> --- a/drivers/net/ethernet/intel/igc/igc_main.c
>> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
>> @@ -6073,7 +6073,7 @@ static void igc_trigger_rxtxq_interrupt(struct 
>> igc_adapter *adapter,  int igc_xsk_wakeup(struct net_device *dev, u32 
>> queue_id, u32 flags)  {
>>  	struct igc_adapter *adapter = netdev_priv(dev);
>> -	struct igc_q_vector *q_vector;
>> +	struct igc_q_vector *txq_vector = 0, *rxq_vector = 0;
>>  	struct igc_ring *ring;
>>  
>>  	if (test_bit(__IGC_DOWN, &adapter->state)) @@ -6082,17 +6082,35 @@ 
>> int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
>>  	if (!igc_xdp_is_enabled(adapter))
>>  		return -ENXIO;
>>  
>> -	if (queue_id >= adapter->num_rx_queues)
>> -		return -EINVAL;
>> +	if (flags & XDP_WAKEUP_RX) {
>> +		if (queue_id >= adapter->num_rx_queues)
>> +			return -EINVAL;
>>  
>> -	ring = adapter->rx_ring[queue_id];
>> +		ring = adapter->rx_ring[queue_id];
>> +		if (!ring->xsk_pool)
>> +			return -ENXIO;
>>  
>> -	if (!ring->xsk_pool)
>> -		return -ENXIO;
>> +		rxq_vector = ring->q_vector;
>> +	}
>> +
>> +	if (flags & XDP_WAKEUP_TX) {
>> +		if (queue_id >= adapter->num_tx_queues)
>> +			return -EINVAL;
>> +
>> +		ring = adapter->tx_ring[queue_id];
>> +		if (!ring->xsk_pool)
>> +			return -ENXIO;
>> +
>> +		txq_vector = ring->q_vector;
>> +	}
>> +
>> +	if (rxq_vector &&
>> +	    !napi_if_scheduled_mark_missed(&rxq_vector->napi))
>> +		igc_trigger_rxtxq_interrupt(adapter, rxq_vector);
>>  
>> -	q_vector = adapter->q_vector[queue_id];
>> -	if (!napi_if_scheduled_mark_missed(&q_vector->napi))
>> -		igc_trigger_rxtxq_interrupt(adapter, q_vector);
>> +	if (txq_vector && txq_vector != rxq_vector &&
>> +	    !napi_if_scheduled_mark_missed(&txq_vector->napi))
>> +		igc_trigger_rxtxq_interrupt(adapter, txq_vector);
>
> Two things:
>  - My imagination was not able to produce a scenario where this commit  would solve any problems. Can you explain better the case where the  current code would cause the wrong interrupt to be generated (or miss  generating an interrupt)? (this should be in the commit message)
>  - I think that with this patch applied, there would cases (both TX and  RX flags set) that we cause two writes into the EICS register. That  could cause unnecessary wakeups.
>
>>  
>>  	return 0;
>>  }
>> --
>> 2.17.1
>>
>
> Cheers,
> -- 
> Vinicius
>

-- 
Vinicius

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

end of thread, other threads:[~2022-04-19 17:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-15 21:05 [PATCH 2/2] Trigger proper interrupts in igc_xsk_wakeup Jeff Evanson
2022-04-15 21:05 ` [Intel-wired-lan] " Jeff Evanson
2022-04-18 17:44 ` Vinicius Costa Gomes
2022-04-18 17:44   ` [Intel-wired-lan] " Vinicius Costa Gomes
2022-04-18 23:03   ` Jeff Evanson
2022-04-18 23:03     ` [Intel-wired-lan] " Jeff Evanson
2022-04-19 17:03     ` Vinicius Costa Gomes
2022-04-19 17:03       ` [Intel-wired-lan] " Vinicius Costa Gomes
2022-04-19 13:33 ` Paolo Abeni
2022-04-19 13:33   ` [Intel-wired-lan] " Paolo Abeni
2022-04-19 14:19 ` Paul Menzel
2022-04-19 14:19   ` Paul Menzel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.