Skip to content

net: faster and simpler CRC32C computation

Eric Biggers linux-nvme linux-rdma linux-sctp lkml netdev 2 versions – Applied

Status from this message: Applied to net-next with Leon's ack he sent to v1.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest10 patches 11 repliesApplied
  2. v110 patches 26 repliesSuperseded

Changes in v2 from the cover letter

- Added some benchmarks to commit message of "net: add skb_crc32c()"
- Added "Return:" to kerneldoc for skb_copy_and_crc32c_datagram_iter()
- Added Reviewed-by's
- Addressed review comments on nvme-tcp patch

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/10net: introduce CONFIG_NET_CRC32Cnet/Kconfig net/core/dev.c net/sctp/Kconfig+7 -01 reply
2/10net: add skb_crc32c()include/linux/skbuff.h net/core/skbuff.c+74 -01 reply
3/10net: use skb_crc32c() in skb_crc32c_csum_help()net/core/dev.c+3 -51 reply
4/10RDMA/siw: use skb_crc32c() instead of __skb_checksum()drivers/infiniband/sw/siw/Kconfig drivers/infiniband/sw/siw/siw.h+2 -211 reply
5/10sctp: use skb_crc32c() instead of __skb_checksum()include/net/sctp/checksum.h net/netfilter/Kconfig net/netfilter/ipvs/Kconfig +4 more+8 -331 reply
6/10net: fold __skb_checksum() into skb_checksum()include/linux/skbuff.h include/net/checksum.h net/core/skbuff.c+7 -731 reply
7/10lib/crc32: remove unused support for CRC32C combinationinclude/linux/crc32.h lib/crc32.c lib/tests/crc_kunit.c+0 -351 reply
8/10net: add skb_copy_and_crc32c_datagram_iter()include/linux/skbuff.h net/core/datagram.c+35 -01 reply
9/10nvme-tcp: use crc32c() and skb_copy_and_crc32c_datagram_iter()drivers/nvme/host/Kconfig drivers/nvme/host/tcp.c+42 -861 reply
10/10net: remove skb_copy_and_hash_datagram_iter()include/linux/skbuff.h net/core/datagram.c+0 -411 reply

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by.

PatchBernard MetzlerChristoph HellwigSagi GrimbergHannes Reinecke
1/10R-b
2/10R-b
3/10R-b
4/10R-b R-b
5/10R-b
6/10R-b
7/10R-b
8/10R-b
9/10R-b R-b R-b
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/10] net: faster and simpler CRC32C computation

Update networking code that computes the CRC32C of packets to just call crc32c() without unnecessary abstraction layers. The result is faster and simpler code.

Patches 1-7 add skb_crc32c() and remove the overly-abstracted and inefficient __skb_checksum().

Patches 8-10 replace skb_copy_and_hash_datagram_iter() with skb_copy_and_crc32c_datagram_iter(), eliminating the unnecessary use of the crypto layer. This unblocks the conversion of nvme-tcp to call crc32c() directly instead of using the crypto layer, which patch 9 does.

Please consider this series for net-next for 6.16.

Changed in v2:
- Added some benchmarks to commit message of "net: add skb_crc32c()"
- Added "Return:" to kerneldoc for skb_copy_and_crc32c_datagram_iter()
- Added Reviewed-by's
- Addressed review comments on nvme-tcp patch

Eric Biggers (10):
net: introduce CONFIG_NET_CRC32C
net: add skb_crc32c()
net: use skb_crc32c() in skb_crc32c_csum_help() RDMA/siw: use skb_crc32c() instead of __skb_checksum()
sctp: use skb_crc32c() instead of __skb_checksum()
net: fold __skb_checksum() into skb_checksum() lib/crc32: remove unused support for CRC32C combination
net: add skb_copy_and_crc32c_datagram_iter()
nvme-tcp: use crc32c() and skb_copy_and_crc32c_datagram_iter()
net: remove skb_copy_and_hash_datagram_iter()

 drivers/infiniband/sw/siw/Kconfig |   1 +
 drivers/infiniband/sw/siw/siw.h   |  22 +----
 drivers/nvme/host/Kconfig         |   4 +-
 drivers/nvme/host/tcp.c           | 124 +++++++++-------------------
 include/linux/crc32.h             |  23 ------
 include/linux/skbuff.h            |  16 +---
 include/net/checksum.h            |  12 ---
 include/net/sctp/checksum.h       |  29 +------
 lib/crc32.c                       |   6 --
 lib/tests/crc_kunit.c             |   6 --
 net/Kconfig                       |   4 +
 net/core/datagram.c               |  36 ++++----
 net/core/dev.c                    |  10 +--
 net/core/skbuff.c                 | 132 ++++++++++++++++++------------
 net/netfilter/Kconfig             |   4 +-
 net/netfilter/ipvs/Kconfig        |   2 +-
 net/openvswitch/Kconfig           |   2 +-
 net/sched/Kconfig                 |   2 +-
 net/sctp/Kconfig                  |   2 +-
 net/sctp/offload.c                |   1 -
 20 files changed, 161 insertions(+), 277 deletions(-)

base-commit: a8ae8a0e848e3506c95e45e7cb6e640502495f1a

Signature · 1 line
2.49.0