aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r--drivers/net/bnx2.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index e85f5ec48f96..f98a2205a090 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -1884,10 +1884,8 @@ bnx2_rx_int(struct bnx2 *bp, int budget)
1884 goto reuse_rx; 1884 goto reuse_rx;
1885 1885
1886 /* aligned copy */ 1886 /* aligned copy */
1887 memcpy(new_skb->data, 1887 skb_copy_from_linear_data_offset(skb, bp->rx_offset - 2,
1888 skb->data + bp->rx_offset - 2, 1888 new_skb->data, len + 2);
1889 len + 2);
1890
1891 skb_reserve(new_skb, 2); 1889 skb_reserve(new_skb, 2);
1892 skb_put(new_skb, len); 1890 skb_put(new_skb, len);
1893 1891
@@ -4513,6 +4511,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
4513 if ((mss = skb_shinfo(skb)->gso_size) && 4511 if ((mss = skb_shinfo(skb)->gso_size) &&
4514 (skb->len > (bp->dev->mtu + ETH_HLEN))) { 4512 (skb->len > (bp->dev->mtu + ETH_HLEN))) {
4515 u32 tcp_opt_len, ip_tcp_len; 4513 u32 tcp_opt_len, ip_tcp_len;
4514 struct iphdr *iph;
4516 4515
4517 if (skb_header_cloned(skb) && 4516 if (skb_header_cloned(skb) &&
4518 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { 4517 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
@@ -4520,25 +4519,23 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
4520 return NETDEV_TX_OK; 4519 return NETDEV_TX_OK;
4521 } 4520 }
4522 4521
4523 tcp_opt_len = ((skb->h.th->doff - 5) * 4);
4524 vlan_tag_flags |= TX_BD_FLAGS_SW_LSO; 4522 vlan_tag_flags |= TX_BD_FLAGS_SW_LSO;
4525 4523
4526 tcp_opt_len = 0; 4524 tcp_opt_len = 0;
4527 if (skb->h.th->doff > 5) { 4525 if (tcp_hdr(skb)->doff > 5)
4528 tcp_opt_len = (skb->h.th->doff - 5) << 2; 4526 tcp_opt_len = tcp_optlen(skb);
4529 } 4527
4530 ip_tcp_len = (skb->nh.iph->ihl << 2) + sizeof(struct tcphdr); 4528 ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr);
4531 4529
4532 skb->nh.iph->check = 0; 4530 iph = ip_hdr(skb);
4533 skb->nh.iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len); 4531 iph->check = 0;
4534 skb->h.th->check = 4532 iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len);
4535 ~csum_tcpudp_magic(skb->nh.iph->saddr, 4533 tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
4536 skb->nh.iph->daddr, 4534 iph->daddr, 0,
4537 0, IPPROTO_TCP, 0); 4535 IPPROTO_TCP, 0);
4538 4536 if (tcp_opt_len || (iph->ihl > 5)) {
4539 if (tcp_opt_len || (skb->nh.iph->ihl > 5)) { 4537 vlan_tag_flags |= ((iph->ihl - 5) +
4540 vlan_tag_flags |= ((skb->nh.iph->ihl - 5) + 4538 (tcp_opt_len >> 2)) << 8;
4541 (tcp_opt_len >> 2)) << 8;
4542 } 4539 }
4543 } 4540 }
4544 else 4541 else