Re: [PATCH] lib/libcrc32c

From: Bartlomiej Zolnierkiewicz
Date: Tue Mar 30 2004 - 19:32:46 EST


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];


Regards,
Bartlomiej

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/