netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Chan" <mchan@broadcom.com>
To: "Herbert Xu" <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [3/5] [NET]: Add software TSOv4
Date: Fri, 23 Jun 2006 14:26:16 -0700	[thread overview]
Message-ID: <1151097976.6498.7.camel@rh4> (raw)
In-Reply-To: <1151091230.6498.4.camel@rh4>

On Fri, 2006-06-23 at 12:33 -0700, Michael Chan wrote:
> On Thu, 2006-06-22 at 18:14 +1000, Herbert Xu wrote:
> > [NET]: Add software TSOv4
> > 
> > This patch adds the GSO implementation for IPv4 TCP.
> 
> Herbert, Looks like there were some problems in the CHECKSUM_HW case.
> This patch should fix it.  Please double-check my checksum math.

This patch is more correct.  Please ignore the previous one.

[NET]: Fix CHECKSUM_HW GSO problems.

Fix checksum problems in the GSO code path for CHECKSUM_HW packets.

The ipv4 TCP pseudo header checksum has to be adjusted for GSO
segmented packets.

Signed-off-by: Michael Chan <mchan@broadcom.com>


diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 0e029c4..b9c37f1 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2186,7 +2186,8 @@ struct sk_buff *tcp_tso_segment(struct s
 		if (skb->ip_summed == CHECKSUM_NONE) {
 			th->check = csum_fold(csum_partial(
 				skb->h.raw, thlen, csum_add(skb->csum, delta)));
-		}
+		} else if (skb->ip_summed == CHECKSUM_HW)
+			th->check = ~csum_fold(csum_add(th->check, delta));
 
 		seq += len;
 		skb = skb->next;
@@ -2200,6 +2201,10 @@ struct sk_buff *tcp_tso_segment(struct s
 		delta = csum_add(oldlen, htonl(skb->tail - skb->h.raw));
 		th->check = csum_fold(csum_partial(
 			skb->h.raw, thlen, csum_add(skb->csum, delta)));
+	} else if (skb->ip_summed == CHECKSUM_HW) {
+		delta = csum_add(oldlen, htonl(skb->len -
+					       (skb->h.raw - skb->data)));
+		th->check = ~csum_fold(csum_add(th->check, delta));
 	}
 
 out:



  reply	other threads:[~2006-06-23 21:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-22  8:12 [0/5] GSO: Generic Segmentation Offload Herbert Xu
2006-06-22  8:12 ` [1/5] [NET]: Merge TSO/UFO fields in sk_buff Herbert Xu
2006-06-22  8:13 ` [2/5] [NET]: Add generic segmentation offload Herbert Xu
2006-06-22  8:14 ` [3/5] [NET]: Add software TSOv4 Herbert Xu
2006-06-22  8:23   ` Herbert Xu
2006-06-22 15:04   ` YOSHIFUJI Hideaki / 吉藤英明
2006-06-22 21:32     ` David Miller
2006-06-24  0:28       ` Ravinandan Arakali
2006-06-24  1:32         ` YOSHIFUJI Hideaki / 吉藤英明
2006-06-26 18:33           ` Ravinandan Arakali
2006-06-23 19:33   ` Michael Chan
2006-06-23 21:26     ` Michael Chan [this message]
2006-06-23 23:38       ` Herbert Xu
2006-06-23 23:53         ` Herbert Xu
2006-06-24  3:08           ` Michael Chan
2006-06-26  6:55             ` David Miller
2006-06-22  8:14 ` [4/5] [NET]: Added GSO toggle Herbert Xu
2006-06-22  8:14 ` [5/5] [IPSEC]: Handle GSO packets Herbert Xu
2006-06-22  8:15 ` [0/5] GSO: Generic Segmentation Offload Herbert Xu
2006-06-22 10:08 ` David Miller
2006-06-22 14:28 ` YOSHIFUJI Hideaki / 吉藤英明
2006-06-24  5:36   ` Herbert Xu
  -- strict thread matches above, loose matches on Subject: below --
2006-06-20  9:09 Herbert Xu
2006-06-20  9:29 ` [3/5] [NET]: Add software TSOv4 Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1151097976.6498.7.camel@rh4 \
    --to=mchan@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).