On 5 Jun 2019, at 3:39, Jesper Dangaard Brouer wrote:
On Tue, 04 Jun 2019 17:24:10 +0200
Toke Høiland-Jørgensen <t...@redhat.com> wrote:
The bpf_redirect_map() helper used by XDP programs doesn't return any
indication of whether it can successfully redirect to the map index
it was
given. Instead, BPF programs have to track this themselves, leading
to
programs using duplicate maps to track which entries are populated in
the
devmap.
This adds a flag to the XDP version of the bpf_redirect_map() helper,
which
makes the helper do a lookup in the map when called, and return
XDP_PASS if
there is no value at the provided index. This enables two use cases:
To Jonathan Lemon, notice this approach of adding a flag to the helper
call, it actually also works for your use-case of XSK AF_XDP maps.c
Hmm, yes, that should work also.
I have a patch which returns a XDP_SOCK type from the xskmap.
This could be used with a new helper for redirection directly to a
socket
(instead of looking the socket up a second time).
While flexible, the downside is that this won't apply to devmaps.
--
Jonathan