From: Ben Hutchings <bhutchings@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>, <netdev@vger.kernel.org>
Subject: [PATCH net 1/2] net: Use device model to get driver name in skb_gso_segment()
Date: Mon, 16 Jan 2012 22:38:59 +0000 [thread overview]
Message-ID: <1326753539.3065.31.camel@bwh-desktop> (raw)
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(-)
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);
--
1.7.7.5
next reply other threads:[~2012-01-16 22:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-16 22:38 Ben Hutchings [this message]
2012-01-16 22:41 ` [PATCH net 1/2] net: Use device model to get driver name in skb_gso_segment() Herbert Xu
2012-01-17 15:32 ` David Miller
2012-01-16 22:43 ` [PATCH net 2/2] net: WARN if skb_checksum_help() is called on skb requiring segmentation Ben Hutchings
2012-01-17 6:11 ` Herbert Xu
2012-01-17 15:32 ` David Miller
2012-01-17 17:15 ` Ben Hutchings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1326753539.3065.31.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox