* [PATCH] net: mvneta: enable features before registering the driver
@ 2013-04-06 18:47 Willy Tarreau
2013-04-07 10:11 ` Thomas Petazzoni
2013-04-08 16:16 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Willy Tarreau @ 2013-04-06 18:47 UTC (permalink / raw)
To: netdev; +Cc: thomas.petazzoni
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
>From 005eb7594a4304eed5e9b427ca6b745260c9eded Mon Sep 17 00:00:00 2001
From: Willy Tarreau <w@1wt.eu>
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.
Signed-off-by: Willy Tarreau <w@1wt.eu>
---
drivers/net/ethernet/marvell/mvneta.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index cd345b8..1e628ce 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -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);
--
1.7.12.2.21.g234cd45.dirty
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] net: mvneta: enable features before registering the driver
2013-04-06 18:47 [PATCH] net: mvneta: enable features before registering the driver Willy Tarreau
@ 2013-04-07 10:11 ` Thomas Petazzoni
2013-04-08 16:16 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2013-04-07 10:11 UTC (permalink / raw)
To: Willy Tarreau; +Cc: netdev
Dear Willy Tarreau,
On Sat, 6 Apr 2013 20:47:01 +0200, Willy Tarreau wrote:
> From 005eb7594a4304eed5e9b427ca6b745260c9eded Mon Sep 17 00:00:00 2001
> From: Willy Tarreau <w@1wt.eu>
> 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.
>
> Signed-off-by: Willy Tarreau <w@1wt.eu>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: mvneta: enable features before registering the driver
2013-04-06 18:47 [PATCH] net: mvneta: enable features before registering the driver Willy Tarreau
2013-04-07 10:11 ` Thomas Petazzoni
@ 2013-04-08 16:16 ` David Miller
2013-04-09 5:46 ` Willy Tarreau
1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2013-04-08 16:16 UTC (permalink / raw)
To: w; +Cc: netdev, thomas.petazzoni
From: Willy Tarreau <w@1wt.eu>
Date: Sat, 6 Apr 2013 20:47:01 +0200
> 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: mvneta: enable features before registering the driver
2013-04-08 16:16 ` David Miller
@ 2013-04-09 5:46 ` Willy Tarreau
0 siblings, 0 replies; 4+ messages in thread
From: Willy Tarreau @ 2013-04-09 5:46 UTC (permalink / raw)
To: David Miller; +Cc: netdev
On Mon, Apr 08, 2013 at 12:16:04PM -0400, David Miller wrote:
> From: Willy Tarreau <w@1wt.eu>
> Date: Sat, 6 Apr 2013 20:47:01 +0200
>
> > 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.
Sorry for this David, I'll take care of this next time.
> Anyways, applied.
Thank you.
Willy
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-09 5:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-06 18:47 [PATCH] net: mvneta: enable features before registering the driver Willy Tarreau
2013-04-07 10:11 ` Thomas Petazzoni
2013-04-08 16:16 ` David Miller
2013-04-09 5:46 ` Willy Tarreau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).