Merge branch 'xsk-support-redirect-to-any-socket-bound-to-the-same-umem'
authorAlexei Starovoitov <ast@kernel.org>
Tue, 6 Feb 2024 04:01:16 +0000 (20:01 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 6 Feb 2024 04:01:16 +0000 (20:01 -0800)
commit6146fae67bc2b92100bff8b2d6a6d5bca07edcf8
tree184a5ef5d57f5436659e316c00afad07861ff33f
parent20a286c1a35ba4dc2fca5d4c1fb2e7ced101e576
parent968595a93669b6b4f6d1fcf80cf2d97956b6868f
Merge branch 'xsk-support-redirect-to-any-socket-bound-to-the-same-umem'

Magnus Karlsson says:

====================
xsk: support redirect to any socket bound to the same umem

This patch set adds support for directing a packet to any socket bound
to the same umem. This makes it possible to use the XDP program to
select what socket the packet should be received on. The user can
populate the XSKMAP with various sockets and as long as they share the
same umem, the XDP program can pick any one of them.

The implementation is straight-forward. Instead of testing that the
incoming packet is targeting the same device and queue id as the
socket is bound to, just check that the umem the packet was received
on is the same as the socket we want it to be received on. This
guarantees that the redirect is legal as it is already in the correct
umem.

Patch #1 implements the feature and patch #2 adds documentation.

Thanks: Magnus
====================

Link: https://lore.kernel.org/r/20240205123553.22180-1-magnus.karlsson@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>