Re: [PATCH net 10/11] sfc-falcon: remove ndo_poll_controller

2018-09-28 Thread Bert Kenward
On 27/09/18 17:32, Eric Dumazet wrote:
> As diagnosed by Song Liu, ndo_poll_controller() can
> be very dangerous on loaded hosts, since the cpu
> calling ndo_poll_controller() might steal all NAPI
> contexts (for all RX/TX queues of the NIC). This capture
> can last for unlimited amount of time, since one
> cpu is generally not able to drain all the queues under load.
> 
> sfc-falcon uses NAPI for TX completions, so we better let core
> networking stack call the napi->poll() to avoid the capture.
> 
> Signed-off-by: Eric Dumazet 
> Cc: Solarflare linux maintainers 
> Cc: Edward Cree 
> Cc: Bert Kenward 

Acked-By: Bert Kenward 

> ---
>  drivers/net/ethernet/sfc/falcon/efx.c | 26 --
>  1 file changed, 26 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/falcon/efx.c 
> b/drivers/net/ethernet/sfc/falcon/efx.c
> index 
> dd5530a4f8c8936868aed7171bd9481f93730d76..03e2455c502eacd9a4fd5c7fd320a9edcf265f77
>  100644
> --- a/drivers/net/ethernet/sfc/falcon/efx.c
> +++ b/drivers/net/ethernet/sfc/falcon/efx.c
> @@ -2052,29 +2052,6 @@ static void ef4_fini_napi(struct ef4_nic *efx)
>   ef4_fini_napi_channel(channel);
>  }
>  
> -/**
> - *
> - * Kernel netpoll interface
> - *
> - */
> -
> -#ifdef CONFIG_NET_POLL_CONTROLLER
> -
> -/* Although in the common case interrupts will be disabled, this is not
> - * guaranteed. However, all our work happens inside the NAPI callback,
> - * so no locking is required.
> - */
> -static void ef4_netpoll(struct net_device *net_dev)
> -{
> - struct ef4_nic *efx = netdev_priv(net_dev);
> - struct ef4_channel *channel;
> -
> - ef4_for_each_channel(channel, efx)
> - ef4_schedule_channel(channel);
> -}
> -
> -#endif
> -
>  /**
>   *
>   * Kernel net device interface
> @@ -2250,9 +2227,6 @@ static const struct net_device_ops ef4_netdev_ops = {
>   .ndo_set_mac_address= ef4_set_mac_address,
>   .ndo_set_rx_mode= ef4_set_rx_mode,
>   .ndo_set_features   = ef4_set_features,
> -#ifdef CONFIG_NET_POLL_CONTROLLER
> - .ndo_poll_controller = ef4_netpoll,
> -#endif
>   .ndo_setup_tc   = ef4_setup_tc,
>  #ifdef CONFIG_RFS_ACCEL
>   .ndo_rx_flow_steer  = ef4_filter_rfs,
> 


[PATCH net 10/11] sfc-falcon: remove ndo_poll_controller

2018-09-27 Thread Eric Dumazet
As diagnosed by Song Liu, ndo_poll_controller() can
be very dangerous on loaded hosts, since the cpu
calling ndo_poll_controller() might steal all NAPI
contexts (for all RX/TX queues of the NIC). This capture
can last for unlimited amount of time, since one
cpu is generally not able to drain all the queues under load.

sfc-falcon uses NAPI for TX completions, so we better let core
networking stack call the napi->poll() to avoid the capture.

Signed-off-by: Eric Dumazet 
Cc: Solarflare linux maintainers 
Cc: Edward Cree 
Cc: Bert Kenward 
---
 drivers/net/ethernet/sfc/falcon/efx.c | 26 --
 1 file changed, 26 deletions(-)

diff --git a/drivers/net/ethernet/sfc/falcon/efx.c 
b/drivers/net/ethernet/sfc/falcon/efx.c
index 
dd5530a4f8c8936868aed7171bd9481f93730d76..03e2455c502eacd9a4fd5c7fd320a9edcf265f77
 100644
--- a/drivers/net/ethernet/sfc/falcon/efx.c
+++ b/drivers/net/ethernet/sfc/falcon/efx.c
@@ -2052,29 +2052,6 @@ static void ef4_fini_napi(struct ef4_nic *efx)
ef4_fini_napi_channel(channel);
 }
 
-/**
- *
- * Kernel netpoll interface
- *
- */
-
-#ifdef CONFIG_NET_POLL_CONTROLLER
-
-/* Although in the common case interrupts will be disabled, this is not
- * guaranteed. However, all our work happens inside the NAPI callback,
- * so no locking is required.
- */
-static void ef4_netpoll(struct net_device *net_dev)
-{
-   struct ef4_nic *efx = netdev_priv(net_dev);
-   struct ef4_channel *channel;
-
-   ef4_for_each_channel(channel, efx)
-   ef4_schedule_channel(channel);
-}
-
-#endif
-
 /**
  *
  * Kernel net device interface
@@ -2250,9 +2227,6 @@ static const struct net_device_ops ef4_netdev_ops = {
.ndo_set_mac_address= ef4_set_mac_address,
.ndo_set_rx_mode= ef4_set_rx_mode,
.ndo_set_features   = ef4_set_features,
-#ifdef CONFIG_NET_POLL_CONTROLLER
-   .ndo_poll_controller = ef4_netpoll,
-#endif
.ndo_setup_tc   = ef4_setup_tc,
 #ifdef CONFIG_RFS_ACCEL
.ndo_rx_flow_steer  = ef4_filter_rfs,
-- 
2.19.0.605.g01d371f741-goog