Re: rewrite src/sys/i386/i386/in_cksum.c
- From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 11 Jul 2007 14:07:07 -0700 (PDT)
Here's a reference to the DragonFly code:
http://www.dragonflybsd.org/cvsweb/src/sys/cpu/i386/misc/in_cksum2.s
http://www.dragonflybsd.org/cvsweb/src/sys/netinet/in_cksum.c
It's pretty simple. The core 1's complement checksum is now written
in machine-dependant assembly and ONLY handles multiples of 32 bit
words. In otherwords, no special cases. The mbuf wrapper is written
in machine-independant C, calls the assembly for the bulk of the work,
and handles all the edge cases.
The rewrite is much cleaner and the code documentation is actually
understandable. Plus only a very simple core needs to be written in
assembly and the C wrapper is machine independant, instead of embedding
the assembly with the C and praying the compiler doesn't blow things up.
-Matt
Matthew Dillon
<dillon@xxxxxxxxxxxxx>
_______________________________________________
freebsd-current@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@xxxxxxxxxxx"
- References:
- rewrite src/sys/i386/i386/in_cksum.c
- From: zhouyi zhou
- Re: rewrite src/sys/i386/i386/in_cksum.c
- From: Alexander Leidinger
- Re: rewrite src/sys/i386/i386/in_cksum.c
- From: Zhouyi Zhou
- rewrite src/sys/i386/i386/in_cksum.c
- Prev by Date: Re: bgfsck hosed (lockups) in -current?
- Next by Date: Re: bgfsck hosed (lockups) in -current?
- Previous by thread: Re: rewrite src/sys/i386/i386/in_cksum.c
- Next by thread: CFT: re(4) MSI support
- Index(es):