From: "Toke Høiland-Jørgensen" <toke@kernel.org>
To: Stanislav Fomichev <sdf@google.com>, lsf-pc@lists.linux-foundation.org
Cc: bpf@vger.kernel.org
Subject: Re: [LSF/MM/BPF TOPIC] XDP metadata for TX
Date: Fri, 24 Feb 2023 00:22:44 +0100 [thread overview]
Message-ID: <874jrcklvf.fsf@toke.dk> (raw)
In-Reply-To: <Y/fnZkXQdc8lkP7q@google.com>
Stanislav Fomichev <sdf@google.com> writes:
> I'd like to discuss a potential follow up for the previous "XDP RX
> metadata" series [0].
>
> Now that we can access (a subset of) packet metadata at RX, I'd like to
> explore the options where we can export some of that metadata on TX. And
> also whether it might be possible to access some of the TX completion
> metadata (things like TX timestamp).
>
> I'm currently trying to understand whether the same approach I've used
> on RX could work at TX. By May I plan to have a bunch of options laid
> out (currently considering XSK tx/compl programs and XDP tx/compl
> programs) so we have something to discuss.
I've been looking at ways of getting a TX-completion hook for the XDP
queueing stuff as well. For that, I think it could work to just hook
into xdp_return_frame(), but if you want to access hardware metadata
it'll obviously have to be in the driver. A hook in the driver could
certainly be used for the queueing return as well, though, which may
help making it worth the trouble :)
> I'd like to some more input on whether applying the same idea on TX
> makes sense or not and whether there are any sensible alternatives.
> (IIRC, there was an attempt to do XDP on egress that went nowhere).
I believe that stranded because it was deemed not feasible to cover the
SKB TX path as well, which means it can't be symmetrical to the RX hook.
So we ended up with the in-devmap hook instead. I'm not sure if that's
made easier by multi-buf XDP, so that may be worth revisiting.
For the TX metadata you don't really have to care about the skb path, I
suppose, so that may not matter too much either. However, at least for
the in-kernel xdp_frame the TX path is pushed from the stack anyway, so
I'm not sure if it's worth having a separate hook in the driver (with
all the added complexity and overhead that entails) just to set
metadata? That could just as well be done on push from higher up the
stack; per-driver kfuncs could still be useful for this, though.
And of course something would be needed so that that BPF programs can
process AF_XDP frames in the kernel before they hit the driver, but
again I'm not sure that needs to be a hook in the driver.
In any case, the above is just my immediate brain dump (I've been
mulling these things over for a while in relation to the queueing
stuff), and I'd certainly welcome more discussion on the subject! :)
-Toke
next prev parent reply other threads:[~2023-02-23 23:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-23 22:23 [LSF/MM/BPF TOPIC] XDP metadata for TX Stanislav Fomichev
2023-02-23 23:22 ` Toke Høiland-Jørgensen [this message]
2023-02-23 23:51 ` Stanislav Fomichev
2023-02-27 14:17 ` Toke Høiland-Jørgensen
2023-02-27 20:03 ` Stanislav Fomichev
2023-02-27 23:54 ` Toke Høiland-Jørgensen
2023-02-28 21:18 ` Stanislav Fomichev
2023-02-28 22:09 ` Toke Høiland-Jørgensen
2023-02-28 23:02 ` Stanislav Fomichev
2023-02-28 23:08 ` Toke Høiland-Jørgensen
2023-03-03 7:42 ` Magnus Karlsson
2023-03-03 12:37 ` Toke Høiland-Jørgensen
2023-03-03 17:16 ` Stanislav Fomichev
2023-03-07 19:32 ` Jesper Dangaard Brouer
2023-03-09 18:04 ` Stanislav Fomichev
2023-03-10 11:09 ` Jesper Dangaard Brouer
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=874jrcklvf.fsf@toke.dk \
--to=toke@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=sdf@google.com \
/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