Re: Fwd: net: ethernet: ti: davinci_emac: Recycle skb on rx if netif is not running

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 07/17/2017 05:07 AM, Selva Muthukumar wrote:
> Hi,
> I had to add this patch in older kernel version to make ethernet
> working properly in a network where lot of multicast happens. This may
> be required in recent versions too, but not sure whether this is
> already handled in some other way.
> 
> commit 17dfd55f868df5df221cce23ad576bf25b6717fb
> Author: Selvamuthukumar <selva.muthukumar@xxxxxxxxxxxx>
> Date:   Mon Jul 17 11:01:13 2017 +0530
> 
>      net: ethernet: ti: davinci_emac: Recycle skb on rx if netif is not running
> 
>      In network with too much multicast before PHY link is detected all the
>      queued skbs may be dropped, without queueing new buffers to DMA.
>      This change will make sure buffers are available for receive.
> 
> Signed-off-by: Selvamuthukumar <selva.muthukumar@xxxxxxxxxxxx>

This shouldn't be an issue with new kernels.
The Net core will set __LINK_STATE_START before executing .ndo_open()
and link management is operating with netif_carrier_off/on().
It should be ok to drop skbs if interface is shutting down.

> 
> diff --git a/drivers/net/ethernet/ti/davinci_emac.c
> b/drivers/net/ethernet/ti/davinci_emac.c
> index 64d5527..69fb48b 100644
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -884,8 +884,7 @@ static void emac_rx_handler(void *token, int len,
> int status)
> 
>          /* free and bail if we are shutting down */
>          if (unlikely(!netif_running(ndev))) {
> -               dev_kfree_skb_any(skb);
> -               return;
> +               goto recycle;
>          }
> 
>          /* recycle on receive error */
> 
> 
> 

-- 
regards,
-grygorii
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux