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, 11 Feb 2021 12:18:48 +0100	[thread overview]
Message-ID: <874kiirgx3.fsf@toke.dk> (raw)
In-Reply-To: <20210210222710.7xl56xffdohvsko4@snout.localdomain>

"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! :)

> One thing I have been a little concerned about is the XDP_RUN_CONFIG in
> the xdp program function. For our case--with multiple teams writing
> independent, composable xdp programs--we don't want the XDP_RUN_CONFIG
> policy to be in the xdp program. Instead, we want the Go orchestration
> tool to have that policy as part of its configuration data (e.g., what
> order to run the xdp program functions in). From what I can tell, it's
> possible to omit the XDP_RUN_CONFIG from the xdp program function, and
> instead set the values when loading the xdp dispatcher. That's great, and
> thanks for the foresight there. I just want to confirm that I'm
> understanding that correctly, because it's very important for us.

Yes. The values embedded into the program BTF are defaults, and can be
overridden on load. The idea is that an application will set a default
value (e.g., "I'm a firewall, so I want to run early" or "I want to
monitor traffic to the stack so I'll run late"), but if the sysadmin
wants to do things differently they can override the order. The
important bit being that ultimate control of run order is up to the
*user*, not the application developer.

The policy override stuff is not implemented yet, but I am planning to
implement it by having libxdp read a config file with priority overrides
(similar to how libc will read /etc/nsswitch.conf or /etc/hosts which
makes them work in all applications).

And of course, if you're writing an orchestration tool, then you *are*
the user, so having the tool override priorities is definitely in scope
(it'll just be an alternative way to set policy instead of a config
file). How are you planning to specify the effective run order? I am
also quite open to working on a compatible way that can work for both
your tool and libxdp :)

> Also, I do hope that the existing Go BTF libraries are good enough to do
> what's needed here, because if I'm understand correctly, that's how I'll
> need to approach setting the XDP_RUN_CONFIG values for our use case.

You'll need to *parse* BTF to *read* the XDP_RUN_CONFIG. Which is pretty
basic, really, you just need to walk the BTF reference tree. Feel free
to reuse the parsing code in libxdp; that is, in turn, adapted from the
.maps section parsing code in libbpf :)

> I've been tasked to work on a Go libxdp implementation this quarter, so
> I'll be starting on that soon and let you know if I have questions as I
> go. I'm also happy to coordinate with anyone else that's interested.

Sounds great! Will be interesting to see a second implementation;
independent implementations are the ultimate test of any specification :)

Please do keep me in the loop, and don't hesitate to ping me if there
are things that are unclear or that you feel are less-than-ideal in the
way things work. I'm also quite open to evolving the spec to meet
everyone's needs!

-Toke


  reply	other threads:[~2021-02-11 11:22 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 [this message]
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

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=874kiirgx3.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).