Commit e768fb29 authored by Dmitry Kravkov's avatar Dmitry Kravkov Committed by David S. Miller

bnx2x: fix TCP offload for tunneling ipv4 over ipv6

FW was initialized with data from wrong header, this caused TSO packets
have wrong IP csum.
Signed-off-by: default avatarDmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: default avatarAriel Elior <ariele@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 534c8779
...@@ -3192,11 +3192,11 @@ static u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb) ...@@ -3192,11 +3192,11 @@ static u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb)
rc |= XMIT_CSUM_TCP; rc |= XMIT_CSUM_TCP;
if (skb_is_gso_v6(skb)) { if (skb_is_gso_v6(skb)) {
rc |= (XMIT_GSO_V6 | XMIT_CSUM_TCP | XMIT_CSUM_V6); rc |= (XMIT_GSO_V6 | XMIT_CSUM_TCP);
if (rc & XMIT_CSUM_ENC) if (rc & XMIT_CSUM_ENC)
rc |= XMIT_GSO_ENC_V6; rc |= XMIT_GSO_ENC_V6;
} else if (skb_is_gso(skb)) { } else if (skb_is_gso(skb)) {
rc |= (XMIT_GSO_V4 | XMIT_CSUM_V4 | XMIT_CSUM_TCP); rc |= (XMIT_GSO_V4 | XMIT_CSUM_TCP);
if (rc & XMIT_CSUM_ENC) if (rc & XMIT_CSUM_ENC)
rc |= XMIT_GSO_ENC_V4; rc |= XMIT_GSO_ENC_V4;
} }
...@@ -3483,19 +3483,18 @@ static void bnx2x_update_pbds_gso_enc(struct sk_buff *skb, ...@@ -3483,19 +3483,18 @@ static void bnx2x_update_pbds_gso_enc(struct sk_buff *skb,
{ {
u16 hlen_w = 0; u16 hlen_w = 0;
u8 outerip_off, outerip_len = 0; u8 outerip_off, outerip_len = 0;
/* from outer IP to transport */ /* from outer IP to transport */
hlen_w = (skb_inner_transport_header(skb) - hlen_w = (skb_inner_transport_header(skb) -
skb_network_header(skb)) >> 1; skb_network_header(skb)) >> 1;
/* transport len */ /* transport len */
if (xmit_type & XMIT_CSUM_TCP)
hlen_w += inner_tcp_hdrlen(skb) >> 1; hlen_w += inner_tcp_hdrlen(skb) >> 1;
else
hlen_w += sizeof(struct udphdr) >> 1;
pbd2->fw_ip_hdr_to_payload_w = hlen_w; pbd2->fw_ip_hdr_to_payload_w = hlen_w;
if (xmit_type & XMIT_CSUM_ENC_V4) { /* outer IP header info */
if (xmit_type & XMIT_CSUM_V4) {
struct iphdr *iph = ip_hdr(skb); struct iphdr *iph = ip_hdr(skb);
pbd2->fw_ip_csum_wo_len_flags_frag = pbd2->fw_ip_csum_wo_len_flags_frag =
bswab16(csum_fold((~iph->check) - bswab16(csum_fold((~iph->check) -
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment