All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
	"Nikolay Aleksandrov" <razor@blackwall.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH net] net: fix __netdev_update_features return on ndo_set_features failure
Date: Tue, 17 Nov 2015 15:31:26 +0100	[thread overview]
Message-ID: <564B3A3E.50905@cumulusnetworks.com> (raw)
In-Reply-To: <20151117135418.GA30197@rere.qmqm.pl>

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 <nikolay@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

  reply	other threads:[~2015-11-17 14:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 14:20 [PATCH net] net: fix __netdev_update_features return on ndo_set_features failure Nikolay Aleksandrov
2015-11-16 19:56 ` David Miller
2015-11-17 13:54 ` Michał Mirosław
2015-11-17 14:31   ` Nikolay Aleksandrov [this message]
2015-11-17 14:49     ` [PATCH net] net/core: revert "net: fix __netdev_update_features return.." and add comment Nikolay Aleksandrov
2015-11-17 20:27       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=564B3A3E.50905@cumulusnetworks.com \
    --to=nikolay@cumulusnetworks.com \
    --cc=davem@davemloft.net \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=netdev@vger.kernel.org \
    --cc=razor@blackwall.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.