diff mbox

net: avoid initial "Features changed" message

Message ID 864ebe4e8085d1782e90137e146bb95e38e4c718.1298385559.git.mirq-linux@rere.qmqm.pl
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Michał Mirosław Feb. 22, 2011, 2:42 p.m. UTC
Avoid "Features changed" message and ndo_set_features call on device
registration caused by automatic enabling of GSO and GRO. Driver should
have already enabled hardware offloads it set in features, so the
ndo_set_features() is not needed at registration time unless features
change because of other dependencies.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 net/core/dev.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

Comments

Michał Mirosław Feb. 22, 2011, 2:43 p.m. UTC | #1
On Tue, Feb 22, 2011 at 03:42:06PM +0100, Michał Mirosław wrote:
> Avoid "Features changed" message and ndo_set_features call on device
> registration caused by automatic enabling of GSO and GRO. Driver should
> have already enabled hardware offloads it set in features, so the
> ndo_set_features() is not needed at registration time unless features
> change because of other dependencies.
[cut patch]

Ah. This depends on 'Fix "(unregistered net_device): Features changed" message'
patch I sent couple days ago.

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/core/dev.c b/net/core/dev.c
index 33f4318..039a9a6 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5475,12 +5475,14 @@  int register_netdevice(struct net_device *dev)
 	 * software offloads (GSO and GRO).
 	 */
 	dev->hw_features |= NETIF_F_SOFT_FEATURES;
-	dev->wanted_features = (dev->features & dev->hw_features)
-		| NETIF_F_SOFT_FEATURES;
+	dev->features |= NETIF_F_SOFT_FEATURES;
+	dev->wanted_features = dev->features & dev->hw_features;
 
 	/* Avoid warning from netdev_fix_features() for GSO without SG */
-	if (!(dev->wanted_features & NETIF_F_SG))
+	if (!(dev->wanted_features & NETIF_F_SG)) {
 		dev->wanted_features &= ~NETIF_F_GSO;
+		dev->features &= ~NETIF_F_GSO;
+	}
 
 	/* Enable GRO and NETIF_F_HIGHDMA for vlans by default,
 	 * vlan_dev_init() will do the dev->features check, so these features