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@intel.com>,
	"Björn Töpel" <bjorn.topel@gmail.com>,
	ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org,
	bpf@vger.kernel.org
Cc: maciej.fijalkowski@intel.com, hawk@kernel.org,
	magnus.karlsson@intel.com, john.fastabend@gmail.com,
	kuba@kernel.org, davem@davemloft.net
Subject: Re: [PATCH bpf-next v4 0/2] Optimize bpf_redirect_map()/xdp_do_redirect()
Date: Fri, 26 Feb 2021 12:43:07 +0100	[thread overview]
Message-ID: <87pn0nyrzo.fsf@toke.dk> (raw)
In-Reply-To: <1759bd57-0c52-d1f2-d620-e7796f95cff6@intel.com>

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

> On 2021-02-26 12:35, Toke Høiland-Jørgensen wrote:
>> Björn Töpel <bjorn.topel@gmail.com> writes:
>> 
>>> Hi XDP-folks,
>>>
>>> This two patch series contain two optimizations for the
>>> bpf_redirect_map() helper and the xdp_do_redirect() function.
>>>
>>> The bpf_redirect_map() optimization is about avoiding the map lookup
>>> dispatching. Instead of having a switch-statement and selecting the
>>> correct lookup function, we let bpf_redirect_map() be a map operation,
>>> where each map has its own bpf_redirect_map() implementation. This way
>>> the run-time lookup is avoided.
>>>
>>> The xdp_do_redirect() patch restructures the code, so that the map
>>> pointer indirection can be avoided.
>>>
>>> Performance-wise I got 3% improvement for XSKMAP
>>> (sample:xdpsock/rx-drop), and 4% (sample:xdp_redirect_map) on my
>>> machine.
>>>
>>> More details in each commit.
>>>
>>> @Jesper/Toke I dropped your Acked-by: on the first patch, since there
>>> were major restucturing. Please have another look! Thanks!
>> 
>> Will do! Did you update the performance numbers above after that change?
>>
>
> I did. The XSKMAP performance stayed the same (no surprise, since the
> code was the same). However, for the DEVMAP the v4 got rid of a call, so
> it *should* be a bit better, but for some reason it didn't show on my
> machine.

Alright, fair enough - pesky real world not lining up with expectations!
Maybe Jesper has additional suggestions, but I can live with the 4%
improvement ;)

-Toke


      reply	other threads:[~2021-02-26 11:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-26 11:23 [PATCH bpf-next v4 0/2] Optimize bpf_redirect_map()/xdp_do_redirect() Björn Töpel
2021-02-26 11:23 ` [PATCH bpf-next v4 1/2] bpf, xdp: make bpf_redirect_map() a map operation Björn Töpel
2021-02-26 11:37   ` Toke Høiland-Jørgensen
2021-02-26 11:40     ` Björn Töpel
2021-02-26 12:04       ` Björn Töpel
2021-02-26 12:26         ` Toke Høiland-Jørgensen
2021-02-26 14:28           ` Jesper Dangaard Brouer
2021-02-26 14:27       ` Jesper Dangaard Brouer
2021-02-26 14:29     ` Jesper Dangaard Brouer
2021-02-26 15:23   ` kernel test robot
2021-02-26 15:23     ` kernel test robot
2021-02-26 21:48   ` Daniel Borkmann
2021-02-27  9:04     ` Björn Töpel
2021-02-27 10:22       ` Daniel Borkmann
2021-02-26 11:23 ` [PATCH bpf-next v4 2/2] bpf, xdp: restructure redirect actions Björn Töpel
2021-02-26 11:35 ` [PATCH bpf-next v4 0/2] Optimize bpf_redirect_map()/xdp_do_redirect() Toke Høiland-Jørgensen
2021-02-26 11:38   ` Björn Töpel
2021-02-26 11:43     ` Toke Høiland-Jørgensen [this message]

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=87pn0nyrzo.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=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --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.