All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next,v2 0/2] bpf: add helper for getting xfrm states
@ 2018-04-18 21:58 Eyal Birger
  2018-04-18 21:58 ` [PATCH bpf-next,v2 1/2] " Eyal Birger
  2018-04-18 21:58 ` [PATCH bpf-next,v2 2/2] samples/bpf: extend test_tunnel_bpf.sh with xfrm state test Eyal Birger
  0 siblings, 2 replies; 7+ messages in thread
From: Eyal Birger @ 2018-04-18 21:58 UTC (permalink / raw)
  To: netdev; +Cc: shmulik, ast, daniel, fw, steffen.klassert, 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.

---
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                 | 15 +++++++
 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, 185 insertions(+), 3 deletions(-)

-- 
2.7.4

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

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-18 21:58 [PATCH bpf-next,v2 0/2] bpf: add helper for getting xfrm states Eyal Birger
2018-04-18 21:58 ` [PATCH bpf-next,v2 1/2] " Eyal Birger
2018-04-18 22:31   ` Alexei Starovoitov
2018-04-20  3:43     ` Eyal Birger
2018-04-23  0:34       ` Alexei Starovoitov
2018-04-24 12:54         ` Daniel Borkmann
2018-04-18 21:58 ` [PATCH bpf-next,v2 2/2] samples/bpf: extend test_tunnel_bpf.sh with xfrm state test Eyal Birger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.