All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: "Björn Töpel" <bjorn.topel@gmail.com>,
	ast@kernel.org, daniel@iogearbox.net, bpf@vger.kernel.org,
	john.fastabend@gmail.com
Cc: "Björn Töpel" <bjorn.topel@intel.com>,
	magnus.karlsson@intel.com, netdev@vger.kernel.org,
	brouer@redhat.com, maciej.fijalkowski@intel.com
Subject: Re: [RFC PATCH bpf-next 2/2] i40e: avoid xdp_do_redirect() call when "redirect_tail_call" is set
Date: Tue, 09 Jun 2020 21:47:46 +0200	[thread overview]
Message-ID: <87r1uo81i5.fsf@toke.dk> (raw)
In-Reply-To: <20200609172622.37990-3-bjorn.topel@gmail.com>

Björn Töpel <bjorn.topel@gmail.com> writes:

> From: Björn Töpel <bjorn.topel@intel.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?

-Toke


  reply	other threads:[~2020-06-09 19:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 17:26 [RFC PATCH bpf-next 0/2] bpf_redirect_map() tail call detection and xdp_do_redirect() avoidance Björn Töpel
2020-06-09 17:26 ` [RFC PATCH bpf-next 1/2] bpf, xdp: add naive bpf_redirect_map() tail call detection Björn Töpel
2020-06-09 17:26 ` [RFC PATCH bpf-next 2/2] i40e: avoid xdp_do_redirect() call when "redirect_tail_call" is set Björn Töpel
2020-06-09 19:47   ` Toke Høiland-Jørgensen [this message]
2020-06-10 11:12     ` Björn Töpel
2020-06-09 20:10 ` [RFC PATCH bpf-next 0/2] bpf_redirect_map() tail call detection and xdp_do_redirect() avoidance Toke Høiland-Jørgensen
2020-06-10 12:21   ` Jesper Dangaard Brouer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r1uo81i5.fsf@toke.dk \
    --to=toke@redhat.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@gmail.com \
    --cc=bjorn.topel@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.