netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Aubrey <aubreylee@gmail.com>, Herbert Xu <herbert@gondor.apana.org.au>
Cc: netdev@vger.kernel.org
Subject: Re: Netpoll checksum issue
Date: Wed, 19 Apr 2006 10:31:53 -0700	[thread overview]
Message-ID: <20060419103153.64ef0054@localhost.localdomain> (raw)
In-Reply-To: <6d6a94c50604190922m189b9d99gdd428a870e12c2c3@mail.gmail.com>

The changes to how hardware receive checksums are handled broke
the netpoll checksum code (for CHECKSUM_HW).  Since this is not at
all performance critical, try this patch. It changes to always to
normal software checksum.

--- linux-2.6.orig/net/core/netpoll.c	2006-03-22 09:30:56.000000000 -0800
+++ linux-2.6/net/core/netpoll.c	2006-04-19 10:30:13.000000000 -0700
@@ -102,20 +102,11 @@
 static int checksum_udp(struct sk_buff *skb, struct udphdr *uh,
 			     unsigned short ulen, u32 saddr, u32 daddr)
 {
-	unsigned int psum;
-
 	if (uh->check == 0 || skb->ip_summed == CHECKSUM_UNNECESSARY)
 		return 0;
 
-	psum = csum_tcpudp_nofold(saddr, daddr, ulen, IPPROTO_UDP, 0);
-
-	if (skb->ip_summed == CHECKSUM_HW &&
-	    !(u16)csum_fold(csum_add(psum, skb->csum)))
-		return 0;
-
-	skb->csum = psum;
-
-	return __skb_checksum_complete(skb);
+	skb->csum = csum_tcpudp_nofold(saddr, daddr, ulen, IPPROTO_UDP, 0);
+	return (u16) csum_fold(skb_checksum(skb, 0, skb->len, skb->csum));
 }
 
 /*

       reply	other threads:[~2006-04-19 17:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6d6a94c50604190922m189b9d99gdd428a870e12c2c3@mail.gmail.com>
2006-04-19 17:31 ` Stephen Hemminger [this message]
2006-04-19 21:33   ` Netpoll checksum issue Herbert Xu
2006-04-20  1:54   ` Aubrey
2006-04-23 11:34     ` Herbert Xu
2006-04-24  5:42       ` Aubrey
2006-04-24  7:46         ` Aubrey
2006-04-24  8:04           ` Aubrey
2006-04-24 10:22         ` Herbert Xu
2006-04-24 13:22           ` Aubrey
2006-04-27 12:57             ` Aubrey
2006-04-27 21:29               ` 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=20060419103153.64ef0054@localhost.localdomain \
    --to=shemminger@osdl.org \
    --cc=aubreylee@gmail.com \
    --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).