Re: Xdp multiple sockets over several interfaces

Magnus Karlsson <[email protected]> Thu, 5 Feb 2026 18:13:04 +0100
Newsgroups org.kernel.vger.xdp-newbies
Message-ID <CAJ8uoz2Nhj27XDDkwTsXnbBOyugMROQD2jsVE7k=C8kcFYVbeQ@mail.gmail.com>
On Thu, 5 Feb 2026 at 17:39, Matthew Bannister
<[email protected]> wrote:
>
>      [DTL0]
>
> Hello,
>
> I am having a problem with creating multiple sockets from several interfa=
ces. I create them all with `xsk_socket__create_shared`, from reading the L=
inux docs, my understanding was that I can create any number of sockets sha=
ring the same umem if each unique interface/queue tuple has their own fill/=
comp rings.
>
> I can create as many sockets as I can if using one interface but then whe=
n I bind my next interface with its own fill/comp rings any subsequent sock=
ets cause the xdp_bind to fail with (22 - invalid arguments). I can see thi=
s is due to us checking against the first netdev device bound to the umem. =
Meaning any subsequent sockets from any other interface are treated as uniq=
ue and therefore fail because either they are duplicates or passed with no =
fill/comp rings.
>
> From briefly reading over `xdp_bind` in net/xdp/xsk.c I=E2=80=99m thinkin=
g there would need to be a list of previously made sockets (not just tx) th=
at can be checked to determine if the new socket is has a unique netdev and=
/or queue.
>
> I stumbled across this gitlab post of someone asking for this functionali=
ty: https://github.com/xdp-project/bpf-examples/issues/85.
> Are there any plans to implement this?

Not from my side, but the feature would be welcome if someone took a stab a=
t it.

> Thanks,
>
> Matt Bannister
>
>
> --
> Matthew Bannister
> Software Engineer, Darktrace Holdings LTD
> [email protected]
>
>
>
>
>
>
>
>      [DTL0]