[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <B5115F94-B2CA-429A-BEA0-6A7EA1F6A522@gmail.com>
Date: Mon, 24 Jun 2019 09:41:12 -0700
From: "Jonathan Lemon" <jonathan.lemon@...il.com>
To: "Toke Høiland-Jørgensen" <toke@...hat.com>
Cc: netdev@...r.kernel.org,
"Jesper Dangaard Brouer" <brouer@...hat.com>,
"Daniel Borkmann" <daniel@...earbox.net>,
"Alexei Starovoitov" <ast@...nel.org>,
"David Miller" <davem@...emloft.net>
Subject: Re: [PATCH bpf-next v5 2/3] bpf_xdp_redirect_map: Perform map lookup
in eBPF helper
On 22 Jun 2019, at 19:17, Toke Høiland-Jørgensen wrote:
> From: Toke Høiland-Jørgensen <toke@...hat.com>
>
> 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 patch fixes this by moving the map lookup into the bpf_redirect_map()
> helper, which makes it possible to return failure to the eBPF program. The
> lower bits of the flags argument is used as the return code, which means
> that existing users who pass a '0' flag argument will get XDP_ABORTED.
>
> With this, a BPF program can check the return code from the helper call and
> react by, for instance, substituting a different redirect. This works for
> any type of map used for redirect.
>
> Signed-off-by: Toke Høiland-Jørgensen <toke@...hat.com>
Acked-by: Jonathan Lemon <jonathan.lemon@...il.com>
Powered by blists - more mailing lists