All of lore.kernel.org
 help / color / mirror / Atom feed
* XDP and AF_XDP
@ 2020-08-18  6:49 Michael A. Flückiger
  2020-08-18 10:10 ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 2+ messages in thread
From: Michael A. Flückiger @ 2020-08-18  6:49 UTC (permalink / raw)
  To: xdp-newbies

Hi all

I've recently discovered XDP / AF_XDP, and I now familiarize myself with 
the very interesting technology. Two questions came up, and I'm sure 
that the XDP community will be able to answer them a lot faster than if 
I search for documents in the www jungle.. :)

- An user land application is able to read and process incoming data 
directly from the AF_XDP socket. I'm wondering what happens when an 
application writes data into the AF_XDP socket? Are these frames 
directly sent out on the respective network interface?

- Whats the current status on XDP support on TX? Is it possible to 
intercept the TX queue (outgoing packets) or is still "just" the 
processing of incoming packets possible? Where could I find documents 
covering such updates?

Thanks for your effort!

Best,

Michi

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: XDP and AF_XDP
  2020-08-18  6:49 XDP and AF_XDP Michael A. Flückiger
@ 2020-08-18 10:10 ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 2+ messages in thread
From: Toke Høiland-Jørgensen @ 2020-08-18 10:10 UTC (permalink / raw)
  To: Michael A. Flückiger, xdp-newbies

Michael A. Flückiger <fmichael@student.ethz.ch> writes:

> Hi all
>
> I've recently discovered XDP / AF_XDP, and I now familiarize myself with 
> the very interesting technology. Two questions came up, and I'm sure 
> that the XDP community will be able to answer them a lot faster than if 
> I search for documents in the www jungle.. :)
>
> - An user land application is able to read and process incoming data 
> directly from the AF_XDP socket. I'm wondering what happens when an 
> application writes data into the AF_XDP socket? Are these frames 
> directly sent out on the respective network interface?

You can send packets from AF_XDP as well, but it's not a regular socket.
Please see the documentation here:
https://www.kernel.org/doc/html/latest/networking/af_xdp.html

> - Whats the current status on XDP support on TX? Is it possible to 
> intercept the TX queue (outgoing packets) or is still "just" the 
> processing of incoming packets possible? Where could I find documents 
> covering such updates?

There's no 'XDP TX' hook, but there are a few other options: When
redirecting packets via the bpf_redirect_map() helper, you can attach a
second XDP program to the map entries, which gives you a "post-redirect"
hook that is tied to the destination. This is analogous to an XDP hook
on TX, but only for packets that were redirected from XDP.

For packets coming from the regular networking stack, you can use the TC
eBPF hook to modify traffic instead; it is possible to write eBPF
programs that can be reused across the XDP and TC hooks (basically, by
putting the logic in a function that you call from a small wrapper
function in each hook type).

-Toke

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-18 10:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-18  6:49 XDP and AF_XDP Michael A. Flückiger
2020-08-18 10:10 ` Toke Høiland-Jørgensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.