[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1447771746-17943-1-git-send-email-razor@blackwall.org>
Date: Tue, 17 Nov 2015 15:49:06 +0100
From: Nikolay Aleksandrov <razor@...ckwall.org>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net,
Nikolay Aleksandrov <nikolay@...ulusnetworks.com>,
Michał Mirosław <mirq-linux@...e.qmqm.pl>
Subject: [PATCH net] net/core: revert "net: fix __netdev_update_features return.." and add comment
From: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
This reverts commit 00ee59271777 ("net: fix __netdev_update_features return
on ndo_set_features failure")
and adds a comment explaining why it's okay to return a value other than
0 upon error. Some drivers might actually change flags and return an
error so it's better to fire a spurious notification rather than miss
these.
CC: Michał Mirosław <mirq-linux@...e.qmqm.pl>
Signed-off-by: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
---
Thanks to Michal for the explanation on why it was made to act like that.
Also sorry for the noise, unfortunately I missed this. IMO this should've
been an all or nothing op from the beginning.
net/core/dev.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 5dbc86ea6b58..ae00b894e675 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6436,7 +6436,10 @@ int __netdev_update_features(struct net_device *dev)
netdev_err(dev,
"set_features() failed (%d); wanted %pNF, left %pNF\n",
err, &features, &dev->features);
- return 0;
+ /* return non-0 since some features might have changed and
+ * it's better to fire a spurious notification than miss it
+ */
+ return -1;
}
sync_lower:
--
2.4.3
--
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