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 <niko...@cumulusnetworks.com>
>>
>> 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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to