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.

RDMA/siw: use skb_crc32c() instead of __skb_checksum()

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.

Acked-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Bernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://patch.msgid.link/20250519175012.36581-5-ebiggers@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Eric Biggers and committed by
Jakub Kicinski
62673b7d 86edc94d

+2 -21
+1
drivers/infiniband/sw/siw/Kconfig
··· 3 3 depends on INET && INFINIBAND 4 4 depends on INFINIBAND_VIRT_DMA 5 5 select CRC32 6 + select NET_CRC32C 6 7 help 7 8 This driver implements the iWARP RDMA transport over 8 9 the Linux TCP/IP network stack. It enables a system with a
+1 -21
drivers/infiniband/sw/siw/siw.h
··· 693 693 return siw_crc_final(&crc, out); 694 694 } 695 695 696 - static inline __wsum siw_csum_update(const void *buff, int len, __wsum sum) 697 - { 698 - return (__force __wsum)crc32c((__force __u32)sum, buff, len); 699 - } 700 - 701 - static inline __wsum siw_csum_combine(__wsum csum, __wsum csum2, int offset, 702 - int len) 703 - { 704 - return (__force __wsum)crc32c_combine((__force __u32)csum, 705 - (__force __u32)csum2, len); 706 - } 707 - 708 696 static inline void siw_crc_skb(struct siw_rx_stream *srx, unsigned int len) 709 697 { 710 - const struct skb_checksum_ops siw_cs_ops = { 711 - .update = siw_csum_update, 712 - .combine = siw_csum_combine, 713 - }; 714 - __wsum crc = (__force __wsum)srx->mpa_crc; 715 - 716 - crc = __skb_checksum(srx->skb, srx->skb_offset, len, crc, 717 - &siw_cs_ops); 718 - srx->mpa_crc = (__force u32)crc; 698 + srx->mpa_crc = skb_crc32c(srx->skb, srx->skb_offset, len, srx->mpa_crc); 719 699 } 720 700 721 701 #define siw_dbg(ibdev, fmt, ...) \