TCPv4 checksum errors

Geert Uytterhoeven Geert.Uytterhoeven at cs.kuleuven.ac.be
Wed Dec 23 20:14:44 EST 1998


On Tue, 22 Dec 1998, David S. Miller wrote:
>    Date: Tue, 22 Dec 1998 10:21:58 +0100 (CET)
>    From: Geert Uytterhoeven <Geert.Uytterhoeven at cs.kuleuven.ac.be>
> 
>    > of a specific packet with a bad checksum generated by Linux/PPC?
> 
>    cassandra kernel: TCPv4 bad checksum from 10.0.24.8:03ff to 10.0.24.4:0201, len=20/20/40
> 
>    (10.0.24.8 is CHRP, 10.0.24.4 is Amiga)
> 
> My suggestion is that since you can reproduce it, you should add code
> next to this printk statement which dumps the entire packet in HEX to
> the console.  Then you can see what and who is at fault and where.
> If the packet is sufficiently small you can walk the checksum
> algorithm by hand and verify it for this test case.

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

--------------------------------------------------------------------------------
>From VANDROVE at vc.cvut.cz Wed Dec 23 10:11:44 1998
Date: Tue, 22 Dec 1998 16:44:01 MET-1
From: Petr Vandrovec Ing. VTEI <VANDROVE at vc.cvut.cz>
To: Geert Uytterhoeven <Geert.Uytterhoeven at cs.kuleuven.ac.be>
Subject: PPC checksumming...

Hello Geert,
  I've found that Motorola Powerstack is much more happy after
applying folowing patch:

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


Before applying, I've got TCPv4 bad checksum instead of Connection refused,
now it works :-) and I finnaly found that on my PPC inetd was not started...
But because of I'm learning PPC assembler only since today morning, I'm not
sure whether it does what I think it should... If you find it useful,
please post it to appropriate maintainer (DaveM or ... ?) I do not know,
who invented original code, maybe Cort (according to comments around code),
but it was not taken from linux/include/asm-sparc - I'm pretty sure :-)

With regards to matroxfb: I've found that PPC Bios did not assign addresses
to Matrox : framebuffer was located at 0xFF800000, MMIO at FFFFC000,
both overlapping itself :-( Unfortunately, after going through PREP PCI code
they were relocated to 0x01800000 and 0x01FFC000 - still overlapping, but
now values looks `normal' :-( And, it is worse, it looks like that
only region 0x01000000 - 0x01FFFFFF is forwarded into PCI bus, so there
is really resource starvation here... One 8MB framebuffer, 16KB MMIO,
some MMIO of NCR825... Life is not simple.
                                                                    Petr
--------------------------------------------------------------------------------

Greetings,

						Geert

--
Geert Uytterhoeven                     Geert.Uytterhoeven at cs.kuleuven.ac.be
Wavelets, Linux/{m68k~Amiga,PPC~CHRP}  http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium


[[ 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 at lists.linuxppc.org ]]




More information about the Linuxppc-dev mailing list