From: Andy Gospodarek <andy@greyhouse.net>
To: Auke Kok <auke-jan.h.kok@intel.com>, netdev@vger.kernel.org
Subject: [PATCH 2.6.25] ixgbe/igb: correctly obtain protocol information on transmit
Date: Mon, 11 Feb 2008 20:35:40 -0500 [thread overview]
Message-ID: <20080212013540.GD856@gospo.usersys.redhat.com> (raw)
I noticed a strange panic on a box with an ixgbe-based interface when
using bridging. Protocol information ought to come from the frame
itself rather than anywhere else.
The igb driver has a similar coding error that would cause incorrect
flags to be set, so it would not panic. It should still get fixed
though.
Checking the frame's payload on both drivers seems like a better
option.
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
---
igb/igb_main.c | 3 ++-
ixgbe/ixgbe_main.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index f3c144d..5572923 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -2514,9 +2514,10 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter,
tu_cmd |= (E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT);
if (skb->ip_summed == CHECKSUM_PARTIAL) {
+ struct iphdr *iph = ip_hdr(skb);
if (skb->protocol == htons(ETH_P_IP))
tu_cmd |= E1000_ADVTXD_TUCMD_IPV4;
- if (skb->sk && (skb->sk->sk_protocol == IPPROTO_TCP))
+ if (iph->protocol == IPPROTO_TCP)
tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
}
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 3732dd6..4542870 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2202,10 +2202,11 @@ static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter,
IXGBE_ADVTXD_DTYP_CTXT);
if (skb->ip_summed == CHECKSUM_PARTIAL) {
+ struct iphdr *iph = ip_hdr(skb);
if (skb->protocol == htons(ETH_P_IP))
type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4;
- if (skb->sk->sk_protocol == IPPROTO_TCP)
+ if (iph->protocol == IPPROTO_TCP)
type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP;
}
reply other threads:[~2008-02-12 1:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20080212013540.GD856@gospo.usersys.redhat.com \
--to=andy@greyhouse.net \
--cc=auke-jan.h.kok@intel.com \
--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;
as well as URLs for NNTP newsgroup(s).