Date: Wed, 2 Jun 2010 17:05:24 -0400 From: Randall Stewart <rrs@lakerest.net> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: freebsd-arch@freebsd.org, Matthew Fleming <matthew.fleming@isilon.com> Subject: Re: crc32 table Message-ID: <272EEDDB-D5B1-4F73-A959-0A5554634DB2@lakerest.net> In-Reply-To: <72207.1274805432@critter.freebsd.dk> References: <72207.1274805432@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
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@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@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@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch- > unsubscribe@freebsd.org" > ------------------------------ Randall Stewart 803-317-4952 (cell)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?272EEDDB-D5B1-4F73-A959-0A5554634DB2>