aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-01-16 07:38:59 -0500
committerDavid S. Miller <davem@davemloft.net>2012-01-17 10:31:12 -0500
commite52ac3398c3d772d372b9b62ab408fd5eec96840 (patch)
tree1291fbc00c9fec755be01f49be865219d676b540 /net/core/dev.c
parent27a429383b399fc0f68bea55c422d7179f3c8b05 (diff)
net: Use device model to get driver name in skb_gso_segment()
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index f494675471a9..7e6b7dcaacde 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,
1962 1962
1963 if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) { 1963 if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) {
1964 struct net_device *dev = skb->dev; 1964 struct net_device *dev = skb->dev;
1965 struct ethtool_drvinfo info = {}; 1965 const char *driver = "";
1966 1966
1967 if (dev && dev->ethtool_ops && dev->ethtool_ops->get_drvinfo) 1967 if (dev && dev->dev.parent)
1968 dev->ethtool_ops->get_drvinfo(dev, &info); 1968 driver = dev_driver_string(dev->dev.parent);
1969 1969
1970 WARN(1, "%s: caps=(%pNF, %pNF) len=%d data_len=%d ip_summed=%d\n", 1970 WARN(1, "%s: caps=(%pNF, %pNF) len=%d data_len=%d ip_summed=%d\n",
1971 info.driver, dev ? &dev->features : NULL, 1971 driver, dev ? &dev->features : NULL,
1972 skb->sk ? &skb->sk->sk_route_caps : NULL, 1972 skb->sk ? &skb->sk->sk_route_caps : NULL,
1973 skb->len, skb->data_len, skb->ip_summed); 1973 skb->len, skb->data_len, skb->ip_summed);
1974 1974