Patchwork [net,1/2] net: Use device model to get driver name in skb_gso_segment()

login
register
mail settings
Submitter Ben Hutchings
Date Jan. 16, 2012, 10:38 p.m.
Message ID <1326753539.3065.31.camel@bwh-desktop>
Download mbox | patch
Permalink /patch/136375/
State Accepted
Delegated to: David Miller
Headers show

Comments

Ben Hutchings - Jan. 16, 2012, 10:38 p.m.
ethtool operations generally require the caller to hold RTNL and are
not safe to call in atomic context.  The device model provides this
information for most devices; we'll only lose it for some old ISA
drivers.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 net/core/dev.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
Herbert Xu - Jan. 16, 2012, 10:41 p.m.
On Mon, Jan 16, 2012 at 10:38:59PM +0000, Ben Hutchings wrote:
> ethtool operations generally require the caller to hold RTNL and are
> not safe to call in atomic context.  The device model provides this
> information for most devices; we'll only lose it for some old ISA
> drivers.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>

Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

Thanks,
David Miller - Jan. 17, 2012, 3:32 p.m.
From: Herbert Xu <herbert@gondor.hengli.com.au>
Date: Tue, 17 Jan 2012 09:41:38 +1100

> On Mon, Jan 16, 2012 at 10:38:59PM +0000, Ben Hutchings wrote:
>> ethtool operations generally require the caller to hold RTNL and are
>> not safe to call in atomic context.  The device model provides this
>> information for most devices; we'll only lose it for some old ISA
>> drivers.
>> 
>> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> 
> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

Applied.
--
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

Patch

diff --git a/net/core/dev.c b/net/core/dev.c
index f494675..7e6b7dc 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1962,13 +1962,13 @@  struct sk_buff *skb_gso_segment(struct sk_buff *skb,
 
 	if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) {
 		struct net_device *dev = skb->dev;
-		struct ethtool_drvinfo info = {};
+		const char *driver = "";
 
-		if (dev && dev->ethtool_ops && dev->ethtool_ops->get_drvinfo)
-			dev->ethtool_ops->get_drvinfo(dev, &info);
+		if (dev && dev->dev.parent)
+			driver = dev_driver_string(dev->dev.parent);
 
 		WARN(1, "%s: caps=(%pNF, %pNF) len=%d data_len=%d ip_summed=%d\n",
-		     info.driver, dev ? &dev->features : NULL,
+		     driver, dev ? &dev->features : NULL,
 		     skb->sk ? &skb->sk->sk_route_caps : NULL,
 		     skb->len, skb->data_len, skb->ip_summed);