Patchwork Gianfar : Enable promiscous mode after queue time out

login
register
mail settings
Submitter Cedric VONCKEN
Date Jan. 21, 2013, 4:24 p.m.
Message ID <773DB8A82AB6A046AE0195C68612A319014B7309@sbs2003.acksys.local>
Download mbox | patch
Permalink /patch/214234/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Cedric VONCKEN - Jan. 21, 2013, 4:24 p.m.
Hi all, 

	When the Netdev tx queue timeout occurred, the function
gfar_timeout(..) is called. This function calls indirectly the
gfar_init_mac(..) function.

 	In this function, the rctrl register is set to a default value.

 	If the Promiscuous is enable on the net dev ( flag IFF_PROMISC
is  set), the gfar_init_function does not reactivate it.

 	The Promiscuous mode is used for example when the netdev is
bridged.
 	
 	I apply this patch on the kernel 3.8-rc4 to fix it.

	Signed-off-by : Voncken C Acksys <cedric.voncken@acksys.fr>

*/



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Claudiu Manoil - Jan. 23, 2013, 9:58 a.m.
On 1/21/2013 6:24 PM, Cedric VONCKEN wrote:
> 	Hi all,
>
> 	When the Netdev tx queue timeout occurred, the function
> gfar_timeout(..) is called. This function calls indirectly the
> gfar_init_mac(..) function.
>
>   	In this function, the rctrl register is set to a default value.
>
>   	If the Promiscuous is enable on the net dev ( flag IFF_PROMISC
> is  set), the gfar_init_function does not reactivate it.
>
>   	The Promiscuous mode is used for example when the netdev is
> bridged.
>   	
>   	I apply this patch on the kernel 3.8-rc4 to fix it.
>
> 	Signed-off-by : Voncken C Acksys <cedric.voncken@acksys.fr>
>
> --- a/drivers/net/ethernet/freescale/gianfar.c
> +++ b/drivers/net/ethernet/freescale/gianfar.c
> @@ -349,6 +349,11 @@ static void gfar_init_mac(struct net_dev
>   	/* Configure the coalescing support */
>   	gfar_configure_coalescing(priv, 0xFF, 0xFF);
>
> +	if (ndev->flags & IFF_PROMISC) {
> +		/* Set RCTRL to PROM */
> +		rctrl |= RCTRL_PROM;
> +	}
> +
>   	if (priv->rx_filer_enable) {
>   		rctrl |= RCTRL_FILREN;
>   		/* Program the RIR0 reg with the required distribution
> */
>
>
>
>
>

Hello Cedric,

I'll take care of this code change and I'll send a properly formatted 
patch for it.
Besides, gfar_init_mac() may be called for numerous other reasons than 
tx timeout, like changing MTU, changing ring params, restoring the 
interface etc. (any reset condition), so I'll rephrase the patch comment 
too.

Thanks,
Claudiu


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

Patch

--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -349,6 +349,11 @@  static void gfar_init_mac(struct net_dev
 	/* Configure the coalescing support */
 	gfar_configure_coalescing(priv, 0xFF, 0xFF);
 
+	if (ndev->flags & IFF_PROMISC) {
+		/* Set RCTRL to PROM */
+		rctrl |= RCTRL_PROM;
+	}
+
 	if (priv->rx_filer_enable) {
 		rctrl |= RCTRL_FILREN;
 		/* Program the RIR0 reg with the required distribution