bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: "Björn Töpel" <bjorn.topel@gmail.com>,
	"Alexei Starovoitov" <alexei.starovoitov@gmail.com>,
	"Network Development" <netdev@vger.kernel.org>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	bpf <bpf@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <jakub.kicinski@netronome.com>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Karlsson, Magnus" <magnus.karlsson@intel.com>,
	"Jonathan Lemon" <jonathan.lemon@gmail.com>,
	brouer@redhat.com
Subject: Re: [PATCH bpf-next v2 0/8] Simplify xdp_do_redirect_map()/xdp_do_flush_map() and XDP maps
Date: Tue, 07 Jan 2020 15:18:38 +0100	[thread overview]
Message-ID: <87o8vfic3l.fsf@toke.dk> (raw)
In-Reply-To: <20200107145204.76710703@carbon>

Jesper Dangaard Brouer <brouer@redhat.com> writes:

> On Tue, 07 Jan 2020 14:27:41 +0100
> Toke Høiland-Jørgensen <toke@redhat.com> wrote:
>
>> Jesper Dangaard Brouer <brouer@redhat.com> writes:
>> 
>> > On Tue, 07 Jan 2020 12:25:47 +0100
>> > Toke Høiland-Jørgensen <toke@redhat.com> wrote:
>> >  
>> >> Björn Töpel <bjorn.topel@gmail.com> writes:
>> >>   
>> >> > On Fri, 20 Dec 2019 at 11:30, Toke Høiland-Jørgensen <toke@redhat.com> wrote:    
>> >> >>
>> >> >> Jesper Dangaard Brouer <brouer@redhat.com> writes:
>> >> >>    
>> >> > [...]    
>> >> >> > I have now went over the entire patchset, and everything look perfect,
>> >> >> > I will go as far as saying it is brilliant.  We previously had the
>> >> >> > issue, that using different redirect maps in a BPF-prog would cause the
>> >> >> > bulking effect to be reduced, as map_to_flush cause previous map to get
>> >> >> > flushed. This is now solved :-)    
>> >> >>
>> >> >> Another thing that occurred to me while thinking about this: Now that we
>> >> >> have a single flush list, is there any reason we couldn't move the
>> >> >> devmap xdp_bulk_queue into struct net_device? That way it could also be
>> >> >> used for the non-map variant of bpf_redirect()?
>> >> >>    
>> >> >
>> >> > Indeed! (At least I don't see any blockers...)    
>> >> 
>> >> Cool, that's what I thought. Maybe I'll give that a shot, then, unless
>> >> you beat me to it ;)  
>> >  
>> > Generally sounds like a good idea.
>> >
>> > It this only for devmap xdp_bulk_queue?  
>> 
>> Non-map redirect only supports redirecting across interfaces (the
>> parameter is an ifindex), so yeah, this would be just for that.
>
> Sure, then you don't need to worry about below gotchas.
>
> I do like the idea, as this would/should solve the non-map redirect
> performance issue.

Yes, that was exactly my thought. Taking a stab at it now... :)

>> > Some gotchas off the top of my head.
>> >
>> > The cpumap also have a struct xdp_bulk_queue, which have a different
>> > layout. (sidenote: due to BTF we likely want rename that).
>> >
>> > If you want to generalize this across all redirect maps type. You
>> > should know, that it was on purpose that I designed the bulking to be
>> > map specific, because that allowed each map to control its own optimal
>> > bulking.  E.g. devmap does 16 frames bulking, cpumap does 8 frames (as
>> > it matches sending 1 cacheline into underlying ptr_ring), xskmap does
>> > 64 AFAIK (which could hurt-latency, but that is another discussion).  
>> 
>> Björn's patches do leave the per-type behaviour, they just get rid of
>> the per-map flush queues... :)
>
> Yes, I know ;-)

I know you do; was just a bit puzzled why you brought up all that other
stuff, and, well, had to answer something, didn't I? ;)

-Toke


      reply	other threads:[~2020-01-07 14:18 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19  6:09 [PATCH bpf-next v2 0/8] Simplify xdp_do_redirect_map()/xdp_do_flush_map() and XDP maps Björn Töpel
2019-12-19  6:09 ` [PATCH bpf-next v2 1/8] xdp: simplify devmap cleanup Björn Töpel
2020-01-07 17:32   ` John Fastabend
2020-01-08 10:08     ` Björn Töpel
2019-12-19  6:10 ` [PATCH bpf-next v2 2/8] xdp: simplify cpumap cleanup Björn Töpel
2019-12-19  6:10 ` [PATCH bpf-next v2 3/8] xdp: fix graze->grace type-o in cpumap comments Björn Töpel
2020-01-07 17:33   ` John Fastabend
2019-12-19  6:10 ` [PATCH bpf-next v2 4/8] xsk: make xskmap flush_list common for all map instances Björn Töpel
2020-01-07 17:54   ` John Fastabend
2020-01-08 10:13     ` Björn Töpel
2020-01-08 15:52       ` John Fastabend
2020-01-08 16:01         ` Toke Høiland-Jørgensen
2019-12-19  6:10 ` [PATCH bpf-next v2 5/8] xdp: make devmap " Björn Töpel
2020-01-07 17:58   ` John Fastabend
2020-01-08 10:16     ` Björn Töpel
2020-01-08 10:23       ` Toke Høiland-Jørgensen
2020-01-08 10:25         ` Björn Töpel
2019-12-19  6:10 ` [PATCH bpf-next v2 6/8] xdp: make cpumap " Björn Töpel
2020-01-07 17:59   ` John Fastabend
2019-12-19  6:10 ` [PATCH bpf-next v2 7/8] xdp: remove map_to_flush and map swap detection Björn Töpel
2020-01-07 18:15   ` John Fastabend
2020-01-07 21:07     ` Toke Høiland-Jørgensen
2020-01-08  3:45       ` John Fastabend
2020-01-08 10:24         ` Björn Töpel
2019-12-19  6:10 ` [PATCH bpf-next v2 8/8] xdp: simplify __bpf_tx_xdp_map() Björn Töpel
2019-12-19  7:18 ` [PATCH bpf-next v2 0/8] Simplify xdp_do_redirect_map()/xdp_do_flush_map() and XDP maps Jesper Dangaard Brouer
2019-12-20  5:21 ` Alexei Starovoitov
2019-12-20  7:46   ` Jesper Dangaard Brouer
2019-12-20  9:26     ` Jesper Dangaard Brouer
2019-12-20 10:29       ` Toke Høiland-Jørgensen
2020-01-07 11:10         ` Björn Töpel
2020-01-07 11:25           ` Toke Høiland-Jørgensen
2020-01-07 13:05             ` Jesper Dangaard Brouer
2020-01-07 13:27               ` Toke Høiland-Jørgensen
2020-01-07 13:52                 ` Jesper Dangaard Brouer
2020-01-07 14:18                   ` 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=87o8vfic3l.fsf@toke.dk \
    --to=toke@redhat.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=john.fastabend@gmail.com \
    --cc=jonathan.lemon@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).