Skip to content

bpf: add sk_msg helper sk_msg_pop_data

John Fastabend netdev 2 versions – Applied

Status from this message: Applied to bpf-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 2 repliesApplied
  2. v13 patches 5 repliesApplied

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3bpf: helper to pop data from messagesinclude/uapi/linux/bpf.h net/core/filter.c net/ipv4/tcp_bpf.c +1 more+209 -60 replies
2/3bpf: add msg_pop_data helper to toolstools/include/uapi/linux/bpf.h tools/testing/selftests/bpf/bpf_helpers.h+17 -10 replies
3/3bpf: test_sockmap, add options for msg_pop_data() helpertools/testing/selftests/bpf/test_sockmap.c tools/testing/selftests/bpf/test_sockmap_kern.h+180 -170 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAlexei Starovoitov
SeriesA-b
1/3
2/3
3/3

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

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/3] bpf: add sk_msg helper sk_msg_pop_data

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(-)
Signature · 1 line
2.7.4