bnx2x: fix TCP offload for tunneling ipv4 over ipv6
PATCH 1/1 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.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +6 -7
@@ -3198,11 +3198,11 @@ static u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb) rc |=XMIT_CSUM_TCP ;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 ) rc |=XMIT_GSO_ENC_V6 ; }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 ) rc |=XMIT_GSO_ENC_V4 ; }
@@ -3489,19 +3489,18 @@ static void bnx2x_update_pbds_gso_enc(struct sk_buff *skb, {u16 hlen_w =0 ;u8 outerip_off, outerip_len =0 ; +/* from outer IP to transport */ hlen_w = (skb_inner_transport_header (skb) -skb_network_header (skb)) >>1 ;/* transport len */ -if (xmit_type &XMIT_CSUM_TCP ) - hlen_w +=inner_tcp_hdrlen (skb) >>1 ; -else - hlen_w +=sizeof (struct udphdr ) >>1 ; + hlen_w +=inner_tcp_hdrlen (skb) >>1 ; 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); pbd2->fw_ip_csum_wo_len_flags_frag = bswab16(csum_fold((~iph->check) -
Signature · 1 line
1.8.1.4
Hello.
Quoted 15 lines · Dmitry Kravkov
FW was initialized with data from wrong header, this caused TSO packets have wrong IP csum.
Signed-off-by Dmitry Kravkov <[email protected]>Signed-off-by Ariel Elior <[email protected]>Signed-off-by Eilon Greenstein <[email protected]>--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +0
-0
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c static u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb) · line 3201
Quoted 5 lines
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +1
-1@@ -3198,11 +3198,11 @@ static u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb) rc |=XMIT_CSUM_TCP ;if (skb_is_gso_v6 (skb)) { - rc |= (XMIT_GSO_V6 |XMIT_CSUM_TCP |XMIT_CSUM_V6 ); + rc |= (XMIT_GSO_V6 |XMIT_CSUM_TCP );
Maybe it's time to drop the useless ()?
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c static u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb) · line 3205
Quoted 5 lines
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +1
-1if (rc &XMIT_CSUM_ENC ) rc |=XMIT_GSO_ENC_V6 ; }else if (skb_is_gso (skb)) { - rc |= (XMIT_GSO_V4 |XMIT_CSUM_V4 |XMIT_CSUM_TCP ); + rc |= (XMIT_GSO_V4 |XMIT_CSUM_TCP );
Oh, here as well...
WBR, Sergei
Quoted 42 lines
-----Original Message-----
From: Sergei Shtylyov [mailto:[email protected]]
Sent: Monday, June 03, 2013 2:28 PM
To: Dmitry Kravkov
Cc: [email protected]; [email protected]; Ariel Elior; Eilon Greenstein
Subject: Re: [PATCH net] bnx2x: fix TCP offload for tunneling ipv4 over ipv6Hello.
Quoted 15 lines · Dmitry Kravkov
FW was initialized with data from wrong header, this caused TSO packets have wrong IP csum.
Signed-off-by Dmitry Kravkov <[email protected]>Signed-off-by Ariel Elior <[email protected]>Signed-off-by Eilon Greenstein <[email protected]>--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +0
-0drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c static u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb) · line 3201
Quoted 5 lines
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +1
-1@@ -3198,11 +3198,11 @@ static u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb) rc |=XMIT_CSUM_TCP ;if (skb_is_gso_v6 (skb)) { - rc |= (XMIT_GSO_V6 |XMIT_CSUM_TCP |XMIT_CSUM_V6 ); + rc |= (XMIT_GSO_V6 |XMIT_CSUM_TCP );Maybe it's time to drop the useless ()?
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c static u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb) · line 3205
Quoted 5 lines
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +1
-1if (rc &XMIT_CSUM_ENC ) rc |=XMIT_GSO_ENC_V6 ; }else if (skb_is_gso (skb)) { - rc |= (XMIT_GSO_V4 |XMIT_CSUM_V4 |XMIT_CSUM_TCP ); + rc |= (XMIT_GSO_V4 |XMIT_CSUM_TCP );Oh, here as well...
Quoted 2 lines
WBR, Sergei
Net tree is not proper place for pure beautification - this can be done in net-next after this functional change is merged there
From: "Dmitry Kravkov" <[email protected]>
Date: Mon, 3 Jun 2013 12:28:41 +0300
Quoted 6 lines
FW was initialized with data from wrong header, this caused TSO packets have wrong IP csum.
Signed-off-by Dmitry Kravkov <[email protected]>Signed-off-by Ariel Elior <[email protected]>Signed-off-by Eilon Greenstein <[email protected]>
Applied, thanks.