John Nemeth | 1 Aug 2007 10:19
Picon
Favicon

Re: hardware checksum busted for Sun NICs

On Dec 21,  4:40am, "Garrett D'Amore" wrote:
} 
} I've been working on Solaris, and recently added hardware checksum to
} hme.  In the course of this, it became known to me that NetBSD's hme
} driver suffers from a flaw (same as mine) involving hardware checksum
} (tx side) with tiny packets.  The checksum code is busted for packets
} less than 64-bytes in length, due to a limitation in the controller.

     When you say "packets less than 64-bytes in length," what parts of
the packet are you counting?  Ethernet packets must be a minimum of
64-bytes in length including the MAC header and FCS.

} Someone might want to look into falling back to software checksum if the
} packet to be sent is less than 64-bytes on hme hardware.
} 
} Another problem, and this probably occurs with all Sun NICs (hme, gem,
} etc.) is that partial checksum doesn't consider UDP vs TCP semantics
} when the checksum calculation returns a zero value.
} 
} The RFC for UDP says that in this case 0xffff should be substituted for
} the 0 value checksum.  For TCP the original zero is passed unmodified
} (passing 0xffff is toxic to some TCP implementations.)

     Hmm, if you consider this to be important then you can't do
hardware checksum.  The other option is to simply ignore it since a UDP
checksum of 0x0000 won't (generally) cause bad things to happen.  Or,
are you saying that the NIC will send 0xffff for both UDP and TCP
packets?

} I'm not sure what we are going to do about this in Solaris land right
(Continue reading)

Izumi Tsutsui | 1 Aug 2007 13:41
Picon
Gravatar

Re: hardware checksum busted for Sun NICs

jnemeth <at> victoria.tc.ca wrote:

> } I've been working on Solaris, and recently added hardware checksum to
> } hme.  In the course of this, it became known to me that NetBSD's hme
> } driver suffers from a flaw (same as mine) involving hardware checksum
> } (tx side) with tiny packets.  The checksum code is busted for packets
> } less than 64-bytes in length, due to a limitation in the controller.
> 
>      When you say "packets less than 64-bytes in length," what parts of
> the packet are you counting?  Ethernet packets must be a minimum of
> 64-bytes in length including the MAC header and FCS.

There are several NICs (ex(4), re(4) etc.) which support auto
padding short packets but also have a bug on hwcksum against
short packets which require padding.
Manual padding may work around such hw bugs.
---
Izumi Tsutsui

Izumi Tsutsui | 1 Aug 2007 14:20
Picon
Gravatar

Re: Make vga(4) always install a sane font

jmmv84 <at> gmail.com wrote:

> This seems wrong to me, because it spreads "knowledge" of the problem  
> everywhere and also exposes it to the user by requiring him to add an  
> extra option to his kernels to preserve the "standard behavior".   
> Plus... if vga was an LKM (could it be?), this solution would not be  
> applicable.

I suggest an easier way to handle a minor MD quirk which affects
very few users. If we'd handle it in the "right" way, we have to
investigate actual problems more closely.

I think there are three independent problems:

(1) vga(4) assumes that builtin font is always WSDISPLAY_FONTENC_IBM

I don't know if userland programs refer this encoding value,
but if we possibly have some VGA device which has different
encoding from FONTENC_IBM, we should have some proper hook
(via proplib etc.) to override it.

I'm not sure if it will work even in consinit() since it's
often called before uvm_init(9) where we can't use malloc(9).

(2) vga(4) always uses the default wsfont in vga_no_builtinfont case

When I wrote vga_no_builtinfont code for Express5800/240 (arc),
I didn't make vga(4) use vt220 fonts because the machine
had no fonts in its ROM so any font could be enough.
If we really want to always use VGA-like font for vga(4),
(Continue reading)

der Mouse | 1 Aug 2007 15:18
Picon

Re: hardware checksum busted for Sun NICs

>> Another problem [...] is that partial checksum doesn't consider UDP
>> vs TCP semantics when the checksum calculation returns a zero value.

>> The RFC for UDP says that in this case 0xffff should be substituted
>> for the 0 value checksum.  For TCP the original zero is passed
>> unmodified (passing 0xffff is toxic to some TCP implementations.)

> Hmm, if you consider this to be important then you can't do hardware
> checksum.

...??  You mean there are "hardware" (often really firmware, I daresay)
checksum implementations out there that don't provide the semantics the
IP/UDP/TCP specs call for?

If so, then, well, duh you can't use them!

> The other option is to simply ignore it since a UDP checksum of
> 0x0000 won't (generally) cause bad things to happen.

I don't consider undetected data corruption to not be a "bad thing".
"Presumably this means it is important to get wrong answers quickly."

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse <at> rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Steven M. Bellovin | 1 Aug 2007 16:30

Re: hardware checksum busted for Sun NICs

On Wed, 1 Aug 2007 01:19:54 -0700
jnemeth <at> victoria.tc.ca (John Nemeth) wrote:

> 
>      Hmm, if you consider this to be important then you can't do
> hardware checksum.  The other option is to simply ignore it since a
> UDP checksum of 0x0000 won't (generally) cause bad things to happen.

Except for things like undetected NFS and DNS bad data...

		--Steve Bellovin, http://www.cs.columbia.edu/~smb

Garrett D'Amore | 1 Aug 2007 18:21
Picon

Re: hardware checksum busted for Sun NICs

On Wed, 2007-08-01 at 01:19 -0700, John Nemeth wrote:
> On Dec 21,  4:40am, "Garrett D'Amore" wrote:
> } 
> } I've been working on Solaris, and recently added hardware checksum to
> } hme.  In the course of this, it became known to me that NetBSD's hme
> } driver suffers from a flaw (same as mine) involving hardware checksum
> } (tx side) with tiny packets.  The checksum code is busted for packets
> } less than 64-bytes in length, due to a limitation in the controller.
> 
>      When you say "packets less than 64-bytes in length," what parts of
> the packet are you counting?  Ethernet packets must be a minimum of
> 64-bytes in length including the MAC header and FCS.

I mean the part that does not include the FCS.  And you can give smaller
packets than that to the hardware, and it will pad.  But if you rely on
this, it will not be able to do the checksum.

> 
> } Someone might want to look into falling back to software checksum if the
> } packet to be sent is less than 64-bytes on hme hardware.
> } 
> } Another problem, and this probably occurs with all Sun NICs (hme, gem,
> } etc.) is that partial checksum doesn't consider UDP vs TCP semantics
> } when the checksum calculation returns a zero value.
> } 
> } The RFC for UDP says that in this case 0xffff should be substituted for
> } the 0 value checksum.  For TCP the original zero is passed unmodified
> } (passing 0xffff is toxic to some TCP implementations.)
> 
>      Hmm, if you consider this to be important then you can't do
(Continue reading)

Vincent | 1 Aug 2007 21:54
Picon
Favicon

ath monitor mode does not work with weplab?

Hi there,
I've several problems connecting to an AP at work, so I imagined using 
weplab on my laptop to see what's going on during the attachement phase.

However, weplab refuses to work, because, although I put my ath card 
into monitor mode using ifconfig, the pcap open reports the link to be 
EN10 and not DLT_IEEE80211.

Has anybody ever managed to get raw IEEE 802.11 out of the ath driver?

Thanks,
Vincent

David Young | 1 Aug 2007 23:08
Picon
Favicon

Re: ath monitor mode does not work with weplab?

On Wed, Aug 01, 2007 at 09:54:24PM +0200, Vincent wrote:
> Hi there,
> I've several problems connecting to an AP at work, so I imagined using 
> weplab on my laptop to see what's going on during the attachement phase.
> 
> However, weplab refuses to work, because, although I put my ath card 
> into monitor mode using ifconfig, the pcap open reports the link to be 
> EN10 and not DLT_IEEE80211.

weplab has to set the datalink type (DLT) using pcap_set_datalink(3).
Monitor mode does not set the DLT.

> Has anybody ever managed to get raw IEEE 802.11 out of the ath driver?

Yes.  All the time.  The bug is in weplab.

Dave

--

-- 
David Young             OJC Technologies
dyoung <at> ojctech.com      Urbana, IL * (217) 278-3933 ext 24

Antti Kantee | 2 Aug 2007 20:38
Picon
Picon

importing userspace kernel file system framework

Hi,

As my Google SoC 2007 project, I created a framework for running kernel
file system code in userspace.  The project is now mostly finished,
although some tweaking remains.

Why was this an interesting project?  Now it is possible to do file system
testing and development in an easy environment and try out new ideas
without risking crashing the system.  Once the tests and/or development
is over, the code can be directly dropped back into the kernel and be
run as a kernel file system.  It also permits learning about kernel file
systems much more easily, as single-stepping etcetc. is possible like
with any other user program.

I have run ffs, ntfs, efs, cd9660fs and tmpfs under the system.
Currently tmpfs works the best, as I rewrote a bunch of code to support
it and some polishing with "regular" file systems remains.  However,
all are expected to function mostly flawlessly in the coming days.

Coming to the beef of this mail, to keep the system functional, it
is important to have it compile in a standard build cycle to prevent
bitrotting caused by kernel interface changes.  As the system doesn't
really fit any existing shoe, I suggest creating a new top-level directory
to our source tree.  Currently I call this "sakern" for standalone kernel.
Items in this tree are built against the current kernel sources but
not installed.  Other areas such as support for networking code may be
added here in the future.

Opinions?

(Continue reading)

matthew green | 2 Aug 2007 22:11
Picon
Favicon

re: importing userspace kernel file system framework


this sounds all great.

but please don't create a new top-level dir.  either keep it
in src/sys or put it in src/common somewhere.

thanks,

.mrg.


Gmane