bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ice: don't stop netdev tx queues when setting up XSK socket
@ 2023-09-25 17:19 Tony Nguyen
  2023-09-25 22:58 ` Jacob Keller
  2023-10-03 22:49 ` Jakub Kicinski
  0 siblings, 2 replies; 4+ messages in thread
From: Tony Nguyen @ 2023-09-25 17:19 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Kamil Maziarz, anthony.l.nguyen, maciej.fijalkowski,
	magnus.karlsson, ast, daniel, hawk, john.fastabend, bpf,
	Chandan Kumar Rout

From: Kamil Maziarz <kamil.maziarz@intel.com>

Avoid stopping netdev tx queues during XSK setup by removing
netif_tx_stop_queue() and netif_tx_start_queue().
These changes prevent unnecessary stopping and starting of netdev
transmit queues during the setup of XDP socket. Without this change,
after stopping the XDP traffic flow tracker and then stopping
the XDP prog - NETDEV WATCHDOG transmit queue timed out appears.

Fixes: 2d4238f55697 ("ice: Add support for AF_XDP")
Signed-off-by: Kamil Maziarz <kamil.maziarz@intel.com>
Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_xsk.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c
index 2a3f0834e139..cec492b827d4 100644
--- a/drivers/net/ethernet/intel/ice/ice_xsk.c
+++ b/drivers/net/ethernet/intel/ice/ice_xsk.c
@@ -179,7 +179,6 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx)
 			return -EBUSY;
 		usleep_range(1000, 2000);
 	}
-	netif_tx_stop_queue(netdev_get_tx_queue(vsi->netdev, q_idx));
 
 	ice_fill_txq_meta(vsi, tx_ring, &txq_meta);
 	err = ice_vsi_stop_tx_ring(vsi, ICE_NO_RESET, 0, tx_ring, &txq_meta);
@@ -268,7 +267,6 @@ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx)
 	ice_qvec_toggle_napi(vsi, q_vector, true);
 	ice_qvec_ena_irq(vsi, q_vector);
 
-	netif_tx_start_queue(netdev_get_tx_queue(vsi->netdev, q_idx));
 free_buf:
 	kfree(qg_buf);
 	return err;
-- 
2.38.1


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

* Re: [PATCH net] ice: don't stop netdev tx queues when setting up XSK socket
  2023-09-25 17:19 [PATCH net] ice: don't stop netdev tx queues when setting up XSK socket Tony Nguyen
@ 2023-09-25 22:58 ` Jacob Keller
  2023-10-03 22:49 ` Jakub Kicinski
  1 sibling, 0 replies; 4+ messages in thread
From: Jacob Keller @ 2023-09-25 22:58 UTC (permalink / raw)
  To: Tony Nguyen, davem, kuba, pabeni, edumazet, netdev
  Cc: Kamil Maziarz, maciej.fijalkowski, magnus.karlsson, ast, daniel,
	hawk, john.fastabend, bpf, Chandan Kumar Rout



On 9/25/2023 10:19 AM, Tony Nguyen wrote:
> From: Kamil Maziarz <kamil.maziarz@intel.com>
> 
> Avoid stopping netdev tx queues during XSK setup by removing
> netif_tx_stop_queue() and netif_tx_start_queue().
> These changes prevent unnecessary stopping and starting of netdev
> transmit queues during the setup of XDP socket. Without this change,
> after stopping the XDP traffic flow tracker and then stopping
> the XDP prog - NETDEV WATCHDOG transmit queue timed out appears.
> 
> Fixes: 2d4238f55697 ("ice: Add support for AF_XDP")
> Signed-off-by: Kamil Maziarz <kamil.maziarz@intel.com>
> Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

>  drivers/net/ethernet/intel/ice/ice_xsk.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c
> index 2a3f0834e139..cec492b827d4 100644
> --- a/drivers/net/ethernet/intel/ice/ice_xsk.c
> +++ b/drivers/net/ethernet/intel/ice/ice_xsk.c
> @@ -179,7 +179,6 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx)
>  			return -EBUSY;
>  		usleep_range(1000, 2000);
>  	}
> -	netif_tx_stop_queue(netdev_get_tx_queue(vsi->netdev, q_idx));
>  

These were introduced by the original implementation in commit
2d4238f55697 ("ice: Add support for AF_XDP"), without explanation.

Looking at some of the other implementations I don't see calls to
netif_tx_stop_queue or netif_tx_start_queue, so at least its not common.
In fact the only caller in an _xsk.c file appears to be ice.

Thanks,
Jake

>  	ice_fill_txq_meta(vsi, tx_ring, &txq_meta);
>  	err = ice_vsi_stop_tx_ring(vsi, ICE_NO_RESET, 0, tx_ring, &txq_meta);
> @@ -268,7 +267,6 @@ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx)
>  	ice_qvec_toggle_napi(vsi, q_vector, true);
>  	ice_qvec_ena_irq(vsi, q_vector);
>  
> -	netif_tx_start_queue(netdev_get_tx_queue(vsi->netdev, q_idx));
>  free_buf:
>  	kfree(qg_buf);
>  	return err;

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

* Re: [PATCH net] ice: don't stop netdev tx queues when setting up XSK socket
  2023-09-25 17:19 [PATCH net] ice: don't stop netdev tx queues when setting up XSK socket Tony Nguyen
  2023-09-25 22:58 ` Jacob Keller
@ 2023-10-03 22:49 ` Jakub Kicinski
  2023-10-04 13:26   ` Maciej Fijalkowski
  1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2023-10-03 22:49 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: davem, pabeni, edumazet, netdev, Kamil Maziarz,
	maciej.fijalkowski, magnus.karlsson, ast, daniel, hawk,
	john.fastabend, bpf, Chandan Kumar Rout

On Mon, 25 Sep 2023 10:19:57 -0700 Tony Nguyen wrote:
> Avoid stopping netdev tx queues during XSK setup by removing
> netif_tx_stop_queue() and netif_tx_start_queue().
> These changes prevent unnecessary stopping and starting of netdev
> transmit queues during the setup of XDP socket. Without this change,
> after stopping the XDP traffic flow tracker and then stopping
> the XDP prog - NETDEV WATCHDOG transmit queue timed out appears.

I think we need more info about what happens here.

Maybe ice_qp_ena() fails before it gets to the start?
If we don't understand what happens, exactly, we may be papering
over other bugs.
-- 
pw-bot: cr

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

* Re: [PATCH net] ice: don't stop netdev tx queues when setting up XSK socket
  2023-10-03 22:49 ` Jakub Kicinski
@ 2023-10-04 13:26   ` Maciej Fijalkowski
  0 siblings, 0 replies; 4+ messages in thread
From: Maciej Fijalkowski @ 2023-10-04 13:26 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Tony Nguyen, davem, pabeni, edumazet, netdev, Kamil Maziarz,
	magnus.karlsson, ast, daniel, hawk, john.fastabend, bpf,
	Chandan Kumar Rout

On Tue, Oct 03, 2023 at 03:49:20PM -0700, Jakub Kicinski wrote:
> On Mon, 25 Sep 2023 10:19:57 -0700 Tony Nguyen wrote:
> > Avoid stopping netdev tx queues during XSK setup by removing
> > netif_tx_stop_queue() and netif_tx_start_queue().
> > These changes prevent unnecessary stopping and starting of netdev
> > transmit queues during the setup of XDP socket. Without this change,
> > after stopping the XDP traffic flow tracker and then stopping
> > the XDP prog - NETDEV WATCHDOG transmit queue timed out appears.

what is xdp traffic flow tracker? what do you mean by stopping xdp prog -
or you removing it while keeping xsk pool present on interface? or are you
just downing interface?

can you provide steps to reproduce it?

> 
> I think we need more info about what happens here.
> 
> Maybe ice_qp_ena() fails before it gets to the start?
> If we don't understand what happens, exactly, we may be papering
> over other bugs.

+1

> -- 
> pw-bot: cr
> 

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

end of thread, other threads:[~2023-10-04 13:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-25 17:19 [PATCH net] ice: don't stop netdev tx queues when setting up XSK socket Tony Nguyen
2023-09-25 22:58 ` Jacob Keller
2023-10-03 22:49 ` Jakub Kicinski
2023-10-04 13:26   ` Maciej Fijalkowski

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