RDMA/irdma: Switch to using the crc32c library
authorEric Biggers <ebiggers@google.com>
Fri, 7 Feb 2025 04:08:16 +0000 (20:08 -0800)
committerLeon Romanovsky <leon@kernel.org>
Fri, 14 Feb 2025 06:56:45 +0000 (01:56 -0500)
commit161072d43a8cd2f1e4c9612f7e41d5d070c1d01b
treef1be3217242000b37e70543eb062daa1e97aeae5
parentf26e648a978ae7958e0958095768363c851a736d
RDMA/irdma: Switch to using the crc32c library

Now that the crc32c() library function directly takes advantage of
architecture-specific optimizations, it is unnecessary to go through the
crypto API.  Just use crc32c().  This is much simpler, and it improves
performance due to eliminating the crypto API overhead.

Note that for crc32c the equivalent of crypto_shash_digest() is
cpu_to_le32(~crc32c(~0, ...)), considering that crypto_shash_digest()
had before and inversions as well as a cpu_to_le32() built-in.  This
means that this driver is using u32 for fixed-endian types; this patch
does not try to fix that but rather just keep the exact same behavior.

Link: https://lore.kernel.org/r/20250207033643.59904-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://patch.msgid.link/20250207040816.69163-1-ebiggers@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/irdma/Kconfig
drivers/infiniband/hw/irdma/main.h
drivers/infiniband/hw/irdma/osdep.h
drivers/infiniband/hw/irdma/puda.c
drivers/infiniband/hw/irdma/puda.h
drivers/infiniband/hw/irdma/utils.c