]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: introduce CONFIG_NET_CRC32C
authorEric Biggers <ebiggers@google.com>
Mon, 19 May 2025 17:50:03 +0000 (10:50 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 21 May 2025 22:39:58 +0000 (15:39 -0700)
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: Eric Biggers <ebiggers@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://patch.msgid.link/20250519175012.36581-2-ebiggers@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/Kconfig
net/core/dev.c
net/sctp/Kconfig

index 202cc595e5e6ff756ab3e6aa0549a11c3f818063..5b71a52987d33d31ca9d70132be71de9462065a4 100644 (file)
@@ -75,6 +75,10 @@ config NET_DEVMEM
 config NET_SHAPER
        bool
 
+config NET_CRC32C
+       bool
+       select CRC32
+
 menu "Networking options"
 
 source "net/packet/Kconfig"
index 6d1a238dd4401b9a9a9f116ad7c3c8522bc5175e..c27607b7f8b0bca31c580d561d3f8653e61743ba 100644 (file)
@@ -3596,6 +3596,7 @@ out:
 }
 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 @@ out:
        return ret;
 }
 EXPORT_SYMBOL(skb_crc32c_csum_help);
+#endif /* CONFIG_NET_CRC32C */
 
 __be16 skb_network_protocol(struct sk_buff *skb, int *depth)
 {
index d18a72df3654eb456251869e644c4ab28accfd2a..3669ba351856301f98378f18f0f36ad1af23a896 100644 (file)
@@ -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