[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220304150257.GD2824821@dhcp-10-100-145-180.wdc.com>
Date: Fri, 4 Mar 2022 07:02:57 -0800
From: Keith Busch <kbusch@...nel.org>
To: David Laight <David.Laight@...lab.com>
Cc: "linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"axboe@...nel.dk" <axboe@...nel.dk>, "hch@....de" <hch@....de>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
Hannes Reinecke <hare@...e.de>
Subject: Re: [PATCHv4 5/8] lib: add rocksoft model crc64
On Fri, Mar 04, 2022 at 07:53:44AM +0000, David Laight wrote:
>
> That can be speeded up by using the identity:
> table[x ^ y] == table[x] ^ table[y]
>
> something like:
> crc = poly; /* actually crc(1) */
> table[0] = 0;
> table[1] = crc;
> for (i = 2; i < 8; i++) [
> crc = crc & 1 ? (crc >> 1) ^ poly : crc >> 1;
> for (j = 0; j < 1u << i; j++)
> table[j + (1i << i)] = table[j] ^ crc;
> }
>
> I think the same code can be used for a normal MSB first crc
> provided both the polynomial and crc(1) are passed in.
>
> OTOH initialisation speed may not matter.
I don't think speed is an issue here. This part is executed just once
for the initial kernel compile, then never again.
Powered by blists - more mailing lists