bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Magnus Karlsson <magnus.karlsson@gmail.com>
To: "Benoit Ganne (bganne)" <bganne@cisco.com>
Cc: "bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	"Björn Töpel" <bjorn@kernel.org>
Subject: Re: AF_XDP poll() / sendmsg() race + headroom changes
Date: Wed, 12 May 2021 12:02:16 +0200	[thread overview]
Message-ID: <CAJ8uoz3hPH6Ezappjh2FZyMXj0L+qF_92jg7o3mrREyWJ20f4A@mail.gmail.com> (raw)
In-Reply-To: <DM6PR11MB3660A5132EB554ED746C8C92C1529@DM6PR11MB3660.namprd11.prod.outlook.com>

On Wed, May 12, 2021 at 10:26 AM Benoit Ganne (bganne) <bganne@cisco.com> wrote:
>
> Hi Magnus,
>
> >> I am the maintainer of the AF_XDP driver for VPP, an open-source
> >> userspace networking stack, and I ran into an issue recently with kernels
> >> < 5.6 (including LTS kernel 5.4 which is shipped in eg. Ubuntu 20.04 LTS):
> >> it seems like one cannot call poll() and sendmsg() concurrently on the
> >> same AF_XDP socket. Is this a supported usecase?
> [...]
> >> I hit a 2nd issue with kernel >= 5.9, where the headroom on rx for copy
> >> mode has grown from 0 to XDP_PACKET_HEADROOM (256-bytes).
> [...]
>
> > Hi Benoit. Thank you for reporting, I will take a look at this and get
> > back to you. Next time, please add me and Björn on the to line so that
> > you get a quicker response.
>
> Thanks! Sure I will in the future.
> If I may, an ideal scenario would be:
>  1) the concurrent rx/tx usecase is officially supported, and 11cc2d21499cabe7e7964389634ed1de3ee91d33 should be backported to LTS

I will fix this. The (unintentional) fix you refer to should apply
cleanly to 5.4 and 4.19 LTS kernels. I just have to verify this and
submit a request to Greg. Probably with a new commit message that
describes what problem it fixes, since it is not just a simplification
anymore.

>  2) had a way to detect different version of AF_XDP (through an ioctl() or getsockopt() or...) so that I can detect more easily what I should do at init time. Eg. managing both headroom (0 and 256) for copy mode is not very difficult if I can detect it easily

Björn and I have yet to come up with a good way to detect this that
does not involve receiving a packet. Another possible way would be to
backport a fix for this to 5.4 and 4.19 LTS too. But this seems to be
a less straightforward patch, so let us see what that would entail.
Björn is working on this and will get back to you.

>
> Best
> ben

      reply	other threads:[~2021-05-12 10:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 17:44 AF_XDP poll() / sendmsg() race + headroom changes Benoit Ganne (bganne)
2021-05-12  5:35 ` Magnus Karlsson
2021-05-12  8:26   ` Benoit Ganne (bganne)
2021-05-12 10:02     ` Magnus Karlsson [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=CAJ8uoz3hPH6Ezappjh2FZyMXj0L+qF_92jg7o3mrREyWJ20f4A@mail.gmail.com \
    --to=magnus.karlsson@gmail.com \
    --cc=bganne@cisco.com \
    --cc=bjorn@kernel.org \
    --cc=bpf@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).