[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <30778336-BD88-4959-95CC-79443152EC7F@gmail.com>
Date: Wed, 05 Jun 2019 08:09:50 -0700
From: "Jonathan Lemon" <jonathan.lemon@...il.com>
To: "Jesper Dangaard Brouer" <brouer@...hat.com>
Cc: "Toke Høiland-Jørgensen" <toke@...hat.com>,
"David Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
"Daniel Borkmann" <daniel@...earbox.net>,
"Alexei Starovoitov" <ast@...nel.org>
Subject: Re: [PATCH net-next 1/2] bpf_xdp_redirect_map: Add flag to return
XDP_PASS on map lookup failure
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 <toke@...hat.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
Powered by blists - more mailing lists