netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next,v3 0/2] bpf: add helper for getting xfrm states
@ 2018-04-24 14:50 Eyal Birger
  2018-04-24 14:50 ` [PATCH bpf-next,v3 1/2] " Eyal Birger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eyal Birger @ 2018-04-24 14:50 UTC (permalink / raw)
  To: netdev; +Cc: shmulik, ast, daniel, Eyal Birger

This patchset adds support for fetching XFRM state information from
an eBPF program called from TC.

The first patch introduces a helper for fetching an XFRM state from the
skb's secpath. The XFRM state is modeled using a new virtual struct which
contains the SPI, peer address, and reqid values of the state; This struct
can be extended in the future to provide additional state information.

The second patch adds a test example in test_tunnel_bpf.sh. The sample
validates the correct extraction of state information by the eBPF program.

---
v3:
  - Kept SPI and peer IPv4 address in state in network byte order
    following suggestion from Alexei Starovoitov
v2:
  - Fixed two comments by Daniel Borkmann:
    - disallow reserved flags in helper call
    - avoid compiling in helper code when CONFIG_XFRM is off

Eyal Birger (2):
  bpf: add helper for getting xfrm states
  samples/bpf: extend test_tunnel_bpf.sh with xfrm state test

 include/uapi/linux/bpf.h                  | 25 ++++++++++-
 net/core/filter.c                         | 48 +++++++++++++++++++++
 samples/bpf/tcbpf2_kern.c                 | 16 +++++++
 samples/bpf/test_tunnel_bpf.sh            | 71 +++++++++++++++++++++++++++++++
 tools/include/uapi/linux/bpf.h            | 25 ++++++++++-
 tools/testing/selftests/bpf/bpf_helpers.h |  4 +-
 6 files changed, 186 insertions(+), 3 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2018-04-24 21:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-24 14:50 [PATCH bpf-next,v3 0/2] bpf: add helper for getting xfrm states Eyal Birger
2018-04-24 14:50 ` [PATCH bpf-next,v3 1/2] " Eyal Birger
2018-04-24 14:50 ` [PATCH bpf-next,v3 2/2] samples/bpf: extend test_tunnel_bpf.sh with xfrm state test Eyal Birger
2018-04-24 21:53 ` [PATCH bpf-next,v3 0/2] bpf: add helper for getting xfrm states Daniel Borkmann

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).