Skip to content

sockmap integration for ktls

Daniel Borkmann netdev 2 versions – Applied

Status from this message: Applied, Thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 7 repliesApplied
  2. v18 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- Removed leftover comment spotted by Alexei
- Improved commit messages, rebase

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/8tcp, ulp: enforce sock_owned_by_me upon ulp init and cleanupnet/ipv4/tcp_ulp.c+4 -02 replies
2/8tcp, ulp: remove ulp bits from sockmapinclude/net/tcp.h kernel/bpf/sockmap.c net/ipv4/tcp_ulp.c+23 -880 replies
3/8bpf, sockmap: convert to generic sk_msg interfaceinclude/linux/bpf.h include/linux/bpf_types.h include/linux/filter.h +14 more+2925 -28600 replies
4/8tls: convert to generic sk_msg interfaceinclude/linux/skmsg.h include/net/sock.h include/net/tls.h +5 more+236 -4022 replies
5/8tls: replace poll implementation with read hookinclude/net/tls.h net/tls/tls_main.c net/tls/tls_sw.c+11 -220 replies
6/8tls: add bpf support to sk_msg handlinginclude/linux/skmsg.h net/tls/tls_sw.c+414 -660 replies
7/8bpf: add tls support for testing in test_sockmaptools/testing/selftests/bpf/test_sockmap.c+89 -02 replies
8/8bpf, doc: add maintainers entry to related filesMAINTAINERS+10 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/8] sockmap integration for ktls

This work adds a generic sk_msg layer and converts both sockmap and later ktls over to make use of it as a common data structure for application data (similarly as sk_buff for network packets). With that in place the sk_msg framework spans accross ULP layer in the kernel and allows for introspection or filtering of L7 data with the help of BPF programs operating on a common input context.

In a second step, we enable the latter for ktls which was previously not possible, meaning, ktls and sk_msg verdict programs were mutually exclusive in the ULP layer which created challenges for the orchestrator when trying to apply TCP based policy, for example. Leveraging the prior consolidation we can finally overcome this limitation.

Note, there's no change in behavior when ktls is not used in combination with BPF, and also no change in behavior for stand alone sockmap. The kselftest suites for ktls, sockmap and ktls with sockmap combined also runs through successfully. For further details please see individual patches.

Thanks!

v1 -> v2:
- Removed leftover comment spotted by Alexei
- Improved commit messages, rebase

Daniel Borkmann (5):
tcp, ulp: enforce sock_owned_by_me upon ulp init and cleanup tcp, ulp: remove ulp bits from sockmap
bpf, sockmap: convert to generic sk_msg interface
tls: convert to generic sk_msg interface
bpf, doc: add maintainers entry to related files

John Fastabend (3):
tls: replace poll implementation with read hook
tls: add bpf support to sk_msg handling
bpf: add tls support for testing in test_sockmap

 MAINTAINERS                                |   10 +
 include/linux/bpf.h                        |   33 +-
 include/linux/bpf_types.h                  |    2 +-
 include/linux/filter.h                     |   21 -
 include/linux/skmsg.h                      |  410 +++++
 include/net/sock.h                         |    4 -
 include/net/tcp.h                          |   28 +-
 include/net/tls.h                          |   24 +-
 kernel/bpf/Makefile                        |    5 -
 kernel/bpf/core.c                          |    2 -
 kernel/bpf/sockmap.c                       | 2629 ----------------------------
 kernel/bpf/syscall.c                       |    6 +-
 net/Kconfig                                |   11 +
 net/core/Makefile                          |    2 +
 net/core/filter.c                          |  270 +--
 net/core/skmsg.c                           |  802 +++++++++
 net/core/sock.c                            |   61 -
 net/core/sock_map.c                        | 1002 +++++++++++
 net/ipv4/Makefile                          |    1 +
 net/ipv4/tcp_bpf.c                         |  655 +++++++
 net/ipv4/tcp_ulp.c                         |   73 +-
 net/strparser/Kconfig                      |    4 +-
 net/tls/Kconfig                            |    1 +
 net/tls/tls_device.c                       |    2 +-
 net/tls/tls_main.c                         |   11 +-
 net/tls/tls_sw.c                           |  900 ++++++----
 tools/testing/selftests/bpf/test_sockmap.c |   89 +
 27 files changed, 3666 insertions(+), 3392 deletions(-)
 create mode 100644 include/linux/skmsg.h
 delete mode 100644 kernel/bpf/sockmap.c
 create mode 100644 net/core/skmsg.c
 create mode 100644 net/core/sock_map.c
 create mode 100644 net/ipv4/tcp_bpf.c
Signature · 1 line
2.9.5