netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bpf-next PATCH 0/7] Add BPF_PROG_TYPE_SK_MSG and attach pt
@ 2018-01-12 18:09 John Fastabend
  2018-01-12 18:10 ` [bpf-next PATCH 1/7] net: add a UID to use for ULP socket assignment John Fastabend
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: John Fastabend @ 2018-01-12 18:09 UTC (permalink / raw)
  To: borkmann, john.fastabend, ast; +Cc: netdev, kafai

This series include 4 setup patches (1-4) to allow ULP layer and
sockmap refcounting to support another ULP type. There is one small
change (5 lines!) on the TCP side in patch 4. This adds a flag so
that the ULP layer can inform the TCP stack not to mark the frags
as shared. When the ULP layer "owns" the frags and 'gives' them
to the TCP stack we know there can be no additional updates from
user side to the data.

Patch 4 is the bulk of the work. This adds a new program type
BPF_PROG_TYPE_SK_MSG, a sockmap program attach type
BPF_SK_MSG_VERDICT and a new ULP layer (TCP_ULP_BPF) to allow BPF
prgrams to be run on sendmsg/sendfile system calls and inspect data.
For now only TCP is supported when sockmap is extended other protos
can be added. See the patch description for a lengthy description
of the details. After this patch users can now attach BPF policy
and monitoring programs to socket send hooks.

Finally patches 6/7 and 7/7 add tests to test_maps and the verifier
in selftests/bpf so we get some automated coverage. One open
question I have is if we should move the samples/sockmap program
into selftests/bpf and start running it to get even more coverage
on the automated side. We can push this as an independent patch
set.

---

John Fastabend (7):
      net: add a UID to use for ULP socket assignment
      sock: make static tls function alloc_sg generic sock helper
      sockmap: convert refcnt to an atomic refcnt
      net: do_tcp_sendpages flag to avoid SKBTX_SHARED_FRAG
      bpf: create tcp_bpf_ulp allowing BPF to monitor socket TX/RX data
      bpf: add map tests for BPF_PROG_TYPE_SK_MSG
      bpf: add verifier tests for BPF_PROG_TYPE_SK_MSG


 include/linux/bpf.h                                |    1 
 include/linux/bpf_types.h                          |    1 
 include/linux/filter.h                             |   10 
 include/linux/socket.h                             |    1 
 include/net/sock.h                                 |    4 
 include/net/tcp.h                                  |    7 
 include/uapi/linux/bpf.h                           |   28 +
 kernel/bpf/sockmap.c                               |  504 +++++++++++++++++++-
 kernel/bpf/syscall.c                               |   14 -
 kernel/bpf/verifier.c                              |    5 
 net/core/filter.c                                  |  106 ++++
 net/core/sock.c                                    |   56 ++
 net/ipv4/tcp.c                                     |    4 
 net/ipv4/tcp_ulp.c                                 |   51 ++
 net/tls/tls_main.c                                 |    1 
 net/tls/tls_sw.c                                   |   69 ---
 tools/include/uapi/linux/bpf.h                     |   16 +
 tools/testing/selftests/bpf/Makefile               |    3 
 tools/testing/selftests/bpf/bpf_helpers.h          |    2 
 tools/testing/selftests/bpf/sockmap_parse_prog.c   |   15 +
 tools/testing/selftests/bpf/sockmap_verdict_prog.c |    7 
 tools/testing/selftests/bpf/test_maps.c            |   54 ++
 tools/testing/selftests/bpf/test_verifier.c        |   54 ++
 23 files changed, 913 insertions(+), 100 deletions(-)

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-01-18 17:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-12 18:09 [bpf-next PATCH 0/7] Add BPF_PROG_TYPE_SK_MSG and attach pt John Fastabend
2018-01-12 18:10 ` [bpf-next PATCH 1/7] net: add a UID to use for ULP socket assignment John Fastabend
2018-01-12 18:10 ` [bpf-next PATCH 2/7] sock: make static tls function alloc_sg generic sock helper John Fastabend
2018-01-12 18:10 ` [bpf-next PATCH 3/7] sockmap: convert refcnt to an atomic refcnt John Fastabend
2018-01-12 18:10 ` [bpf-next PATCH 4/7] net: do_tcp_sendpages flag to avoid SKBTX_SHARED_FRAG John Fastabend
2018-01-12 20:10   ` Eric Dumazet
2018-01-12 20:26     ` John Fastabend
2018-01-12 20:46       ` Eric Dumazet
2018-01-12 21:11         ` John Fastabend
2018-01-12 18:11 ` [bpf-next PATCH 5/7] bpf: create tcp_bpf_ulp allowing BPF to monitor socket TX/RX data John Fastabend
2018-01-17  2:25   ` Alexei Starovoitov
2018-01-17  5:49     ` John Fastabend
2018-01-17  6:20       ` Alexei Starovoitov
2018-01-17 20:32         ` John Fastabend
2018-01-17 22:04   ` Martin KaFai Lau
2018-01-18 17:27     ` John Fastabend
2018-01-12 18:11 ` [bpf-next PATCH 6/7] bpf: add map tests for BPF_PROG_TYPE_SK_MSG John Fastabend
2018-01-12 18:11 ` [bpf-next PATCH 7/7] bpf: add verifier " John Fastabend

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).