Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Eric Biggers and committed by
Jakub Kicinski
86edc94d a5bd029c

+3 -5
+3 -5
net/core/dev.c
··· 3599 3599 #ifdef CONFIG_NET_CRC32C 3600 3600 int skb_crc32c_csum_help(struct sk_buff *skb) 3601 3601 { 3602 - __le32 crc32c_csum; 3602 + u32 crc; 3603 3603 int ret = 0, offset, start; 3604 3604 3605 3605 if (skb->ip_summed != CHECKSUM_PARTIAL) ··· 3627 3627 if (ret) 3628 3628 goto out; 3629 3629 3630 - crc32c_csum = cpu_to_le32(~__skb_checksum(skb, start, 3631 - skb->len - start, ~(__u32)0, 3632 - crc32c_csum_stub)); 3633 - *(__le32 *)(skb->data + offset) = crc32c_csum; 3630 + crc = ~skb_crc32c(skb, start, skb->len - start, ~0); 3631 + *(__le32 *)(skb->data + offset) = cpu_to_le32(crc); 3634 3632 skb_reset_csum_not_inet(skb); 3635 3633 out: 3636 3634 return ret;