bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: "Brian G. Merrell" <brian.g.merrell@gmail.com>
Cc: xdp-newbies@vger.kernel.org,
	"Jesper Dangaard Brouer" <brouer@redhat.com>,
	"Maciej Żenczykowski" <maze@google.com>,
	"Lorenz Bauer" <lmb@cloudflare.com>,
	"Andrey Ignatov" <rdna@fb.com>,
	bpf@vger.kernel.org
Subject: Re: How to orchestrate multiple XDP programs
Date: Thu, 18 Feb 2021 12:00:31 +0100	[thread overview]
Message-ID: <87v9apljxs.fsf@toke.dk> (raw)
In-Reply-To: <20210218101634.qn4lq2zvdwafpyvv@snout.localdomain>

"Brian G. Merrell" <brian.g.merrell@gmail.com> writes:

> On 21/02/11 12:18PM, Toke Høiland-Jørgensen wrote:
>> "Brian G. Merrell" <brian.g.merrell@gmail.com> writes:
>> 
>> > On 21/01/29 01:02PM, Toke Høiland-Jørgensen wrote:
>> >> Hi Brian
>> >> 
>> >> I've posted a first draft of this protocol description here:
>> >> https://github.com/xdp-project/xdp-tools/blob/master/lib/libxdp/protocol.org
>> >> 
>> >> Please take a look and let me know what you think. And do feel free to
>> >> point out any places that are unclear, as I said this is a first draft,
>> >> and I'm expecting it to evolve as I get feedback from you and others :)
>> >> 
>> >> -Toke
>> >> 
>> >
>> > Thanks so much for doing this Toke. There's a lot of great information.
>> > I did one read-through, and didn't notice any surprises compared to the
>> > code that I've read so far.
>> 
>> Awesome! :)
>
> A question for anyone (sorry if it's a silly one)...
>
> I did a second read-through of the protocol this evening. I wanted to
> take a deeper look at the function calls that are referenced. Some of
> them are BPF syscalls, which should be relatively straightforward to
> interface with from Go. However, some functions like
> bpf_get_link_xdp_info() appear to reside deep in the bowels of libbpf.
> I'd really like to avoid needing cgo bindings, so my question is if
> there some way to 1) interface with these functions that I'm just not
> seeing, or 2) achieve what's necessary for implementing libxdp by only
> utilizing syscalls.

bpf_get_link_xdp_info() is a wrapper around the kernel rt_netlink
interface. It issues an RTM_GETLINK with flags NLM_F_DUMP |
NLM_F_REQUEST and parses the IFLA_XDP attribute on the return value to
extract the program ID of the currently attached XDP program. I'm pretty
sure you can find an existing netlink library for Go, so this should be
pretty straight-forward to implement.

But point well taken that a document such as the protocol doc should
refer to the kernel interface and not the libbpf internals - I'll fix
that :)

-Toke


      reply	other threads:[~2021-02-18 13:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201201091203.ouqtpdmvvl2m2pga@snout.localdomain>
2020-12-01 12:08 ` How to orchestrate multiple XDP programs Toke Høiland-Jørgensen
2020-12-16  7:29   ` Brian G. Merrell
2020-12-16 12:45     ` Toke Høiland-Jørgensen
     [not found]       ` <87tur0x874.fsf@toke.dk>
2021-02-10 22:27         ` Brian G. Merrell
2021-02-11 11:18           ` Toke Høiland-Jørgensen
2021-02-12  6:51             ` Brian G. Merrell
2021-02-15 12:47               ` Toke Høiland-Jørgensen
2021-02-17  1:20                 ` Brian G. Merrell
2021-02-17 15:53                   ` Toke Høiland-Jørgensen
2021-02-17 22:27                     ` Brian G. Merrell
2021-02-18 16:20                       ` Toke Høiland-Jørgensen
2021-02-22 19:34                         ` Brian G. Merrell
2021-02-22 22:41                           ` Toke Høiland-Jørgensen
2021-02-23  8:54                             ` Brian G. Merrell
2021-02-23 11:07                               ` Toke Høiland-Jørgensen
2021-02-18 10:16             ` Brian G. Merrell
2021-02-18 11:00               ` Toke Høiland-Jørgensen [this message]

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=87v9apljxs.fsf@toke.dk \
    --to=toke@redhat.com \
    --cc=bpf@vger.kernel.org \
    --cc=brian.g.merrell@gmail.com \
    --cc=brouer@redhat.com \
    --cc=lmb@cloudflare.com \
    --cc=maze@google.com \
    --cc=rdna@fb.com \
    --cc=xdp-newbies@vger.kernel.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).