netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Aaron Conole <aconole@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
	Florian Westphal <fw@strlen.de>,
	John Fastabend <john.fastabend@gmail.com>,
	Jesper Brouer <brouer@redhat.com>,
	"David S . Miller" <davem@davemloft.net>,
	Andy Gospodarek <andy@greyhouse.net>,
	Rony Efraim <ronye@mellanox.com>,
	Simon Horman <horms@verge.net.au>,
	Marcelo Leitner <marcelo.leitner@gmail.com>
Subject: Re: [RFC -next v0 1/3] bpf: modular maps
Date: Wed, 28 Nov 2018 20:19:50 -0800	[thread overview]
Message-ID: <20181129041948.pepdcksplt6xppk3@ast-mbp> (raw)
In-Reply-To: <f7to9a99gsh.fsf@dhcp-25.97.bos.redhat.com>

On Wed, Nov 28, 2018 at 01:51:42PM -0500, Aaron Conole wrote:
> Alexei Starovoitov <alexei.starovoitov@gmail.com> writes:
> 
> > On Tue, Nov 27, 2018 at 09:24:05AM -0500, Aaron Conole wrote:
> >> 
> >>   1. Introduce flowmap again, this time, basically having it close to a
> >>      copy of the hashmap.  Introduce a few function calls that allow an
> >>      external module to easily manipulate all maps of that type to insert
> >>      / remove / update entries.  This makes it similar to, for example,
> >>      devmap.
> >
> > what is a flowmap?
> > How is this flowmap different from existing hash, lpm and lru maps?
> 
> The biggest difference is how relationship works.  Normal map would
> have single key and single value.  Flow map needs to have two keys
> "single-value," because there are two sets of flow tuples to track
> (forward and reverse direction).  That means that when updating the k-v
> pairs, we need to ensure that the data is always consistent and up to
> date.  Probably we could do that with the existing maps if we had some
> kind of allocation mechanism, too (so, keep a pointer to data from two
> keys - not sure if there's a way to do that in ebpf)?

just swap the src/dst ips inside bpf program depending on direction
and use the same hash map.
That's what xdp/bpf users already do pretty successfully.
bpf hash map is already offloaded into hw too.

> forward direction addresses could be different from reverse direction so
> just swapping addresses / ports will not match).

That makes no sense to me. What would be an example of such flow?
Certainly not a tcp flow.

> That lets us use xdp as a fast forwarding path for
> connections, getting all of the advantage of helper modules to do the
> control / parsing, and all the advantage of xdp for packet movement.

>From 10k feet view it sounds correct, but details make no sense.
You're saying doing nat in the stack, but that _is_ the packet movement
where you wanted to use xdp.

  reply	other threads:[~2018-11-29  4:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-25 18:09 [RFC -next v0 0/3] netfilter: expose flow offload tables as an ebpf map Aaron Conole
2018-11-25 18:09 ` [RFC -next v0 1/3] bpf: modular maps Aaron Conole
2018-11-27  2:06   ` Alexei Starovoitov
2018-11-27 14:24     ` Aaron Conole
2018-11-28  5:10       ` Alexei Starovoitov
2018-11-28 18:51         ` Aaron Conole
2018-11-29  4:19           ` Alexei Starovoitov [this message]
2018-11-30 13:49             ` Aaron Conole
2018-12-05  2:49               ` Alexei Starovoitov
2018-12-10 16:49                 ` Aaron Conole
2018-11-25 18:09 ` [RFC -next v0 2/3] netfilter: nf_flow_table: support a new 'snoop' mode Aaron Conole
2018-11-25 18:09 ` [RFC -next v0 3/3] netfilter: nf_flow_table_bpf_map: introduce new loadable bpf map Aaron Conole

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=20181129041948.pepdcksplt6xppk3@ast-mbp \
    --to=alexei.starovoitov@gmail.com \
    --cc=aconole@redhat.com \
    --cc=andy@greyhouse.net \
    --cc=ast@kernel.org \
    --cc=brouer@redhat.com \
    --cc=coreteam@netfilter.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=horms@verge.net.au \
    --cc=john.fastabend@gmail.com \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=ronye@mellanox.com \
    /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).