crc32 table

Randall Stewart rrs at lakerest.net
Wed Jun 2 21:05:46 UTC 2010


Poul/Matthew:

We actually have the crc32c code in the kernel. It was of
course in the sctp code at one time, but with the use of
it in the NAT and FW code and the advent of the IGB card with
its crc32c offload functions it has been added to:

libkern/crc32.c

Its called  calculate_crc32c(...)

It uses Intel's slicing 8 algorithm as well so its about
as fast as can be...


For SCTP of course the initial c-sum must be set and the
result (after going through all the mbufs) must be complemented....

But it is there.

The file crc32.c does have a traditional crc32 table.. but it seems
unused except by a commented out function crc32(..)... not sure
if somewhere else (maybe in a driver) that table is used (crc32_tab).


R

On May 25, 2010, at 12:37 PM, Poul-Henning Kamp wrote:

> In message <06D5F9F6F655AD4C92E28B662F7F853E021D4D9D at seaxch09.desktop.isilon.co
> m>, "Matthew Fleming" writes:
>
>> Is there an interest in another crc32 implementation for the kernel =
>> which uses this polynomial and uses the SSE 4.2 instruction when =
>> available?  (This support would require kib's FPU patch).
>
> It would be a better idea to add a kernel facility to build a
> CRC table to a given polynomial.  The code to do this is very
> compact and would take up less space than N CRC tables which are
> likely not used in most running kernels.

Yeah, you can build such a table.. but thats the traditional table  
where as
the slicing 8 algorithm is about 8 times faster...

R


>
> Poul-Henning
>
> -- 
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> phk at FreeBSD.ORG         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by  
> incompetence.
> _______________________________________________
> freebsd-arch at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arch
> To unsubscribe, send any mail to "freebsd-arch- 
> unsubscribe at freebsd.org"
>

------------------------------
Randall Stewart
803-317-4952 (cell)



More information about the freebsd-arch mailing list