From: Eric Biggers <ebiggers@kernel.org>
To: Mustafa Ismail <mustafa.ismail@intel.com>,
Tatyana Nikolova <tatyana.e.nikolova@intel.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
linux-rdma@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] RDMA/irdma: switch to using the crc32c library
Date: Thu, 6 Feb 2025 19:57:50 -0800 [thread overview]
Message-ID: <20250207035750.GA43210@sol.localdomain> (raw)
In-Reply-To: <20250207033643.59904-1-ebiggers@kernel.org>
On Thu, Feb 06, 2025 at 07:36:43PM -0800, Eric Biggers wrote:
> +int irdma_ieq_check_mpacrc(const void *addr, u32 len, u32 val)
> {
> - u32 crc = 0;
> -
> - crypto_shash_digest(desc, addr, len, (u8 *)&crc);
> - if (crc != val)
> + if (~crc32c(~0, addr, len) != val)
> return -EINVAL;
>
> return 0;
> }
Sorry, I just realized this isn't actually equivalent on big endian CPUs, since
the byte array produced by crypto_shash_digest() used little endian byte order,
whereas crc32c() just returns a CPU endian value.
And of course this broken subsystem uses u32 for the little endian values
instead of __le32 like the result of the kernel.
Not sure it's worth my time to continue to try to fix this subsystem properly.
- Eric
next prev parent reply other threads:[~2025-02-07 3:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 3:36 [PATCH v2] RDMA/irdma: switch to using the crc32c library Eric Biggers
2025-02-07 3:57 ` Eric Biggers [this message]
2025-02-09 9:12 ` Leon Romanovsky
2025-02-09 15:44 ` Eric Biggers
2025-02-10 18:00 ` Eric Biggers
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=20250207035750.GA43210@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mustafa.ismail@intel.com \
--cc=tatyana.e.nikolova@intel.com \
/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