[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ+HfNiuag3MQ94K__vWfpS5wqTtzSs839t_cKQTpw1k_QZeYQ@mail.gmail.com>
Date: Wed, 10 Jun 2020 13:12:37 +0200
From: Björn Töpel <bjorn.topel@...il.com>
To: Toke Høiland-Jørgensen <toke@...hat.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
bpf <bpf@...r.kernel.org>,
John Fastabend <john.fastabend@...il.com>,
Björn Töpel <bjorn.topel@...el.com>,
"Karlsson, Magnus" <magnus.karlsson@...el.com>,
Netdev <netdev@...r.kernel.org>,
Jesper Dangaard Brouer <brouer@...hat.com>,
"Fijalkowski, Maciej" <maciej.fijalkowski@...el.com>
Subject: Re: [RFC PATCH bpf-next 2/2] i40e: avoid xdp_do_redirect() call when
"redirect_tail_call" is set
On Tue, 9 Jun 2020 at 21:47, Toke Høiland-Jørgensen <toke@...hat.com> wrote:
>
> Björn Töpel <bjorn.topel@...il.com> writes:
>
> > From: Björn Töpel <bjorn.topel@...el.com>
> >
> > If an XDP program, where all the bpf_redirect_map() calls are tail
> > calls (as defined by the previous commit), the driver does not need to
> > explicitly call xdp_do_redirect().
> >
> > The driver checks the active XDP program, and notifies the BPF helper
> > indirectly via xdp_set_redirect_tailcall().
> >
> > This is just a naive, as-simple-as-possible implementation, calling
> > xdp_set_redirect_tailcall() for each packet.
>
> Do you really need the driver changes? The initial setup could be moved
> to bpf_prog_run_xdp(), and xdp_do_redirect() could be changed to an
> inline wrapper that just checks a flag and immediately returns 0 if the
> redirect action was already performed. Or am I missing some reason why
> this wouldn't work?
>
Indeed! That's a good idea!
Björn
> -Toke
>
Powered by blists - more mailing lists