On Mon, Dec 09, 2013 at 03:52:39PM -0800, Jarno Rajahalme wrote: > On Dec 7, 2013, at 2:04 PM, Ben Pfaff <b...@nicira.com> wrote: > > On Thu, Dec 05, 2013 at 04:27:26PM -0800, Jarno Rajahalme wrote: > >> Add a prefix tree (trie) structure for tracking the used address > >> space, enabling skipping classifier tables containing longer masks > >> than necessary for an address field value in a packet header being > >> classified. This enables less unwildcarding for datapath flows in > >> parts of the address space without host routes.
> > Did you consider making be_get_bit_at() and get_bit_at() return bool? > > If they return bool, the caller must use !! to get 1 from the > non-zero return value to use it as an index. I?d rather have these > return the bit itself. I don't understand why you think !! would be needed. I only know of one case where it would be needed: in a pre-C99 compiler, if "bool" is a typedef to some ordinary integer type, then it could be non-zero and non-one. But that's why I'm always careful to write != 0, etc., to ensure that I only assign zero or one to my "bool"s, and (without looking at the patch again) I think that I verified that you did that here too. > You?ll get to say what you think of the result before I push, > though. I?d like you to review trie_lookup_value(), trie_insert() > and trie_remove() once more. I?d like your OK on the trie > manipulation logic (adding and removing nodes). Both of these are > constrained by the maximum number of prefix bits a single node can > hold (32). Some of the node addition detail is in the > trie_branch_create(), which can add create a chain of nodes. OK, I will do that. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev