Subject: IP Header CRC problems

From: "Pieter Truter" <[email-masked]>
Date: Tue, 9 May 2000 11:45:42 -0700

I have ported ARM-Linux to a SA-1110 based board with 16M ram & 16M falsh with a Crystal network chip.

I used Linux-2.3.99-pre6 and wrote a device driver for the ether chip based on the existing cs89x0 driver.

The problem is that I can ping remote system from my board and the remote system reply to the ping. However, the network stack rejects the IP packet based on a bad IP header CRC claculated with ip_fast_csum() in net/ipv4/ip_input.c.

If I compare the packet on the wire against what I pass up the IP stack, it looks the same.

So it appears that my network device driver works OK. I am tracing through the network code to find the problem, but I cannot imagine that I am the first/only person using the network on an ARM system.

The weird part is that I receive & send all ARP packets perfectly.

I would appreciete any help.

Thanks.

Here is a few screens:
=================

Starting kernel at address c0008000...
Uncompre ............................... done, bLinux version 2.3.99-pre3-rmk3-np2 
(ptruter@testlinux) (gcc version 2.95.2 19991024 (release)) #186 Tue May 9 09:51:13 PDT 2000
Architecture: Intrinsyc Surfboard
On node 0 totalpages: 2048
zone(0): 2048 pages.
zone(1): 0 pages.
zone(2): 0 pages.
On node 1 totalpages: 2048
zone(0): 2048 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Calibrating delay loop... 180.22 BogoMIPS
Memory: 8MB 8MB = 16MB total
Memory: 12852KB available (888K code, 442K data, 8K init)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.3
Based upon Swansea University Computer Society NET3.039
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 1024 bind 1024)
Starting kswapd v1.6
SA1100 serial driver version 1.2
ttyS0 on SA1100 UART3 (irq 17)
ttyS1 on SA1100 UART1 (irq 15)
pty: 256 Unix98 ptys configured
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
cerf89x0:cerf89x0_probe()
cerf89x0.c: (kernel 2.3.99) Russell Nelson, Andrew Morton
eth0: cs8900 rev I found at 0xd8000300 , IRQ 11, programmed I/O, MAC 00:d0:ca:f1:ff:2f
RAMDISK: Compressed image found at block 0
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 8k init

Linux login:

Some Network Screens:
=================
[root@Linux /root]$ ifconfig
eth0    Link encap:Ethernet  HWaddr 00:D0:CA:F1:FF:2F
          inet addr:192.168.0.232  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          Interrupt:11 Base address:0x300

[root@Linux /root]$ arp -av
? (192.168.0.25) at 00:10:4B:33:83:36 [ether] on eth0
Entries: 1      Skipped: 0      Found: 1

---

From: Stuart Adams <[email-masked]>
Date: Tue, 09 May 2000 15:49:50 -0400

> The problem is that I can ping remote system 
> from my board and the remote system reply to the ping. 
> However, the network stack
> rejects the IP packet based on a bad IP header CRC claculated 
> with ip_fast_csum() in net/ipv4/ip_input.c.

 Had the same problem and as I remember it was because
 ip_fast_csum() assumes that the ip header is aligned on
 a 4 byte boundary but my packets were aligned on a 2 byte
 boundary.

-- Stuart

------------------------------------- 

Stuart Adams
Bright Star Engineering Inc.
19 Enfield Drive
Andover MA 01810 USA
Tel: +1-978-470-8738
Fax: +1-978-470-8878
Email: [email-masked]
Web: http://www.brightstareng.com/

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]
++        Please use [email-masked] for           ++
++                        kernel-related discussions.                      ++

---

From: Nicolas Pitre <[email-masked]>
Date: Tue, 9 May 2000 16:17:22 -0400 (EDT)

Beware odd-length packets...

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Tue, 9 May 2000 23:22:13 +0100 (BST)

Pieter Truter writes:
> The problem is that I can ping remote system from my board and the
> remote system reply to the ping. However, the network stack rejects the
> IP packet based on a bad IP header CRC claculated with ip_fast_csum() in
> net/ipv4/ip_input.c.

Can you provide statistics and a packet dump of an incorrect packet please?

> So it appears that my network device driver works OK. I am tracing =
> through the network code to find the problem, but I cannot imagine that =
> I am the first/only person using the network on an ARM system.

No you are not, and I don't see any problems here with IP header checksums:

sturm, my 2.3.99-pre6 test box:
uname -a
Linux sturm 2.3.99-pre6 #735 Sat May 6 13:56:28 BST 2000 armv4l unknown

uptime:
 11:18pm  up 2 days,  9:47,  1 user,  load average: 0.00, 0.00, 0.00

/proc/net/snmp:
Forwarding		2
DefaultTTL		64
InReceives		85980
InHdrErrors		0
InAddrErrors		0
ForwDatagrams		0
InUnknownProtos		0
InDiscards		0
InDelivers		81768
OutRequests		72176
OutDiscards		0
OutNoRoutes		0
ReasmTimeout		0
ReasmReqds		83
ReasmOKs		29
ReasmFails		0
FragOKs			0
FragFails		0
FragCreates		1081

This machine has been talking (NFS) to other ARM Linux based machines,
as well as an x86 Linux laptop, and the net without problems.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |            http://www.arm.linux.org.uk/            /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |