From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Magnus Karlsson <magnus.karlsson@gmail.com>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: magnus.karlsson@intel.com, bjorn@kernel.org, ast@kernel.org,
daniel@iogearbox.net, netdev@vger.kernel.org,
maciej.fijalkowski@intel.com, bpf@vger.kernel.org,
YuvalE@radware.com
Subject: Re: [PATCH bpf 0/2] Revert "xsk: support redirect to any socket bound to the same umem"
Date: Wed, 05 Jun 2024 15:28:20 -0400 [thread overview]
Message-ID: <6660bc547b59b_35916d294d1@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <CAJ8uoz0Zfv3rsLCuza2MW7Km-eU2sH1CDB1V_WHJ2vMAft_EmQ@mail.gmail.com>
Magnus Karlsson wrote:
> On Wed, 5 Jun 2024 at 01:03, Willem de Bruijn
> <willemdebruijn.kernel@gmail.com> wrote:
> >
> > Magnus Karlsson wrote:
> > > Revert "xsk: support redirect to any socket bound to the same umem"
> > >
> > > This patch introduced a potential kernel crash when multiple napi
> > > instances redirect to the same AF_XDP socket. By removing the
> > > queue_index check, it is possible for multiple napi instances to
> > > access the Rx ring at the same time, which will result in a corrupted
> > > ring state which can lead to a crash when flushing the rings in
> > > __xsk_flush(). This can happen when the linked list of sockets to
> > > flush gets corrupted by concurrent accesses. A quick and small fix is
> > > unfortunately not possible, so let us revert this for now.
> >
> > This is a very useful feature, to be able to use AF_XDP sockets with
> > a standard RSS nic configuration.
>
> I completely agree.
>
> > Not all AF_XDP use cases require the absolute highest packet rate.
> >
> > Can this be addressed with an optional spinlock on the RxQ, only for
> > this case?
>
> Yes, or with a MPSC ring implementation.
>
> > If there is no simple enough fix in the short term, do you plan to
> > reintroduce this in another form later?
>
> Yuval and I are looking into a solution based around an optional
> spinlock since it is easier to pull off than an MPSC ring. The
> discussion is on-going on the xdp-newbies list [0], but as soon as we
> have a first patch, we will post it here for review and debate.
>
> [0] https://lore.kernel.org/xdp-newbies/8100DBDC-0B7C-49DB-9995-6027F6E63147@radware.com/
Glad to hear that it's intended to be supported, and even being worked
on, thanks! I'll follow the conversation there.
next prev parent reply other threads:[~2024-06-05 19:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-04 12:29 [PATCH bpf 0/2] Revert "xsk: support redirect to any socket bound to the same umem" Magnus Karlsson
2024-06-04 12:29 ` [PATCH bpf 1/2] " Magnus Karlsson
2024-06-04 12:29 ` [PATCH bpf 2/2] Revert "xsk: document ability to " Magnus Karlsson
2024-06-04 23:03 ` [PATCH bpf 0/2] Revert "xsk: support " Willem de Bruijn
2024-06-05 7:45 ` Magnus Karlsson
2024-06-05 19:28 ` Willem de Bruijn [this message]
2024-06-05 7:50 ` patchwork-bot+netdevbpf
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=6660bc547b59b_35916d294d1@willemb.c.googlers.com.notmuch \
--to=willemdebruijn.kernel@gmail.com \
--cc=YuvalE@radware.com \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@gmail.com \
--cc=magnus.karlsson@intel.com \
--cc=netdev@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