Re: Intel igb (new gigabit card) module
On Fri, 2008-03-14 at 12:21 +0000, Stephen Gran wrote:
>
> 2.6.18, and it builds and works without a problem (well, some checksum
> offload issues in connection with Xen, but ethtool can solve those)
Or the patch from
http://sourceforge.net/mailarchive/message.php?msg_name=36D9DB17C6DE9E40B059440DB8D95F5204954A14%40orsmsx418.amr.corp.intel.com (non-whitespace damaged version attached).
Ian.
--
Ian Campbell
Today when a man gets married he gets a home, a housekeeper, a cook, a cheering
squad and another paycheck. When a woman marries, she gets a boarder.
diff -r 655e205ef17c drivers/net/igb/igb_main.c
--- a/drivers/net/igb/igb_main.c Tue Mar 04 13:20:07 2008 +0000
+++ b/drivers/net/igb/igb_main.c Fri Mar 07 09:00:01 2008 +0000
@@ -2761,12 +2761,27 @@ static inline bool igb_tx_csum_adv(struc
tu_cmd |= (E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT);
if (skb->ip_summed == CHECKSUM_PARTIAL) {
- if (skb->protocol == htons(ETH_P_IP))
+ switch (skb->protocol) {
+ case __constant_htons(ETH_P_IP):
tu_cmd |= E1000_ADVTXD_TUCMD_IPV4;
-
-
- if (skb->sk && (skb->sk->sk_protocol == IPPROTO_TCP))
- tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
+ if (ip_hdr(skb)->protocol == IPPROTO_TCP)
+ tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
+ break;
+#ifdef NETIF_F_IPV6_CSUM
+ case __constant_htons(ETH_P_IPV6):
+ /* XXX what about other V6 headers?? */
+ if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP)
+ tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
+ break;
+#endif
+ default:
+ if (unlikely(net_ratelimit())) {
+ DPRINTK(PROBE, WARNING,
+ "partial checksum but proto=%x!\n",
+ skb->protocol);
+ }
+ break;
+ }
}
context_desc->type_tucmd_mlhl = cpu_to_le32(tu_cmd);
Reply to: