Commit 55d22ee0 authored by Eric Biggers's avatar Eric Biggers Committed by Jakub Kicinski
Browse files

net: introduce CONFIG_NET_CRC32C



Add a hidden kconfig symbol NET_CRC32C that will group together the
functions that calculate CRC32C checksums of packets, so that these
don't have to be built into NET-enabled kernels that don't need them.

Make skb_crc32c_csum_help() (which is called only when IP_SCTP is
enabled) conditional on this symbol, and make IP_SCTP select it.

Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Link: https://patch.msgid.link/20250519175012.36581-2-ebiggers@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 51ebe6b1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -75,6 +75,10 @@ config NET_DEVMEM
config NET_SHAPER
	bool

config NET_CRC32C
	bool
	select CRC32

menu "Networking options"

source "net/packet/Kconfig"
+2 −0
Original line number Diff line number Diff line
@@ -3596,6 +3596,7 @@ int skb_checksum_help(struct sk_buff *skb)
}
EXPORT_SYMBOL(skb_checksum_help);

#ifdef CONFIG_NET_CRC32C
int skb_crc32c_csum_help(struct sk_buff *skb)
{
	__le32 crc32c_csum;
@@ -3635,6 +3636,7 @@ int skb_crc32c_csum_help(struct sk_buff *skb)
	return ret;
}
EXPORT_SYMBOL(skb_crc32c_csum_help);
#endif /* CONFIG_NET_CRC32C */

__be16 skb_network_protocol(struct sk_buff *skb, int *depth)
{
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ menuconfig IP_SCTP
	select CRYPTO
	select CRYPTO_HMAC
	select CRYPTO_SHA1
	select NET_CRC32C
	select NET_UDP_TUNNEL
	help
	  Stream Control Transmission Protocol