mbox series

[bpf-next,0/4] bpf, sockmap: allow verdict only sk_skb progs

Message ID 160239226775.8495.15389345509643354423.stgit@john-Precision-5820-Tower
Headers show
Series bpf, sockmap: allow verdict only sk_skb progs | expand

Message

John Fastabend Oct. 11, 2020, 5:08 a.m. UTC
This allows a sockmap sk_skb verdict programs to run without a parser. For
some use cases, such as verdict program that support streaming data or a
l3/l4 proxy that does not use data in packet, loading the nop parser
'return skb->len' is an extra unnecessary complexity. With this series we
simply call the verdict program directly from data_ready instead of
bouncing through the strparser logic.

Patches 1,2 do the lifting on the sockmap side then patches 3,4 add the
selftests.

This applies on top of the series here,

  sockmap/sk_skb program memory acct fixes 
  https://patchwork.ozlabs.org/project/netdev/list/?series=206975

it will apply without the above series cleanly, but will have an incorrect
memory accounting causing a failure in ./test_sockmap. I could have left
it so the series passed without above series, but it seemed odd to have
it out there and then require yet another patch to fix it up here.

Thanks.

---

John Fastabend (4):
      bpf, sockmap: check skb_verdict and skb_parser programs explicitly
      bpf, sockmap: Allow skipping sk_skb parser program
      bpf, selftests: Add option to test_sockmap to omit adding parser program
      bpf, selftests: Add three new sockmap tests for verdict only programs


 include/linux/skmsg.h                      |    2 +
 net/core/skmsg.c                           |   78 ++++++++++++++++++++++++++++
 net/core/sock_map.c                        |   37 ++++++++-----
 tools/testing/selftests/bpf/test_sockmap.c |   54 ++++++++++++++-----
 4 files changed, 142 insertions(+), 29 deletions(-)

--
Signature

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 12, 2020, 1:20 a.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (refs/heads/master):

On Sat, 10 Oct 2020 22:08:29 -0700 you wrote:
> This allows a sockmap sk_skb verdict programs to run without a parser. For

> some use cases, such as verdict program that support streaming data or a

> l3/l4 proxy that does not use data in packet, loading the nop parser

> 'return skb->len' is an extra unnecessary complexity. With this series we

> simply call the verdict program directly from data_ready instead of

> bouncing through the strparser logic.

> 

> [...]


Here is the summary with links:
  - [bpf-next,1/4] bpf, sockmap: check skb_verdict and skb_parser programs explicitly
    https://git.kernel.org/bpf/bpf-next/c/743df8b7749f
  - [bpf-next,2/4] bpf, sockmap: Allow skipping sk_skb parser program
    https://git.kernel.org/bpf/bpf-next/c/ef5659280eb1
  - [bpf-next,3/4] bpf, selftests: Add option to test_sockmap to omit adding parser program
    https://git.kernel.org/bpf/bpf-next/c/cdf43c4bfa1a
  - [bpf-next,4/4] bpf, selftests: Add three new sockmap tests for verdict only programs
    https://git.kernel.org/bpf/bpf-next/c/a24fb420a577

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html