From: Clay Haapala <chaapala@cisco.com>
To: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: James Morris <jmorris@redhat.com>,
"David S. Miller" <davem@redhat.com>,
<linux-kernel@vger.kernel.org>, <Matt_Domsch@dell.com>
Subject: Re: [PATCH] lib/libcrc32c
Date: Wed, 31 Mar 2004 09:28:38 -0600 [thread overview]
Message-ID: <yqujhdw5jas9.fsf@chaapala-lnx2.cisco.com> (raw)
In-Reply-To: <200403302149.59364.bzolnier@elka.pw.edu.pl> (Bartlomiej Zolnierkiewicz's message of "Tue, 30 Mar 2004 21:49:59 +0200")
On Tue, 30 Mar 2004, Bartlomiej Zolnierkiewicz told this:
> On Tuesday 30 of March 2004 21:11, Clay Haapala wrote:
>> On Tue, 30 Mar 2004, Bartlomiej Zolnierkiewicz outgrape:
>> > +
>> > +static u32 crc32c_table[256] = {
>> >
>> > Tables are build time generated in case of CRC32
>> > (lib/gen_crc32table.c) so you can trade some performance for
>> > smaller size of the table.
>> >
>> > [ However I don't know how useful is this. ]
>>
>> As the table was statically in code in sctp and in the iSCSI driver
>> where it originally came from, I left it that way. Why would the
>> table be of a different size?
>
> See lib/crc32defs.h and lib/gen_crc32table.c.
>
> lib/crc32defs.h:
>
> /* How many bits at a time to use. Requires a table of
> 4<<CRC_xx_BITS bytes. */ /* For less performance-sensitive, use 4 */
> #ifndef CRC_LE_BITS # define CRC_LE_BITS 8 #endif #ifndef
> CRC_BE_BITS # define CRC_BE_BITS 8 #endif
>
> lib/gen_crc32table.c:
>
> #define LE_TABLE_SIZE (1 << CRC_LE_BITS)
> #define BE_TABLE_SIZE (1 << CRC_BE_BITS)
>
> static u_int32_t crc32table_le[LE_TABLE_SIZE];
> static u_int32_t crc32table_be[BE_TABLE_SIZE];
>
>
This is a legitimate question.
The immediate user of this crc32c is the iscsi-sfnet driver, and my
mind-set for that is always towards gigabit-ethernet wire-rate, so
that bias may prevent me from making the right choice here.
Regarding performance vs. size, we have the BITS == 8 table for "high"
performance and bigger size, and BITS == 1 bit-wise computation, for the
least size, albeit slower performance. Is that good enough?
The last time I wrote CRC lookup code for nibble-sized tables, it was
for an 8051 microcontroller. :-)
--
Clay Haapala (chaapala@cisco.com) Cisco Systems SRBU +1 763-398-1056
6450 Wedgwood Rd, Suite 130 Maple Grove MN 55311 PGP: C89240AD
Dyslexia meets Concealed Carry laws:
"Microsoft bans gnus on these premises"
next prev parent reply other threads:[~2004-03-31 15:59 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-06 18:46 Crypto API and keyed non-HMAC digest algorithms / Michael MIC Jouni Malinen
2004-03-08 14:45 ` James Morris
2004-03-09 3:37 ` Jouni Malinen
2004-03-09 5:55 ` James Morris
2004-03-09 17:30 ` Clay Haapala
2004-03-09 20:32 ` James Morris
2004-03-10 3:40 ` Jouni Malinen
2004-03-10 4:02 ` [PATCH] Crypto API and " Jouni Malinen
2004-03-10 4:21 ` Crypto API and keyed non-HMAC digest algorithms / " James Morris
2004-03-10 5:34 ` Jouni Malinen
2004-03-10 15:45 ` James Morris
2004-03-11 3:00 ` Jouni Malinen
2004-03-11 4:06 ` James Morris
2004-03-11 6:08 ` Jouni Malinen
2004-03-11 16:34 ` Clay Haapala
2004-03-11 20:14 ` James Morris
2004-03-18 23:05 ` Clay Haapala
2004-03-21 15:08 ` James Morris
2004-03-22 16:49 ` [PATCH] lib/libcrc32c implementation Clay Haapala
2004-03-22 17:00 ` Jeff Garzik
2004-03-22 17:27 ` Clay Haapala
2004-03-22 17:36 ` Jeff Garzik
2004-03-26 16:36 ` James Morris
2004-03-26 16:59 ` Clay Haapala
2004-03-26 18:16 ` James Morris
2004-03-30 17:32 ` [PATCH] lib/libcrc32c Clay Haapala
2004-03-30 18:43 ` Bartlomiej Zolnierkiewicz
2004-03-30 19:11 ` Clay Haapala
2004-03-30 19:23 ` Matt Domsch
2004-03-30 19:33 ` Clay Haapala
2004-03-31 21:03 ` [PATCH] lib/libcrc32c, revised 040331 Clay Haapala
2004-04-19 21:37 ` [PATCH] lib/libcrc32c, revised 040419 Clay Haapala
2004-04-23 23:42 ` David S. Miller
2004-04-27 19:46 ` [PATCH] lib/libcrc32c, revised 040427 Clay Haapala
2004-04-27 19:49 ` David S. Miller
2004-04-27 20:00 ` Clay Haapala
2004-04-27 21:49 ` Clay Haapala
2004-04-27 21:50 ` David S. Miller
2004-04-28 15:14 ` [PATCH] lib/libcrc32c, revised 040428, with compiler.h included Clay Haapala
2004-04-28 19:29 ` David S. Miller
2004-04-27 19:55 ` [PATCH] lib/crc32.c: to use compiler.h defines Clay Haapala
2004-04-28 15:19 ` [PATCH] lib/crc32.c: uses (and includes) compiler.h Clay Haapala
2004-04-28 19:30 ` David S. Miller
2004-03-30 19:49 ` [PATCH] lib/libcrc32c Bartlomiej Zolnierkiewicz
2004-03-31 15:28 ` Clay Haapala [this message]
2004-03-30 17:40 ` [PATCH] crypto/crc32c implementation Clay Haapala
2004-04-19 21:31 ` [PATCH] crypto/crc32c implementation, updated 040419 Clay Haapala
2004-04-19 23:36 ` David S. Miller
2004-04-20 13:20 ` James Morris
2004-03-22 16:56 ` [PATCH] crypto/crc32c support Clay Haapala
2004-03-11 6:11 ` Crypto API and keyed non-HMAC digest algorithms / Michael MIC Jouni Malinen
2004-03-10 16:04 ` Clay Haapala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yqujhdw5jas9.fsf@chaapala-lnx2.cisco.com \
--to=chaapala@cisco.com \
--cc=B.Zolnierkiewicz@elka.pw.edu.pl \
--cc=Matt_Domsch@dell.com \
--cc=davem@redhat.com \
--cc=jmorris@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®