lkml.org 
[lkml]   [2019]   [Jan]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] net: core: Fix to store new mtu setting in netdevice.
From
Date
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);
>
>

\
 
 \ /
  Last update: 2019-01-01 10:36    [W:0.147 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site