All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: "Michael A. Flückiger" <fmichael@student.ethz.ch>,
	xdp-newbies@vger.kernel.org
Subject: Re: XDP and AF_XDP
Date: Tue, 18 Aug 2020 12:10:16 +0200	[thread overview]
Message-ID: <87lficuuwn.fsf@toke.dk> (raw)
In-Reply-To: <44904e04-b9f5-0e9e-9b67-8ccfeded852e@student.ethz.ch>

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

      reply	other threads:[~2020-08-18 10:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18  6:49 XDP and AF_XDP Michael A. Flückiger
2020-08-18 10:10 ` 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=87lficuuwn.fsf@toke.dk \
    --to=toke@redhat.com \
    --cc=fmichael@student.ethz.ch \
    --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 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.