mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Kirill Tkhai <ktkhai@virtuozzo.com>,
	Murali Krishna Policharla <murali.policharla@broadcom.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"amritha.nambiar@intel.com" <amritha.nambiar@intel.com>,
	"ecree@solarflare.com" <ecree@solarflare.com>,
	"alexander.h.duyck@intel.com" <alexander.h.duyck@intel.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: core: Fix to store new mtu setting in netdevice.
Date: Tue, 1 Jan 2019 10:40:22 +0100	[thread overview]
Message-ID: <bef4af12-f5ce-35ec-8d04-395a281e4322@gmail.com> (raw)
In-Reply-To: <b2127534-4e9c-1fef-27f1-72329595c3a3@virtuozzo.com>

On 01.01.2019 08:54, Kirill Tkhai wrote:
> On 01.01.2019 09:42, Murali Krishna Policharla wrote:
>> Store newly configured mtu settings in the netdevice after mtu
>> configuration is successful to the dsa switch.
>>
>> Fixes: 2315dc91a5 ("net: make dev_set_mtu() honor notification return code")
>> Signed-off-by: Murali Krishna Policharla <murali.policharla@broadcom.com>
>> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
>> ---
>>  net/core/dev.c | 9 ++++++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index 722d50d..58617aa 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -7586,12 +7586,15 @@ int dev_change_flags(struct net_device *dev, unsigned int flags)
>>  int __dev_set_mtu(struct net_device *dev, int new_mtu)
>>  {
>>  	const struct net_device_ops *ops = dev->netdev_ops;
>> +	int ret = 0;
>>  
>>  	if (ops->ndo_change_mtu)
>> -		return ops->ndo_change_mtu(dev, new_mtu);
> 
> Is there a .ndo_change_mtu callback, which does not assign a new mtu itself?
> 
So far all drivers have to do it themselves. But IMO this is more a workaround
for the core not doing it. It's something the core should do.
Now we can remove this from drivers.

>> +		ret = ops->ndo_change_mtu(dev, new_mtu);
>>  
>> -	dev->mtu = new_mtu;
>> -	return 0;
>> +	if (ret >= 0)
>> +		dev->mtu = new_mtu;
>> +
>> +	return ret;
>>  }
>>  EXPORT_SYMBOL(__dev_set_mtu);
>>  
>>
> 


  reply	other threads:[~2019-01-01  9:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01  6:42 Murali Krishna Policharla
2019-01-01  7:54 ` Kirill Tkhai
2019-01-01  9:40   ` Heiner Kallweit [this message]
2019-01-01 23:36     ` Andrew Lunn
2019-01-02  6:27       ` Heiner Kallweit
2019-01-01  8:34 ` Andrew Lunn
2019-01-01  9:48   ` Murali Krishna Policharla
2019-01-01 23:24     ` Andrew Lunn
2019-01-02  9:54       ` Murali Krishna Policharla
2019-01-02 13:16         ` Andrew Lunn
2019-01-03  9:54           ` Murali Krishna Policharla
2019-01-01  9:35 ` Heiner Kallweit
2019-01-01 21:44 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bef4af12-f5ce-35ec-8d04-395a281e4322@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=amritha.nambiar@intel.com \
    --cc=davem@davemloft.net \
    --cc=ecree@solarflare.com \
    --cc=ktkhai@virtuozzo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=murali.policharla@broadcom.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®