[PATCH v2 08/10] net: add skb_copy_and_crc32c_datagram_iter()

Hannes Reinecke hare at suse.de
Wed May 21 03:16:08 PDT 2025


On 5/19/25 19:50, Eric Biggers wrote:
> From: Eric Biggers <ebiggers at google.com>
> 
> Since skb_copy_and_hash_datagram_iter() is used only with CRC32C, the
> crypto_ahash abstraction provides no value.  Add
> skb_copy_and_crc32c_datagram_iter() which just calls crc32c() directly.
> 
> This is faster and simpler.  It also doesn't have the weird dependency
> issue where skb_copy_and_hash_datagram_iter() depends on
> CONFIG_CRYPTO_HASH=y without that being expressed explicitly in the
> kconfig (presumably because it was too heavyweight for NET to select).
> The new function is conditional on the hidden boolean symbol NET_CRC32C,
> which selects CRC32.  So it gets compiled only when something that
> actually needs CRC32C packet checksums is enabled, it has no implicit
> dependency, and it doesn't depend on the heavyweight crypto layer.
> 
> Signed-off-by: Eric Biggers <ebiggers at google.com>
> ---
>   include/linux/skbuff.h |  2 ++
>   net/core/datagram.c    | 33 +++++++++++++++++++++++++++++++++
>   2 files changed, 35 insertions(+)
> 
Reviewed-by: Hannes Reinecke <hare at suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare at suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich



More information about the Linux-nvme mailing list