All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] bnx2x: fix TCP offload for tunneling ipv4 over ipv6
@ 2013-06-03  9:28 Dmitry Kravkov
  2013-06-03 11:27 ` Sergei Shtylyov
  2013-06-05  0:00 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Kravkov @ 2013-06-03  9:28 UTC (permalink / raw)
  To: davem, netdev; +Cc: Dmitry Kravkov, Ariel Elior, Eilon Greenstein

FW was initialized with data from wrong header, this caused TSO packets
have wrong IP csum.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index c80f1d2..37c1495 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -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) -
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] bnx2x: fix TCP offload for tunneling ipv4 over ipv6
  2013-06-03  9:28 [PATCH net] bnx2x: fix TCP offload for tunneling ipv4 over ipv6 Dmitry Kravkov
@ 2013-06-03 11:27 ` Sergei Shtylyov
  2013-06-03 11:45   ` Dmitry Kravkov
  2013-06-05  0:00 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2013-06-03 11:27 UTC (permalink / raw)
  To: Dmitry Kravkov; +Cc: davem, netdev, Ariel Elior, Eilon Greenstein

Hello.

On 03-06-2013 13:28, Dmitry Kravkov wrote:

> FW was initialized with data from wrong header, this caused TSO packets
> have wrong IP csum.

> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
> Signed-off-by: Ariel Elior <ariele@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
> ---
>   drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 13 ++++++-------
>   1 file changed, 6 insertions(+), 7 deletions(-)

> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> index c80f1d2..37c1495 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> @@ -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 ()?

>   		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);

    Oh, here as well...

WBR, Sergei

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH net] bnx2x: fix TCP offload for tunneling ipv4 over ipv6
  2013-06-03 11:27 ` Sergei Shtylyov
@ 2013-06-03 11:45   ` Dmitry Kravkov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Kravkov @ 2013-06-03 11:45 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: davem, netdev, Ariel Elior, Eilon Greenstein

> -----Original Message-----
> From: Sergei Shtylyov [mailto:sergei.shtylyov@cogentembedded.com]
> Sent: Monday, June 03, 2013 2:28 PM
> To: Dmitry Kravkov
> Cc: davem@davemloft.net; netdev@vger.kernel.org; Ariel Elior; Eilon Greenstein
> Subject: Re: [PATCH net] bnx2x: fix TCP offload for tunneling ipv4 over ipv6
> 
> Hello.
> 
> On 03-06-2013 13:28, Dmitry Kravkov wrote:
> 
> > FW was initialized with data from wrong header, this caused TSO packets
> > have wrong IP csum.
> 
> > Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
> > Signed-off-by: Ariel Elior <ariele@broadcom.com>
> > Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
> > ---
> >   drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 13 ++++++-------
> >   1 file changed, 6 insertions(+), 7 deletions(-)
> 
> > diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> > index c80f1d2..37c1495 100644
> > --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> > +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> > @@ -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 ()?
> 
> >   		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);
> 
>     Oh, here as well...
> 
> 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


 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] bnx2x: fix TCP offload for tunneling ipv4 over ipv6
  2013-06-03  9:28 [PATCH net] bnx2x: fix TCP offload for tunneling ipv4 over ipv6 Dmitry Kravkov
  2013-06-03 11:27 ` Sergei Shtylyov
@ 2013-06-05  0:00 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2013-06-05  0:00 UTC (permalink / raw)
  To: dmitry; +Cc: netdev, ariele, eilong

From: "Dmitry Kravkov" <dmitry@broadcom.com>
Date: Mon, 3 Jun 2013 12:28:41 +0300

> FW was initialized with data from wrong header, this caused TSO packets
> have wrong IP csum.
> 
> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
> Signed-off-by: Ariel Elior <ariele@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-05  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-03  9:28 [PATCH net] bnx2x: fix TCP offload for tunneling ipv4 over ipv6 Dmitry Kravkov
2013-06-03 11:27 ` Sergei Shtylyov
2013-06-03 11:45   ` Dmitry Kravkov
2013-06-05  0:00 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.