mbox series

[bpf-next,v2,0/2] Add skb_adjust_room() for SK_SKB

Message ID 160160094764.7052.2711632803258461907.stgit@john-Precision-5820-Tower (mailing list archive)
Headers show
Series Add skb_adjust_room() for SK_SKB | expand

Message

John Fastabend Oct. 2, 2020, 1:09 a.m. UTC
This implements the helper skb_adjust_room() for BPF_SKS_SK_STREAM_VERDICT
programs so we can push/pop headers from the data on recieve. One use
case is to pop TLS headers off kTLS packets.

The first patch implements the helper and the second updates test_sockmap
to use it removing some case handling we had to do earlier to account for
the TLS headers in the kTLS tests.

v1->v2:
 Fix error path for TLS case (Daniel)
 check mode input is 0 because we don't use it now (Daniel)
 Remove incorrect/misleading comment (Lorenz)

Thanks,
John

---

John Fastabend (2):
      bpf, sockmap: add skb_adjust_room to pop bytes off ingress payload
      bpf, sockmap: update selftests to use skb_adjust_room


 net/core/filter.c                                  |   46 ++++++++++++++++++++
 .../selftests/bpf/progs/test_sockmap_kern.h        |   34 +++++++++++----
 tools/testing/selftests/bpf/test_sockmap.c         |   27 +++---------
 3 files changed, 77 insertions(+), 30 deletions(-)

--
Signature

Comments

Martin KaFai Lau Oct. 2, 2020, 9:45 p.m. UTC | #1
On Thu, Oct 01, 2020 at 06:09:34PM -0700, John Fastabend wrote:
> This implements the helper skb_adjust_room() for BPF_SKS_SK_STREAM_VERDICT
> programs so we can push/pop headers from the data on recieve. One use
> case is to pop TLS headers off kTLS packets.
> 
> The first patch implements the helper and the second updates test_sockmap
> to use it removing some case handling we had to do earlier to account for
> the TLS headers in the kTLS tests.
> 
> v1->v2:
>  Fix error path for TLS case (Daniel)
>  check mode input is 0 because we don't use it now (Daniel)
>  Remove incorrect/misleading comment (Lorenz)
Acked-by: Martin KaFai Lau <kafai@fb.com>
patchwork-bot+bpf@kernel.org Oct. 2, 2020, 10:30 p.m. UTC | #2
Hello:

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

On Thu, 01 Oct 2020 18:09:34 -0700 you wrote:
> This implements the helper skb_adjust_room() for BPF_SKS_SK_STREAM_VERDICT
> programs so we can push/pop headers from the data on recieve. One use
> case is to pop TLS headers off kTLS packets.
> 
> The first patch implements the helper and the second updates test_sockmap
> to use it removing some case handling we had to do earlier to account for
> the TLS headers in the kTLS tests.
> 
> [...]

Here is the summary with links:
  - [bpf-next,v2,1/2] bpf, sockmap: add skb_adjust_room to pop bytes off ingress payload
    https://git.kernel.org/bpf/bpf-next/c/18ebe16d1049
  - [bpf-next,v2,2/2] bpf, sockmap: update selftests to use skb_adjust_room
    https://git.kernel.org/bpf/bpf-next/c/91274ca53518

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