From: Paul Mackerras <paulus@cs.anu.edu.au>
To: Geert.Uytterhoeven@cs.kuleuven.ac.be
Cc: davem@dm.cobaltmicro.com, linuxppc-dev@lists.linuxppc.org,
VANDROVE@vc.cvut.cz
Subject: Re: TCPv4 checksum errors
Date: Thu, 24 Dec 1998 14:57:53 +1100 [thread overview]
Message-ID: <199812240357.OAA06229@tango.anu.edu.au> (raw)
In-Reply-To: <Pine.LNX.4.03.9812231013310.18310-100000@mercator.cs.kuleuven.ac.be> (message from Geert Uytterhoeven on Wed, 23 Dec 1998 10:14:44 +0100 (CET))
Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be> wrote:
> In the mean time I got this from a `new' PPC hacker. I haven't tried it yet
> (still have to manually calculate checksums for my bad packets, too, sigh).
> diff -ur linux/include/asm-ppc/checksum.h linux/include/asm-ppc/checksum.h
> --- linux/include/asm-ppc/checksum.h Thu Apr 23 02:35:41 1998
> +++ linux/include/asm-ppc/checksum.h Tue Dec 22 16:19:49 1998
> @@ -83,13 +83,13 @@
> unsigned int sum)
> {
> __asm__("
> - add %0,%0,%1
> - add %0,%0,%2
> - add %0,%0,%0
> - addi %0,%0,0
> + addc %0,%0,%1
> + adde %0,%0,%2
> + adde %0,%0,%3
> + addze %0,%0
> "
> : "=r" (sum)
> - : "r" (daddr), "r"(saddr), "r"((ntohs(len)<<16)+proto*256), "0"(sum));
> + : "r" (daddr), "r"(saddr), "r"((proto<<16)+len), "0"(sum));
> return sum;
> }
Aargh, I checked arch/ppc/lib/checksum.S thoroughly but I missed this
one! Of course it needs to be addc/adde/adde/addze. Kudos to Petr
Vandrovec (good spotting, as Linus would say).
Paul.
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request@lists.linuxppc.org ]]
prev parent reply other threads:[~1998-12-24 3:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-12-21 21:49 TCPv4 checksum errors Geert Uytterhoeven
1998-12-22 3:07 ` Paul Mackerras
1998-12-22 7:21 ` Martin Costabel
1998-12-22 9:21 ` Geert Uytterhoeven
1998-12-22 9:35 ` David S. Miller
1998-12-22 10:01 ` Geert Uytterhoeven
1998-12-22 10:11 ` David S. Miller
1998-12-22 10:38 ` Geert Uytterhoeven
1998-12-22 10:13 ` Arno Griffioen
1998-12-23 9:14 ` Geert Uytterhoeven
1998-12-23 13:23 ` Gabriel Paubert
1998-12-23 21:58 ` Alan Cox
1998-12-24 7:36 ` David S. Miller
1998-12-28 9:20 ` Andreas Schwab
1998-12-28 13:04 ` Alan Cox
1998-12-28 13:12 ` Andreas Schwab
1998-12-24 3:57 ` Paul Mackerras [this message]
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=199812240357.OAA06229@tango.anu.edu.au \
--to=paulus@cs.anu.edu.au \
--cc=Geert.Uytterhoeven@cs.kuleuven.ac.be \
--cc=Paul.Mackerras@cs.anu.edu.au \
--cc=VANDROVE@vc.cvut.cz \
--cc=davem@dm.cobaltmicro.com \
--cc=linuxppc-dev@lists.linuxppc.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).