Skip to content

sockmap/ktls: Simplify how we restore sk_prot callbacks

Jakub Sitnicki bpf netdev 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3bpf, sk_msg: Let ULP restore sk_proto and write_space callbackinclude/linux/skmsg.h+1 -101 reply
2/3bpf, sk_msg: Don't clear saved sock proto on restoreinclude/linux/skmsg.h+1 -71 reply
3/3selftests/bpf: Test unhashing kTLS socket after removing from maptools/testing/selftests/bpf/prog_tests/sockmap_ktls.c+123 -01 reply

Reviews trailers per patch

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

PatchJohn Fastabend
1/3A-b
2/3A-b
3/3A-b

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

Read the v1 thread

Cover letter [PATCH bpf-next 0/3] sockmap/ktls: Simplify how we restore sk_prot callbacks

This series has been split out from "Extend SOCKMAP to store listening sockets" [0]. I think it stands on its own, and makes the latter series smaller, which will make the review easier, hopefully.

The essence is that we don't need to do a complicated dance in sk_psock_restore_proto, if we agree that the contract with tcp_update_ulp is to restore callbacks even when the socket doesn't use ULP. This is what tcp_update_ulp currently does, and we just make use of it.

Series is accompanied by a test for a particularly tricky case of restoring callbacks when we have both sockmap and tls callbacks configured in sk->sk_prot.

[0] https://lore.kernel.org/bpf/[email protected]/

Jakub Sitnicki (3):
bpf, sk_msg: Let ULP restore sk_proto and write_space callback bpf, sk_msg: Don't clear saved sock proto on restore selftests/bpf: Test unhashing kTLS socket after removing from map

 include/linux/skmsg.h                         |  17 +--
 .../selftests/bpf/prog_tests/sockmap_ktls.c   | 123 ++++++++++++++++++
 2 files changed, 124 insertions(+), 16 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c
Signature · 1 line
2.24.1