From: Heiner Kallweit <hkallweit1@gmail.com>
To: Murali Krishna Policharla <murali.policharla@broadcom.com>,
davem@davemloft.net, amritha.nambiar@intel.com,
ecree@solarflare.com, ktkhai@virtuozzo.com,
alexander.h.duyck@intel.com
Cc: netdev@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:35:49 +0100 [thread overview]
Message-ID: <cc6976a3-a59f-8d68-a662-75f5199a6de3@gmail.com> (raw)
In-Reply-To: <1546324934-17555-1-git-send-email-murali.policharla@broadcom.com>
On 01.01.2019 07:42, Murali Krishna Policharla wrote:
> Store newly configured mtu settings in the netdevice after mtu
> configuration is successful to the dsa switch.
>
At first: good that this is fixed, so far each network driver
had to do the "dev->mtu = new_mtu" in its ndo_change_mtu
callback what can be removed now.
I think the commit description could be improved, the change
isn't specific to dsa switches at all.
And the patch should be annotated "net" because it's a fix.
> 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);
> + 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);
>
>
next prev parent reply other threads:[~2019-01-01 9:35 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
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 [this message]
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=cc6976a3-a59f-8d68-a662-75f5199a6de3@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®