netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bpf-next PATCH 0/2] SK_MSG programs: read sock fields
@ 2018-05-17 15:53 John Fastabend
  2018-05-17 15:54 ` [bpf-next PATCH 1/2] bpf: allow sk_msg programs to " John Fastabend
  2018-05-17 15:54 ` [bpf-next PATCH 2/2] bpf: add sk_msg prog sk access tests to test_verifier John Fastabend
  0 siblings, 2 replies; 7+ messages in thread
From: John Fastabend @ 2018-05-17 15:53 UTC (permalink / raw)
  To: ast, daniel; +Cc: netdev

In this series we add the ability for sk msg programs to read basic
sock information about the sock they are attached to. The second
patch adds the tests to the selftest test_verifier.

One obseration that I had from writing this seriess is lots of the
./net/core/filter.c code is almost duplicated across program types.
I thought about building a template/macro that we could use as a
single block of code to read sock data out for multiple programs,
but I wasn't convinced it was worth it yet. The result was using a
macro saved a couple lines of code per block but made the code
a bit harder to read IMO. We can probably revisit the idea later
if we get more duplication.

---

John Fastabend (2):
      bpf: allow sk_msg programs to read sock fields
      bpf: add sk_msg prog sk access tests to test_verifier


 include/linux/filter.h                      |    1 
 include/uapi/linux/bpf.h                    |    8 ++
 kernel/bpf/sockmap.c                        |    1 
 net/core/filter.c                           |  114 ++++++++++++++++++++++++++-
 tools/include/uapi/linux/bpf.h              |    8 ++
 tools/testing/selftests/bpf/test_verifier.c |  115 +++++++++++++++++++++++++++
 6 files changed, 244 insertions(+), 3 deletions(-)

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

end of thread, other threads:[~2018-05-17 20:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-17 15:53 [bpf-next PATCH 0/2] SK_MSG programs: read sock fields John Fastabend
2018-05-17 15:54 ` [bpf-next PATCH 1/2] bpf: allow sk_msg programs to " John Fastabend
2018-05-17 18:17   ` Martin KaFai Lau
2018-05-17 20:16     ` John Fastabend
2018-05-17 15:54 ` [bpf-next PATCH 2/2] bpf: add sk_msg prog sk access tests to test_verifier John Fastabend
2018-05-17 18:57   ` Martin KaFai Lau
2018-05-17 20:12     ` 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).