From: John Fastabend <john.fastabend@gmail.com>
To: ast@kernel.org, daniel@iogearbox.net
Cc: john.fastabend@gmail.com, netdev@vger.kernel.org
Subject: [PATCH bpf-next v2 0/3] bpf: add sk_msg helper sk_msg_pop_data
Date: Mon, 26 Nov 2018 14:16:16 -0800 [thread overview]
Message-ID: <1543270579-1405-1-git-send-email-john.fastabend@gmail.com> (raw)
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
next reply other threads:[~2018-11-27 9:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-26 22:16 John Fastabend [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1543270579-1405-1-git-send-email-john.fastabend@gmail.com \
--to=john.fastabend@gmail.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).