mirror of
https://github.com/torvalds/linux.git
synced 2024-10-31 01:01:52 +00:00
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>
This commit is contained in:
parent
27a429383b
commit
e52ac3398c
@ -1962,13 +1962,13 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb,
|
|||||||
|
|
||||||
if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) {
|
if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) {
|
||||||
struct net_device *dev = skb->dev;
|
struct net_device *dev = skb->dev;
|
||||||
struct ethtool_drvinfo info = {};
|
const char *driver = "";
|
||||||
|
|
||||||
if (dev && dev->ethtool_ops && dev->ethtool_ops->get_drvinfo)
|
if (dev && dev->dev.parent)
|
||||||
dev->ethtool_ops->get_drvinfo(dev, &info);
|
driver = dev_driver_string(dev->dev.parent);
|
||||||
|
|
||||||
WARN(1, "%s: caps=(%pNF, %pNF) len=%d data_len=%d ip_summed=%d\n",
|
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->sk ? &skb->sk->sk_route_caps : NULL,
|
||||||
skb->len, skb->data_len, skb->ip_summed);
|
skb->len, skb->data_len, skb->ip_summed);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user