aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgb/ixgb_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgb/ixgb_main.c')
-rw-r--r--drivers/net/ixgb/ixgb_main.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index afc2ec72529e..dfde80e54aef 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1182,24 +1182,27 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb)
1182 1182
1183 if (likely(skb_is_gso(skb))) { 1183 if (likely(skb_is_gso(skb))) {
1184 struct ixgb_buffer *buffer_info; 1184 struct ixgb_buffer *buffer_info;
1185 struct iphdr *iph;
1186
1185 if (skb_header_cloned(skb)) { 1187 if (skb_header_cloned(skb)) {
1186 err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); 1188 err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
1187 if (err) 1189 if (err)
1188 return err; 1190 return err;
1189 } 1191 }
1190 1192
1191 hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); 1193 hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
1192 mss = skb_shinfo(skb)->gso_size; 1194 mss = skb_shinfo(skb)->gso_size;
1193 skb->nh.iph->tot_len = 0; 1195 iph = ip_hdr(skb);
1194 skb->nh.iph->check = 0; 1196 iph->tot_len = 0;
1195 skb->h.th->check = ~csum_tcpudp_magic(skb->nh.iph->saddr, 1197 iph->check = 0;
1196 skb->nh.iph->daddr, 1198 tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
1197 0, IPPROTO_TCP, 0); 1199 iph->daddr, 0,
1198 ipcss = skb->nh.raw - skb->data; 1200 IPPROTO_TCP, 0);
1199 ipcso = (void *)&(skb->nh.iph->check) - (void *)skb->data; 1201 ipcss = skb_network_offset(skb);
1200 ipcse = skb->h.raw - skb->data - 1; 1202 ipcso = (void *)&(iph->check) - (void *)skb->data;
1201 tucss = skb->h.raw - skb->data; 1203 ipcse = skb_transport_offset(skb) - 1;
1202 tucso = (void *)&(skb->h.th->check) - (void *)skb->data; 1204 tucss = skb_transport_offset(skb);
1205 tucso = (void *)&(tcp_hdr(skb)->check) - (void *)skb->data;
1203 tucse = 0; 1206 tucse = 0;
1204 1207
1205 i = adapter->tx_ring.next_to_use; 1208 i = adapter->tx_ring.next_to_use;
@@ -1243,7 +1246,7 @@ ixgb_tx_csum(struct ixgb_adapter *adapter, struct sk_buff *skb)
1243 1246
1244 if(likely(skb->ip_summed == CHECKSUM_PARTIAL)) { 1247 if(likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
1245 struct ixgb_buffer *buffer_info; 1248 struct ixgb_buffer *buffer_info;
1246 css = skb->h.raw - skb->data; 1249 css = skb_transport_offset(skb);
1247 cso = css + skb->csum_offset; 1250 cso = css + skb->csum_offset;
1248 1251
1249 i = adapter->tx_ring.next_to_use; 1252 i = adapter->tx_ring.next_to_use;
@@ -2014,9 +2017,12 @@ ixgb_clean_rx_irq(struct ixgb_adapter *adapter)
2014 netdev_alloc_skb(netdev, length + NET_IP_ALIGN); 2017 netdev_alloc_skb(netdev, length + NET_IP_ALIGN);
2015 if (new_skb) { 2018 if (new_skb) {
2016 skb_reserve(new_skb, NET_IP_ALIGN); 2019 skb_reserve(new_skb, NET_IP_ALIGN);
2017 memcpy(new_skb->data - NET_IP_ALIGN, 2020 skb_copy_to_linear_data_offset(new_skb,
2018 skb->data - NET_IP_ALIGN, 2021 -NET_IP_ALIGN,
2019 length + NET_IP_ALIGN); 2022 (skb->data -
2023 NET_IP_ALIGN),
2024 (length +
2025 NET_IP_ALIGN));
2020 /* save the skb in buffer_info as good */ 2026 /* save the skb in buffer_info as good */
2021 buffer_info->skb = skb; 2027 buffer_info->skb = skb;
2022 skb = new_skb; 2028 skb = new_skb;