diff options
author | 2025-05-19 10:50:05 -0700 | |
---|---|---|
committer | 2025-05-21 15:39:59 -0700 | |
commit | 86edc94da1063a327d8d4bfc82b31df427db3e5c (patch) | |
tree | 418c8947d074ce43a6fab3e26e05fc167a47e10a /net/core/dev.c | |
parent | net: add skb_crc32c() (diff) | |
download | wireguard-linux-86edc94da1063a327d8d4bfc82b31df427db3e5c.tar.xz wireguard-linux-86edc94da1063a327d8d4bfc82b31df427db3e5c.zip |
net: use skb_crc32c() in skb_crc32c_csum_help()
Instead of calling __skb_checksum() with a skb_checksum_ops struct that
does CRC32C, just call the new function skb_crc32c(). This is faster
and simpler.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://patch.msgid.link/20250519175012.36581-4-ebiggers@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index c27607b7f8b0..e1e37dfb3628 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3599,7 +3599,7 @@ EXPORT_SYMBOL(skb_checksum_help); #ifdef CONFIG_NET_CRC32C int skb_crc32c_csum_help(struct sk_buff *skb) { - __le32 crc32c_csum; + u32 crc; int ret = 0, offset, start; if (skb->ip_summed != CHECKSUM_PARTIAL) @@ -3627,10 +3627,8 @@ int skb_crc32c_csum_help(struct sk_buff *skb) if (ret) goto out; - crc32c_csum = cpu_to_le32(~__skb_checksum(skb, start, - skb->len - start, ~(__u32)0, - crc32c_csum_stub)); - *(__le32 *)(skb->data + offset) = crc32c_csum; + crc = ~skb_crc32c(skb, start, skb->len - start, ~0); + *(__le32 *)(skb->data + offset) = cpu_to_le32(crc); skb_reset_csum_not_inet(skb); out: return ret; |