From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Liping Zhang <zlpnobody@gmail.com>
Cc: Netfilter Developer Mailing List <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH 1/2 nf] netfilter: nft_set_bitmap: keep a list of dummy elements
Date: Mon, 13 Mar 2017 18:23:44 +0100 [thread overview]
Message-ID: <20170313172344.GA32297@salvia> (raw)
In-Reply-To: <CAML_gOf5DM6W81b34EQQz+hdsFb-72jq4BhtRK4d2657Ks9bHg@mail.gmail.com>
Hi Liping,
On Mon, Mar 13, 2017 at 10:23:53PM +0800, Liping Zhang wrote:
> Hi Pablo,
>
> 2017-03-13 20:27 GMT+08:00 Pablo Neira Ayuso <pablo@netfilter.org>:
> > Element comments may come without any prior set flag, so we have to keep
> > a list of dummy struct nft_set_ext to keep this information around. This
> > is only useful for set dumps to userspace. From the packet path, this
> > set type relies on the bitmap representation. This patch simplifies the
> > logic since we don't need to allocate the dummy nft_set_ext structure
> > anymore on the fly at the cost of increasing memory consumption because
> > of the list of dummy struct nft_set_ext.
>
> If I didn't misunderstand it, I think after introducing the dummy nft_set_ext,
> the nft_bitmap_estimate() should also be updated? i.e.:
>
> 1. est->size should be recalculated
> 2. est->space should be changed to NFT_SET_CLASS_O_N
I would like this only describes the representation that is exposed to
the packet path, not the real memory consumption of it. I know I'm
kind of cheating, but with this I'm also giving this bitmap an
advantage over the hashtable representation, the performance numbers I
gathered here when evaluating it are better.
Anyway, I'll be fine if this triggers some discussions on the set
backend selection at some point, as well as more detailed performance
evaluation. Note this big O notation just tell about the scalability.
Size provides an accurate way to measure how much memory this consumes
but only if userspace tells us how many elements we're going to add
beforehand. On the CPU side, we have no such specific metric as the
memory size. Probably we can introduce some generic cycle metric that
represents the cost of the lookup path, this won't be simple as this
number is not deterministic since there are many things to consider,
so we have to agree on how we calculate this pseudo-metric.
next prev parent reply other threads:[~2017-03-13 17:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-13 12:27 [PATCH 1/2 nf] netfilter: nft_set_bitmap: keep a list of dummy elements Pablo Neira Ayuso
2017-03-13 12:27 ` [PATCH 2/2 nf] Revert "netfilter: nf_tables: add flush field to struct nft_set_iter" Pablo Neira Ayuso
2017-03-13 14:23 ` [PATCH 1/2 nf] netfilter: nft_set_bitmap: keep a list of dummy elements Liping Zhang
2017-03-13 17:23 ` Pablo Neira Ayuso [this message]
2017-03-14 9:04 ` Liping Zhang
2017-03-14 10:21 ` Pablo Neira Ayuso
2017-03-14 12:19 ` Pablo Neira Ayuso
2017-03-14 14:44 ` Liping Zhang
2017-03-14 15:21 ` Pablo Neira Ayuso
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=20170313172344.GA32297@salvia \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=zlpnobody@gmail.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).