All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Elise Lennion <elise.lennion@gmail.com>
Cc: pablo@netfilter.org, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft v3 2/2] datatype: Implement binary search in symbolic_constant_print()
Date: Mon, 28 Nov 2016 23:12:23 +0100	[thread overview]
Message-ID: <20161128221223.GB9858@breakpoint.cc> (raw)
In-Reply-To: <20161128202312.GA8763@lennorien.com>

Elise Lennion <elise.lennion@gmail.com> wrote:
> Because a linear search is used, which is slower.
> 
> This approach demands that the symbol_table have a variable with its
> size, also, it must be sorted by value.

Did Pablo put you up to this?  Bad Pablo, bad!  :-P

because:

>  static const struct symbol_table ethertype_tbl = {
> +	.size 		= 4,
>  	.symbols	= {
>  		SYMBOL("ip",		__constant_htons(ETH_P_IP)),
> +		SYMBOL("vlan",		__constant_htons(ETH_P_8021Q)),
>  		SYMBOL("arp",		__constant_htons(ETH_P_ARP)),
>  		SYMBOL("ip6",		__constant_htons(ETH_P_IPV6)),
> -		SYMBOL("vlan",		__constant_htons(ETH_P_8021Q)),
>  		SYMBOL_LIST_END
>  	},

This is unmaintanable.  I have no clue what value ETH_P_8021Q is, and that
this has to be placed at spot #2 to not break things.

  reply	other threads:[~2016-11-28 22:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-28 20:23 [PATCH nft v3 2/2] datatype: Implement binary search in symbolic_constant_print() Elise Lennion
2016-11-28 22:12 ` Florian Westphal [this message]
2016-11-29  8:35   ` Pablo Neira Ayuso
2016-11-29 10:04     ` Florian Westphal

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=20161128221223.GB9858@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=elise.lennion@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.