XDP-Newbies Archive mirror
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Henning Fehrmann <henning.fehrmann@aei.mpg.de>,
	"xdp-newbies@vger.kernel.org" <xdp-newbies@vger.kernel.org>
Cc: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Subject: Re: make XDP program aware of multi buffer
Date: Wed, 30 Nov 2022 14:11:03 +0100	[thread overview]
Message-ID: <87wn7cy4d4.fsf@toke.dk> (raw)
In-Reply-To: <Y4caS5Bh7M9SDJf9@mephisto.aei.uni-hannover.de>

Henning Fehrmann <henning.fehrmann@aei.mpg.de> writes:

>> You just replace:
>> 
>> SEC("xdp")
>> 
>> with
>> 
>> SEC("xdp.frags")
>> 
>> in your source file and, assuming your libbpf version is up-to-date,
>> that should be it as far as the kernel is concerned.
>
> Nice. It loads now. I appreciate the work done for multi buffer packets.

Cool!

>> However, you obviously also need to make sure there are no semantic
>> issues in your program before doing this. I.e., data_end is no longer
>> the end of your packet, so if you are using data_end-data to calculate
>> the packet len, that will no longer be accurate. If you need to access
>> data beyond the first frag you'll need to use the
>> xdp_{load,store}_bytes() helpers.
>
> I guess, this is not the case or does bpf_redirect needs it if I have
> multi frame packets?
> I realized that redirection actually doesn't happen if the packets
> exceed the page size.

No, XDP_REDIRECT is not supported at all for multi-frame packets:
https://elixir.bootlin.com/linux/latest/source/net/core/filter.c#L4278

Cc Lorenzo who was looking into enabling this at some point...

-Toke


      reply	other threads:[~2022-11-30 13:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 12:14 make XDP program aware of multi buffer Henning Fehrmann
2022-11-29 13:24 ` Toke Høiland-Jørgensen
2022-11-30  8:54   ` Henning Fehrmann
2022-11-30 13:11     ` 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=87wn7cy4d4.fsf@toke.dk \
    --to=toke@redhat.com \
    --cc=henning.fehrmann@aei.mpg.de \
    --cc=lorenzo.bianconi@redhat.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 read-only IMAP folder(s) and NNTP newsgroup(s).