netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: core: Fix to store new mtu setting in netdevice.
@ 2019-01-01  6:42 Murali Krishna Policharla
  2019-01-01  7:54 ` Kirill Tkhai
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Murali Krishna Policharla @ 2019-01-01  6:42 UTC (permalink / raw)
  To: davem, amritha.nambiar, ecree, ktkhai, alexander.h.duyck
  Cc: netdev, linux-kernel, Murali Krishna Policharla

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-01-03  9:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-01  6:42 [PATCH] net: core: Fix to store new mtu setting in netdevice 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
2019-01-01 21:44 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).