[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <564BB3CF.2080507@cumulusnetworks.com>
Date: Wed, 18 Nov 2015 00:10:07 +0100
From: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
To: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
Nikolay Aleksandrov <razor@...ckwall.org>,
netdev@...r.kernel.org
Cc: davem@...emloft.net, Jarod Wilson <jarod@...hat.com>,
Jiri Pirko <jiri@...nulli.us>,
Ido Schimmel <idosch@...lanox.com>,
Sander Eikelenboom <linux@...elenboom.it>,
Andy Gospodarek <gospo@...ulusnetworks.com>,
Florian Fainelli <f.fainelli@...il.com>
Subject: Re: [PATCH net] net: fix feature changes on devices without
ndo_set_features
On 11/18/2015 12:03 AM, Sergei Shtylyov wrote:
> Hello.
>
> On 11/13/2015 04:54 PM, Nikolay Aleksandrov wrote:
>
>> From: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
>>
>> When __netdev_update_features() was updated to ensure some features are
>> disabled on new lower devices, an error was introduced for devices which
>> don't have the ndo_set_features() method set. Before we'll just set the
>> new features, but now we return an error and don't set them. Fix this by
>> returning the old behaviour and setting err to 0 when ndo_set_features
>> is not present.
>>
>> Fixes: e7868a85e1b2 ("net/core: ensure features get disabled on new lower devs")
>> CC: Jarod Wilson <jarod@...hat.com>
>> CC: Jiri Pirko <jiri@...nulli.us>
>> CC: Ido Schimmel <idosch@...lanox.com>
>> CC: Sander Eikelenboom <linux@...elenboom.it>
>> CC: Andy Gospodarek <gospo@...ulusnetworks.com>
>> CC: Florian Fainelli <f.fainelli@...il.com>
>> Signed-off-by: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
>> ---
>> Sander please feel free to give your Tested-by.
>>
>> net/core/dev.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index ab9b8d0d115e..4a1d198dbbff 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -6426,6 +6426,8 @@ int __netdev_update_features(struct net_device *dev)
>>
>> if (dev->netdev_ops->ndo_set_features)
>> err = dev->netdev_ops->ndo_set_features(dev, features);
>> + else
>> + err = 0;
>
> This makes the 'err' initializer pointless.
>
> MBR, Sergei
>
It doesn't, there's a previous goto statement that might get hit and we
need it to be -1 so we don't signal a feature change.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists