Subject: Re: [net-next 2/5] stmmac: allow mtu bigger than 1500 in case of normal desc (V2).

From: Giuseppe CAVALLARO <[email-masked]>
Date: Fri, 14 Oct 2011 09:15:09 +0200

Hello Eric

On 10/12/2011 9:58 PM, Eric Dumazet wrote:
> Le mercredi 12 octobre 2011 à 15:38 +0200, Giuseppe CAVALLARO a écrit :
>> This patch allows to set the mtu bigger than 1500
>> in case of normal descriptors.
>> This is helping some SPEAr customers.
>>
>> Signed-off-by: Deepak SIKRI <[email-masked]>
>> Signed-off-by: Giuseppe Cavallaro <[email-masked]>
>> ---
>>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> index ba7af2c..de3e536 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> @@ -1357,17 +1357,17 @@ static void stmmac_set_rx_mode(struct net_device *dev)
>>  static int stmmac_change_mtu(struct net_device *dev, int new_mtu)
>>  {
>>  	struct stmmac_priv *priv = netdev_priv(dev);
>> -	int max_mtu;
>> +	int max_mtu = ETH_DATA_LEN;
> 
> Why are you setting max_mtu to ETH_DATA_LEN here ?
> 
>>  
>>  	if (netif_running(dev)) {
>>  		pr_err("%s: must be stopped to change its MTU\n", dev->name);
>>  		return -EBUSY;
>>  	}
>>  
>> -	if (priv->plat->has_gmac)
>> +	if (priv->plat->enh_desc)
>>  		max_mtu = JUMBO_LEN;
>>  	else
>> -		max_mtu = ETH_DATA_LEN;
>> +		max_mtu = BUF_SIZE_4KiB;
> 
> Since later you init to completely different values...

Hmm, yes you are right. it's not needed to initialized the max_mtu.

Thanks! I'll rework the patch and send it again in the V3.

Thx

Regards
Peppe