From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 1/2] netfilter: conntrack: support a fixed size of 128 distinct labels
Date: Sat, 23 Jul 2016 12:27:19 +0200 [thread overview]
Message-ID: <20160723102719.GA3162@salvia> (raw)
In-Reply-To: <1469098277-1227-2-git-send-email-fw@strlen.de>
On Thu, Jul 21, 2016 at 12:51:16PM +0200, Florian Westphal wrote:
> The conntrack label extension is currently variable-sized, e.g. if
> only 2 labels are used by iptables rules then the labels->bits[] array
> will only contain one element.
>
> We track size of each label storage area in the 'words' member.
>
> But in nftables and openvswitch we always have to ask for worst-case
> since we don't know what bit will be used at configuration time.
>
> As most arches are 64bit we need to allocate 24 bytes in this case:
>
> struct nf_conn_labels {
> u8 words; /* 0 1 */
> /* XXX 7 bytes hole, try to pack */
> long unsigned bits[2]; /* 8 24 */
>
> Make bits a fixed size and drop the words member, it simplifies
> the code and only increases memory requirements on x86 when
> less than 64bit labels are required.
>
> We still only allocate the extension if its needed.
Applied, thanks.
next prev parent reply other threads:[~2016-07-23 10:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-21 10:51 netfilter: connlabels: get rid of variable-size support Florian Westphal
2016-07-21 10:51 ` [PATCH 1/2] netfilter: conntrack: support a fixed size of 128 distinct labels Florian Westphal
2016-07-23 10:27 ` Pablo Neira Ayuso [this message]
2016-07-21 10:51 ` [PATCH 2/2] netfilter: connlabels: move set helper to xt_connlabel Florian Westphal
2016-07-22 15:09 ` Pablo Neira Ayuso
2016-07-22 15:17 ` Florian Westphal
2016-07-23 10:27 ` 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=20160723102719.GA3162@salvia \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@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).