[ovs-dev] [PATCH 2/3] lib/classifier: Simplify subtable array.
Ben Pfaff
blp at nicira.com
Mon May 19 14:48:16 UTC 2014
On Fri, May 16, 2014 at 02:44:40PM -0700, Jarno Rajahalme wrote:
> Do not cache the 'tag' and 'max_priority' in the subtable array. This
> makes later changes to classifier easier.
>
> Also makes the 'cls_subtables*' functions to always leave the
> subtables array in a consistent state. This includes the new
> cls_subtables_insert() function and removal of the old
> cls_subtables_push_back() function.
>
> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
The FOR_EACH macros caught my eye. Each of them checks for a nonnull
pointer in the subtables array. Are null pointers really possible? I
took a quick look at the functions that modify the array and I did not
see how any of them could leave a null pointer in it.
The code in cls_subtables_change_priority() has almost parallel code for
the two cases, except that in the new_priority < old_priority case it
does the iter++ before the break and in the other case it does the
iter-- after the loop. I would prefer to make both cases the same.
Acked-by: Ben Pfaff <blp at nicira.com>
More information about the dev
mailing list