aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/myri10ge
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-08-29 19:44:56 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:53:53 -0400
commit84fa7933a33f806bbbaae6775e87459b1ec584c0 (patch)
tree5be404225d90f640997b12f631e9b496b3fd0d61 /drivers/net/myri10ge
parent8584d6df39db5601965f9bc5e3bf2fea833ad7bb (diff)
[NET]: Replace CHECKSUM_HW by CHECKSUM_PARTIAL/CHECKSUM_COMPLETE
Replace CHECKSUM_HW by CHECKSUM_PARTIAL (for outgoing packets, whose checksum still needs to be completed) and CHECKSUM_COMPLETE (for incoming packets, device supplied full checksum). Patch originally from Herbert Xu, updated by myself for 2.6.18-rc3. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/myri10ge')
-rw-r--r--drivers/net/myri10ge/myri10ge.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 9bdd43ab3573..9f16681d0e7e 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -930,7 +930,7 @@ static inline void myri10ge_vlan_ip_csum(struct sk_buff *skb, u16 hw_csum)
930 (vh->h_vlan_encapsulated_proto == htons(ETH_P_IP) || 930 (vh->h_vlan_encapsulated_proto == htons(ETH_P_IP) ||
931 vh->h_vlan_encapsulated_proto == htons(ETH_P_IPV6))) { 931 vh->h_vlan_encapsulated_proto == htons(ETH_P_IPV6))) {
932 skb->csum = hw_csum; 932 skb->csum = hw_csum;
933 skb->ip_summed = CHECKSUM_HW; 933 skb->ip_summed = CHECKSUM_COMPLETE;
934 } 934 }
935} 935}
936 936
@@ -973,7 +973,7 @@ myri10ge_rx_done(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx,
973 if ((skb->protocol == ntohs(ETH_P_IP)) || 973 if ((skb->protocol == ntohs(ETH_P_IP)) ||
974 (skb->protocol == ntohs(ETH_P_IPV6))) { 974 (skb->protocol == ntohs(ETH_P_IPV6))) {
975 skb->csum = ntohs((u16) csum); 975 skb->csum = ntohs((u16) csum);
976 skb->ip_summed = CHECKSUM_HW; 976 skb->ip_summed = CHECKSUM_COMPLETE;
977 } else 977 } else
978 myri10ge_vlan_ip_csum(skb, ntohs((u16) csum)); 978 myri10ge_vlan_ip_csum(skb, ntohs((u16) csum));
979 } 979 }
@@ -1897,13 +1897,13 @@ again:
1897 pseudo_hdr_offset = 0; 1897 pseudo_hdr_offset = 0;
1898 odd_flag = 0; 1898 odd_flag = 0;
1899 flags = (MXGEFW_FLAGS_NO_TSO | MXGEFW_FLAGS_FIRST); 1899 flags = (MXGEFW_FLAGS_NO_TSO | MXGEFW_FLAGS_FIRST);
1900 if (likely(skb->ip_summed == CHECKSUM_HW)) { 1900 if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
1901 cksum_offset = (skb->h.raw - skb->data); 1901 cksum_offset = (skb->h.raw - skb->data);
1902 pseudo_hdr_offset = (skb->h.raw + skb->csum) - skb->data; 1902 pseudo_hdr_offset = (skb->h.raw + skb->csum) - skb->data;
1903 /* If the headers are excessively large, then we must 1903 /* If the headers are excessively large, then we must
1904 * fall back to a software checksum */ 1904 * fall back to a software checksum */
1905 if (unlikely(cksum_offset > 255 || pseudo_hdr_offset > 127)) { 1905 if (unlikely(cksum_offset > 255 || pseudo_hdr_offset > 127)) {
1906 if (skb_checksum_help(skb, 0)) 1906 if (skb_checksum_help(skb))
1907 goto drop; 1907 goto drop;
1908 cksum_offset = 0; 1908 cksum_offset = 0;
1909 pseudo_hdr_offset = 0; 1909 pseudo_hdr_offset = 0;