diff options
Diffstat (limited to 'drivers/net/igb/igb_main.c')
-rw-r--r-- | drivers/net/igb/igb_main.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 6a1f23092099..928ce8287e69 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <linux/vmalloc.h> | 31 | #include <linux/vmalloc.h> |
32 | #include <linux/pagemap.h> | 32 | #include <linux/pagemap.h> |
33 | #include <linux/netdevice.h> | 33 | #include <linux/netdevice.h> |
34 | #include <linux/tcp.h> | ||
35 | #include <linux/ipv6.h> | 34 | #include <linux/ipv6.h> |
36 | #include <net/checksum.h> | 35 | #include <net/checksum.h> |
37 | #include <net/ip6_checksum.h> | 36 | #include <net/ip6_checksum.h> |
@@ -2484,10 +2483,24 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter, | |||
2484 | tu_cmd |= (E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT); | 2483 | tu_cmd |= (E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT); |
2485 | 2484 | ||
2486 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 2485 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
2487 | if (skb->protocol == htons(ETH_P_IP)) | 2486 | switch (skb->protocol) { |
2487 | case __constant_htons(ETH_P_IP): | ||
2488 | tu_cmd |= E1000_ADVTXD_TUCMD_IPV4; | 2488 | tu_cmd |= E1000_ADVTXD_TUCMD_IPV4; |
2489 | if (skb->sk && (skb->sk->sk_protocol == IPPROTO_TCP)) | 2489 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) |
2490 | tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP; | 2490 | tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP; |
2491 | break; | ||
2492 | case __constant_htons(ETH_P_IPV6): | ||
2493 | /* XXX what about other V6 headers?? */ | ||
2494 | if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) | ||
2495 | tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP; | ||
2496 | break; | ||
2497 | default: | ||
2498 | if (unlikely(net_ratelimit())) | ||
2499 | dev_warn(&adapter->pdev->dev, | ||
2500 | "partial checksum but proto=%x!\n", | ||
2501 | skb->protocol); | ||
2502 | break; | ||
2503 | } | ||
2491 | } | 2504 | } |
2492 | 2505 | ||
2493 | context_desc->type_tucmd_mlhl = cpu_to_le32(tu_cmd); | 2506 | context_desc->type_tucmd_mlhl = cpu_to_le32(tu_cmd); |