Skip to content

udp msg_zerocopy

Willem de Bruijn netdev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 3 repliesIn review
  2. v33 patches 2 repliesSuperseded
  3. v22 patches 8 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches3 repliesSuperseded

Changes in v4 from the cover letter

- Move skb_zcopy_set below the only kfree_skb that might cause a premature uarg destroy before skb_zerocopy_put_abort
- Move the entire skb_shinfo assignment block, to keep that cacheline access in one place

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3udp: msg_zerocopyinclude/linux/skbuff.h net/core/skbuff.c net/core/sock.c +2 more+55 -31 reply
2/3udp: elide zerocopy operation in hot pathinclude/linux/skbuff.h net/core/skbuff.c net/ipv4/ip_output.c +2 more+36 -311 reply
3/3selftests: extend zerocopy tests to udptools/testing/selftests/net/msg_zerocopy.c tools/testing/selftests/net/msg_zerocopy.sh tools/testing/selftests/net/udpgso_bench.sh+7 -10 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchPaolo Abeni
1/3A-b
2/3A-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH net-next v4 0/3] udp msg_zerocopy

From: Willem de Bruijn <[email protected]>

Enable MSG_ZEROCOPY for udp sockets

Patch 1/3 is the main patch, a rework of RFC patch
http://patchwork.ozlabs.org/patch/899630/
more details in the patch commit message

Patch 2/3 is an optimization to remove a branch from the UDP hot path
and refcount_inc/refcount_dec_and_test pair when zerocopy is used. This used to be included in the first patch in v2.

Patch 3/3 runs the already existing udp zerocopy tests
as part of kselftest

See also recent Linux Plumbers presentation
https://linuxplumbersconf.org/event/2/contributions/106/attachments/104/128/willemdebruijn-lpc2018-udpgso-presentation-20181113.pdf

Changes:
v1 -> v2
- Fixup reverse christmas tree violation
v2 -> v3
- Split refcount avoidance optimization into separate patch
- Fix refcount leak on error in fragmented case (thanks to Paolo Abeni for pointing this one out!)
- Fix refcount inc on zero
v3 -> v4
- Move skb_zcopy_set below the only kfree_skb that might cause a premature uarg destroy before skb_zerocopy_put_abort
- Move the entire skb_shinfo assignment block, to keep that cacheline access in one place

Willem de Bruijn (3):
udp: msg_zerocopy
udp: elide zerocopy operation in hot path
selftests: extend zerocopy tests to udp

 include/linux/skbuff.h                      | 13 +++++---
 net/core/skbuff.c                           | 15 ++++++---
 net/core/sock.c                             |  5 ++-
 net/ipv4/ip_output.c                        | 37 ++++++++++++++++-----
 net/ipv4/tcp.c                              |  2 +-
 net/ipv6/ip6_output.c                       | 37 ++++++++++++++++-----
 tools/testing/selftests/net/msg_zerocopy.c  |  3 +-
 tools/testing/selftests/net/msg_zerocopy.sh |  2 ++
 tools/testing/selftests/net/udpgso_bench.sh |  3 ++
 9 files changed, 90 insertions(+), 27 deletions(-)
Signature · 1 line
2.20.0.rc1.387.gf8505762e3-goog