Skip to content

Commit 86edc94

Browse files
ebiggerskuba-moo
authored andcommitted
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>
1 parent a5bd029 commit 86edc94

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

net/core/dev.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3599,7 +3599,7 @@ EXPORT_SYMBOL(skb_checksum_help);
35993599
#ifdef CONFIG_NET_CRC32C
36003600
int skb_crc32c_csum_help(struct sk_buff *skb)
36013601
{
3602-
__le32 crc32c_csum;
3602+
u32 crc;
36033603
int ret = 0, offset, start;
36043604

36053605
if (skb->ip_summed != CHECKSUM_PARTIAL)
@@ -3627,10 +3627,8 @@ int skb_crc32c_csum_help(struct sk_buff *skb)
36273627
if (ret)
36283628
goto out;
36293629

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);
36343632
skb_reset_csum_not_inet(skb);
36353633
out:
36363634
return ret;

0 commit comments

Comments
 (0)