From: Patrick McHardy <kaber@trash.net>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org
Subject: [RFC PATCH 0/2] netfilter: nf_tables: set selection
Date: Tue, 4 Mar 2014 16:41:05 +0100 [thread overview]
Message-ID: <1393947667-6143-1-git-send-email-kaber@trash.net> (raw)
The following patch adds the beginning of proper set selection based on
a description of the set characteristics.
The basic idea is that userspace provides a description of the set
elements and the kernel selects the best suited implementation according
to a policy provided by userspace (performance/memory).
We have two cases:
- literal (anonymous/constant) sets where all elements are known in advance
- set declarations where elements might or might not be known in advance
In the first case userspace can provide all the information we need, in the
second case the user can provide hints that allow us to select something
based on the expected use case.
So far all the information we need is the maximum amount of elements in the
set. The performance class of both the rbtree and the hash (with resizing)
is fixed, the expected memory use depends purely on the amount of elements.
In case that userspace provides that information, the set implementation
calculate an estimate, otherwise we use the per-element costs to decide.
Instead of adding more information based on what we expect future
implementations might need, I decided to start simple and we can add more
information whenever the need arises for a new set implementation. Since
the type of information required is expected to be quite similar for
most set types, we should approach a state where a new set implementation
will have all the data it needs available. Otherwise things won't fail,
but old userspace might not take advantage of a better suited
implementation.
With these patches in place, we will usually select the hash implementation,
unless we require support for interval lookups, in which case we'll use
the rbtree.
Patches apply on top of the RCU hash resizing patch I just sent.
Comments welcome.
next reply other threads:[~2014-03-04 15:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-04 15:41 Patrick McHardy [this message]
2014-03-04 15:41 ` [RFC PATCH 1/2] netfilter: nf_tables: implement proper set selection Patrick McHardy
2014-03-04 15:41 ` [RFC PATCH 2/2] netfilter: nft_hash: use set global element counter instead of private one Patrick McHardy
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=1393947667-6143-1-git-send-email-kaber@trash.net \
--to=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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).