From owner-freebsd-arch@FreeBSD.ORG Wed Jun 2 21:05:46 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 224B3106564A for ; Wed, 2 Jun 2010 21:05:46 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from lakerest.net (unknown [IPv6:2001:240:585:2:213:d4ff:fef3:2d8d]) by mx1.freebsd.org (Postfix) with ESMTP id A34CF8FC1B for ; Wed, 2 Jun 2010 21:05:45 +0000 (UTC) Received: from [32.177.119.120] ([32.177.119.120]) (authenticated bits=0) by lakerest.net (8.14.3/8.14.3) with ESMTP id o52L5XTQ077005 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 2 Jun 2010 17:05:42 -0400 (EDT) (envelope-from rrs@lakerest.net) DKIM-Signature: a=rsa-sha1; c=simple/simple; d=lakerest.net; s=mail; t=1275512744; h=Cc:Message-Id:From:To:In-Reply-To:Content-Type: Content-Transfer-Encoding:Mime-Version:Subject:Date:References: X-Mailer; b=0TOIpF/1fOgTuKMbikh4kNZ9X3E2wqSWwDzlXJCXWYZlB90J8qw5VFO nQycFlSlIA34A3UY6/fVAdOpa8XwJZw== Message-Id: <272EEDDB-D5B1-4F73-A959-0A5554634DB2@lakerest.net> From: Randall Stewart To: Poul-Henning Kamp In-Reply-To: <72207.1274805432@critter.freebsd.dk> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Wed, 2 Jun 2010 17:05:24 -0400 References: <72207.1274805432@critter.freebsd.dk> X-Mailer: Apple Mail (2.936) Cc: freebsd-arch@freebsd.org, Matthew Fleming Subject: Re: crc32 table X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 21:05:46 -0000 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)