Skip to contentSkip to conversation

net: mvneta: enable features before registering the driver

PATCH In review Willy Tarreau 3 participants 4 messages Apr 6, 2013 – Apr 9, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mvneta: enable features before registering the driver

Hi,

I noticed that mvneta's tx-csum/sg were off until disabled then enabled, which led me to think that something was not made in the correct sequence. And indeed, setting the dev features _before_ registering the device works much better :-)

This patch is for master but may be backported to 3.8-stable as well, which is where I first experienced the issue.

Thanks,
Willy

Quoted 1 line

From 005eb7594a4304eed5e9b427ca6b745260c9eded Mon Sep 17 00:00:00 2001

From: Willy Tarreau <[email protected]>
Date: Mon, 11 Mar 2013 07:56:58 +0100
Subject: [PATCH] net: mvneta: enable features before registering the driver,
not after

It seems that the reason why the dev features were ignored was because they were enabled after registeration.

---
 drivers/net/ethernet/marvell/mvneta.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/ethernet/marvell/mvneta.c +5 -4
index cd345b8..1e628ce 100644
@@ -2771,16 +2771,17 @@ static int mvneta_probe(struct platform_device *pdev)
 
 	netif_napi_add(dev, &pp->napi, mvneta_poll, pp->weight);
 
+	dev->features = NETIF_F_SG | NETIF_F_IP_CSUM;
+	dev->hw_features |= NETIF_F_SG | NETIF_F_IP_CSUM;
+	dev->vlan_features |= NETIF_F_SG | NETIF_F_IP_CSUM;
+	dev->priv_flags |= IFF_UNICAST_FLT;
+
 	err = register_netdev(dev);
 	if (err < 0) {
 		dev_err(&pdev->dev, "failed to register\n");
 		goto err_deinit;
 	}
 
-	dev->features = NETIF_F_SG | NETIF_F_IP_CSUM;
-	dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM;
-	dev->priv_flags |= IFF_UNICAST_FLT;
-
 	netdev_info(dev, "mac: %pM\n", dev->dev_addr);
 
 	platform_set_drvdata(pdev, pp->dev);
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
Acked-by on v1 1/1
#1 lore raw

Dear Willy Tarreau,

Quoted 10 lines · Willy Tarreau

From 005eb7594a4304eed5e9b427ca6b745260c9eded Mon Sep 17 00:00:00 2001
From: Willy Tarreau <[email protected]>
Date: Mon, 11 Mar 2013 07:56:58 +0100
Subject: [PATCH] net: mvneta: enable features before registering the driver, not after

It seems that the reason why the dev features were ignored was because they were enabled after registeration.

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
maintainer
#2 lore raw
In reply to Willy Tarreau

From: Willy Tarreau <[email protected]>
Date: Sat, 6 Apr 2013 20:47:01 +0200

Quoted 9 lines

Hi,

I noticed that mvneta's tx-csum/sg were off until disabled then enabled, which led me to think that something was not made in the correct sequence. And indeed, setting the dev features _before_ registering the device works much better :-)

This patch is for master but may be backported to 3.8-stable as well, which is where I first experienced the issue.

Please don't post patches like this, you make extra work for the maintainer by having to edit out this commentary.

You put such commentary after the "---" seperator the delineates your commit message in the email body, not before.

Anyways, applied.

#3 lore raw
Quoted 10 lines · David Miller

From: Willy Tarreau <[email protected]>
Date: Sat, 6 Apr 2013 20:47:01 +0200

Quoted 7 lines

Hi,

I noticed that mvneta's tx-csum/sg were off until disabled then enabled, which led me to think that something was not made in the correct sequence. And indeed, setting the dev features _before_ registering the device works much better :-)

Quoted 8 lines
Quoted 2 lines

This patch is for master but may be backported to 3.8-stable as well, which is where I first experienced the issue.

Please don't post patches like this, you make extra work for the maintainer by having to edit out this commentary.

You put such commentary after the "---" seperator the delineates your commit message in the email body, not before.

Sorry for this David, I'll take care of this next time.

Quoted 1 line

Anyways, applied.

Thank you.

Willy