mbox series

[RFC,v2,iproute2,0/1] Add ability to specify eBPF map pin path

Message ID 20230526150921.338906-1-mtottenh@akamai.com (mailing list archive)
Headers show
Series Add ability to specify eBPF map pin path | expand

Message

Max Tottenham May 26, 2023, 3:09 p.m. UTC
We have a use case where we have several different applications composed of
sets of eBPF programs (programs that may be attached at the TC/XDP layers),
that need to share maps and not conflict with each other.

For XDP based programs, we are using the xdp-loader from the xdp-tools
project[1], it exposes an option to set the 'pin-path' for a given program.
However, programs loaded via tc don't appear to have that ability, all I have
found is the use of LIBBPF_PIN_BY_NAME or the older
PIN_OBJECT_NS/PIN_GLOBAL_NS, but those don't let the user specify the path.

I've whipped up a quick patch to be able to pass along a 'pin_path'  similar to
the xdp-loader. I don't know if this is the *right* approach so I'm more than
happy to be pointed in the right direction.


Thanks

Max

[1] https://github.com/xdp-project/xdp-tools/tree/master/xdp-loader


Changes since V1:

 * Remove debug code.
 * Update man page.

Max Tottenham (1):
  tc/f_bpf.c: Add ability to specify eBPF map pin path

 include/bpf_util.h |  1 +
 lib/bpf_legacy.c   | 11 +++++++++--
 lib/bpf_libbpf.c   | 14 +++++++-------
 man/man8/tc-bpf.8  |  8 ++++++++
 tc/f_bpf.c         |  4 +++-
 5 files changed, 28 insertions(+), 10 deletions(-)