[lkml]   [1999]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Kernel checksum routime (>=5)x86 optimization
Kurt Garloff wrote:
> By the way: Is it correct to use adcl in this piece of code???
> Why do we want to add 1 instead of 1<<32 in case of overflow???

Because that's how the TCP checksum works. It's very clever because it
can be written in the same fast way on little-endian and big-endian
machines, and adding 16 bits, 32 bits, 64 bits or even 128 bits at a

May I direct you to the rfc1071 which is all about these things. I

"This simple checksum has a number of wonderful mathematical
properties that may be exploited to speed its calculation, as we
will now discuss."

> That might be the reason, yes.
> it might also be that only one load can be executed per cycle.

That's not true on a Pentium if you pick non-conflicting addresses.
Both instructions in a pair can read from cache.
(I forget the precise rule for conflicting addresses).

-- Jamie

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:51    [W:0.033 / U:1.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site