Subject: Re: [PATCH net] net: fix __netdev_update_features return on ndo_set_features failure

From: Nikolay Aleksandrov <[email-masked]>
Date: Tue, 17 Nov 2015 15:31:26 +0100

On 11/17/2015 02:54 PM, Michał Mirosław wrote:
> On Fri, Nov 13, 2015 at 03:20:24PM +0100, Nikolay Aleksandrov wrote:
>> From: Nikolay Aleksandrov <[email-masked]>
>>
>> If ndo_set_features fails __netdev_update_features() will return -1 but
>> this is wrong because it is expected to return 0 if no features were
>> changed (see netdev_update_features()), which will cause a netdev
>> notifier to be called without any actual changes. Fix this by returning
>> 0 if ndo_set_features fails.
> 
> Hmm. In case ndo_update_features() failed it might have changed the features.
> The assumption I made was that we're better off initiating spurious notification
> than miss one. This is an unlikely event - a bug in a driver or problem with the HW.
> 
> Best Regards,
> Michał Mirosław
> 

Hmm, good point. I went over a dozen drivers and I can see that some might
actually do that (e.g. bnx2x in bnx2x_set_features()). It's rare but possible,
most of them return only 0.
Okay then, I'll revert this change and add a comment with this so it's clear
in the future.

Thanks for the feedback,
 Nik