datapath: Clarify meaning of n_buckets argument to tbl_create().
authorBen Pfaff <blp@nicira.com>
Tue, 28 Dec 2010 00:06:08 +0000 (16:06 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 28 Dec 2010 17:17:12 +0000 (09:17 -0800)
commitc6fadeb1f0488997b44e85a00a8887756232156d
tree5dbccd7f7d21df949cb23e94cb3b5bd26f584dd7
parentddffedda18b6f919cb896265e126574d75fcaf00
datapath: Clarify meaning of n_buckets argument to tbl_create().

The n_buckets argument to tbl_create() can be zero, but the comment didn't
mention that.  However, there's no reason that the caller can't just pass
in a correct size, so this commit changes them to do that.

Also, TBL_L1_SIZE was conceptually wrong as the minimum size: the minimum
size is one L2 page, e.g. TBL_L2_SIZE.  But TBL_MIN_BUCKETS seems like a
better all-around way to indicate the minimum size, so this commit also
introduces that macro and uses it.

Jesse Gross pointed out inconsistencies in this area.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/datapath.c
datapath/table.c
datapath/table.h
datapath/tunnel.c