netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/3] bpf: add sk_msg helper sk_msg_pop_data
@ 2018-11-26 22:16 John Fastabend
  2018-11-26 22:16 ` [PATCH bpf-next v2 1/3] bpf: helper to pop data from messages John Fastabend
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: John Fastabend @ 2018-11-26 22:16 UTC (permalink / raw)
  To: ast, daniel; +Cc: john.fastabend, netdev

After being able to add metadata to messages with sk_msg_push_data we
have also found it useful to be able to "pop" this metadata off before
sending it to applications in some cases. This series adds a new helper
sk_msg_pop_data() and the associated patches to add tests and tools/lib
support.

Thanks!

v2: Daniel caught that we missed adding sk_msg_pop_data to the changes
    data helper so that the verifier ensures BPF programs revalidate
    data after using this helper. Also improve documentation adding a
    return description and using RST syntax per Quentin's comment. And
    delta calculations for DROP with pop'd data (albeit a strange set
    of operations for a program to be doing) had potential to be
    incorrect possibly confusing user space applications, so fix it.

John Fastabend (3):
  bpf: helper to pop data from messages
  bpf: add msg_pop_data helper to tools
  bpf: test_sockmap, add options for msg_pop_data() helper usage

 include/uapi/linux/bpf.h                        |  13 +-
 net/core/filter.c                               | 169 ++++++++++++++++++++++++
 net/ipv4/tcp_bpf.c                              |  14 +-
 tools/include/uapi/linux/bpf.h                  |  13 +-
 tools/testing/selftests/bpf/bpf_helpers.h       |   2 +
 tools/testing/selftests/bpf/test_sockmap.c      | 127 +++++++++++++++++-
 tools/testing/selftests/bpf/test_sockmap_kern.h |  70 ++++++++--
 7 files changed, 386 insertions(+), 22 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2018-11-29  8:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-26 22:16 [PATCH bpf-next v2 0/3] bpf: add sk_msg helper sk_msg_pop_data John Fastabend
2018-11-26 22:16 ` [PATCH bpf-next v2 1/3] bpf: helper to pop data from messages John Fastabend
2018-11-26 22:16 ` [PATCH bpf-next v2 2/3] bpf: add msg_pop_data helper to tools John Fastabend
2018-11-26 22:16 ` [PATCH bpf-next v2 3/3] bpf: test_sockmap, add options for msg_pop_data() helper John Fastabend
2018-11-27 17:24 ` [PATCH bpf-next v2 0/3] bpf: add sk_msg helper sk_msg_pop_data Alexei Starovoitov
2018-11-28 21:12 ` Daniel Borkmann

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).