NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/34799: IP Filter does not work correctly with gem(4) when hardware chec



The following reply was made to PR kern/34799; it has been noted by GNATS.

From: "David H. Gutteridge" <dhgutteridge%sympatico.ca@localhost>
To: jdc%coris.org.uk@localhost, gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/34799: IP Filter does not work correctly with gem(4) when 
hardware chec
Date: Mon, 28 Jan 2008 20:59:53 -0500

 >Two perfectly fine TCP packets.  I had a chance to look at this again (it's
 >bugging me that I can't reproduce it).  I'm fairly sure that ipfilter is
 >correct here and that the hardware checksum is not correct.  However, I'm
 >not sure why this is only picked up by ipf.  Also, for some reason, the ipf
 >check must not be enabled on sparc64 (I didn't immediately spot why).
 >
 >I starting instrumenting the receive checksum code, and I see that the
 >bytes that are meant to contain the checksum always contain a value related
 >to the packet length and the remote IP address.  For example:
 >
 >      IP              csum - length
 >      81.2.110.35     7e36
 >      81.2.110.36     7e37
 >       ...
 >      81.2.110.47     7e42
 >
 >      204.152.190.12  49b6
 >      204.152.190.13  49b7
 >
 >If you try the attached patch (which prints out the received packet flags
 >from the hardware), I imagine that you will see a constant for each site
 >you connect to.  (It will print a line on the console for each TCP packet
 >received when tcp4csum_rx is enabled.)
 >
 >So, either receive checksums are always broken (seems odd to me), or we
 >are setting up the card incorrectly.   I'll see if I can spot where.
 >
 >Thanks,
 >
 >J
 >
 >PS.  The patch is against -current, but it should apply against 4.0 with an
 >offset.
 
 I built a -current kernel and tested, a sample result set is below:
 
 Jan 28 20:30:51 arcusv /netbsd: gem0: rxstat = 0x000000000042aa25: len=  66 
 (042); csum=aa25; c - l=a9e3
 Jan 28 20:30:52 arcusv ipmon[179]: 20:30:51.823636 gem0 @0:2 b 
 py-in-f104.google.com[64.233.167.104],http -> 
 arcusv.nonus-porta.net[192.168.1.5],65534 PR tcp len 20 52 -AS IN bad
 Jan 28 20:31:03 arcusv /netbsd: gem0: rxstat = 0x00000000004e4c85: len=  78 
 (04e); csum=4c85; c - l=4c37
 Jan 28 20:31:04 arcusv ipmon[179]: 20:31:03.167841 gem0 @0:2 b 
 www.netbsd.org[204.152.190.12],http -> 
 arcusv.nonus-porta.net[192.168.1.5],65532 PR tcp len 20 64 -AS IN bad
 Jan 28 20:31:20 arcusv /netbsd: gem0: rxstat = 0x0000000000429155: len=  66 
 (042); csum=9155; c - l=9113
 Jan 28 20:31:20 arcusv ipmon[179]: 20:31:20.356135 gem0 @0:2 b 
 96.f6.ead8.static.theplanet.com[216.234.246.150],telnet -> 
 arcusv.nonus-porta.net[192.168.1.5],65531 PR tcp len 20 52 -AS IN bad
 Jan 28 20:31:53 arcusv /netbsd: gem0: rxstat = 0x0000000000429913: len=  66 
 (042); csum=9913; c - l=98d1
 Jan 28 20:31:55 arcusv ipmon[179]: 20:31:53.680198 gem0 @0:2 b 
 81.52.134.11,http -> arcusv.nonus-porta.net[192.168.1.5],65530 PR tcp len 20 
 52 -AS IN bad
 Jan 28 20:31:57 arcusv ipmon[179]: 20:31:56.954812 gem0 @0:2 b 
 81.52.134.11,http -> arcusv.nonus-porta.net[192.168.1.5],65530 PR tcp len 20 
 52 -AS IN bad
 Jan 28 20:32:00 arcusv ipmon[179]: 20:31:59.681054 gem0 @0:2 b 
 81.52.134.11,http -> arcusv.nonus-porta.net[192.168.1.5],65530 PR tcp len 20 
 52 -AS IN bad
 Jan 28 20:32:03 arcusv ipmon[179]: 20:32:02.952896 gem0 @0:2 b 
 81.52.134.11,http -> arcusv.nonus-porta.net[192.168.1.5],65530 PR tcp len 20 
 52 -AS IN bad
 Jan 28 20:32:15 arcusv ipmon[179]: 20:32:14.950542 gem0 @0:2 b 
 81.52.134.11,http -> arcusv.nonus-porta.net[192.168.1.5],65530 PR tcp len 20 
 52 -AS IN bad
 Jan 28 20:32:39 arcusv last message repeated 5 times
 Jan 28 20:32:39 arcusv ipmon[179]: 20:32:39.146851 gem0 @0:2 b 
 81.52.134.11,http -> arcusv.nonus-porta.net[192.168.1.5],65530 PR tcp len 20 
 52 -AS IN bad
 Jan 28 20:32:46 arcusv /netbsd: gem0: rxstat = 0x00000000004e24b2: len=  78 
 (04e); csum=24b2; c - l=2464
 Jan 28 20:32:46 arcusv ipmon[179]: 20:32:46.552125 gem0 @0:2 b 
 pyry.gw.com[204.80.150.129],http -> 
 arcusv.nonus-porta.net[192.168.1.5],65529 PR tcp len 20 64 -AS IN bad
 Jan 28 20:33:27 arcusv /netbsd: gem0: rxstat = 0x0000000000429913: len=  66 
 (042); csum=9913; c - l=98d1
 Jan 28 20:33:27 arcusv ipmon[179]: 20:33:27.338335 gem0 @0:2 b 
 81.52.134.11,http -> arcusv.nonus-porta.net[192.168.1.5],65530 PR tcp len 20 
 52 -AS IN bad
 
 Regards,
 
 Dave
 
 



Home | Main Index | Thread Index | Old Index