netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Max Tottenham <mtottenh@akamai.com>
To: <netdev@vger.kernel.org>
Cc: <stephen@networkplumber.org>, <johunt@akamai.com>,
	Max Tottenham <mtottenh@akamai.com>
Subject: [RFC PATCH v2 iproute2 0/1] Add ability to specify eBPF map pin path
Date: Fri, 26 May 2023 11:09:20 -0400	[thread overview]
Message-ID: <20230526150921.338906-1-mtottenh@akamai.com> (raw)
In-Reply-To: <20230503173348.703437-1-mtottenh@akamai.com>

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

-- 
2.25.1


  parent reply	other threads:[~2023-05-26 15:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03 17:33 [RFC PATCH iproute2] Add ability to specify eBPF pin path Max Tottenham
2023-05-03 17:33 ` Max Tottenham
2023-05-03 18:50   ` Stephen Hemminger
2023-05-03 18:51   ` Stephen Hemminger
2023-05-26 15:09 ` Max Tottenham [this message]
2023-05-26 15:09   ` [RFC PATCH v2 iproute2 1/1] tc/f_bpf.c: Add ability to specify eBPF map " Max Tottenham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230526150921.338906-1-mtottenh@akamai.com \
    --to=mtottenh@akamai.com \
    --cc=johunt@akamai.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).