From: Murali Krishna Policharla <murali.policharla@broadcom.com>
To: 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,
Murali Krishna Policharla <murali.policharla@broadcom.com>
Subject: [PATCH] net: core: Fix to store new mtu setting in netdevice.
Date: Tue, 1 Jan 2019 12:12:14 +0530 [thread overview]
Message-ID: <1546324934-17555-1-git-send-email-murali.policharla@broadcom.com> (raw)
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);
+ 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);
--
1.9.1
next reply other threads:[~2019-01-01 6:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-01 6:42 Murali Krishna Policharla [this message]
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
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=1546324934-17555-1-git-send-email-murali.policharla@broadcom.com \
--to=murali.policharla@broadcom.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=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®