[ovs-dev] [PATCH monitor_cond V5 03/18] ovsdb: allow unmonitored columns in condition evaluation

Ben Pfaff blp at ovn.org
Mon Mar 21 20:14:47 UTC 2016


On Fri, Mar 04, 2016 at 08:08:58AM +0000, Liran Schour wrote:
> This commit allows to add unmonitored columns to a monitored table
> due to condition update.
> It will be used to evaluate conditions on unmonitored columns.
> Update notification includes only monitored columns.
> Due to the limited number of columns We do not remove unused unmonitored
> columns due to condition update to keep the code simple.
> 
> Signed-off-by: Liran Schour <lirans at il.ibm.com>

Thanks for the revised series!

Can the following check in ovsdb_monitor_add_column() be reduced to a
check for mt->columns_index_map[column->index] != -1?  Why check only
for unmonitored columns?  Also, I don't understand the comment about not
removing unmonitored columns.

> +    /* Check duplication only for unmonitored columns.
> +     * We do not remove unused unmonitored columns due to condition
> +     * update */
> +    if (!monitored) {
> +        int i;
> +        for (i = 0; i < mt->n_columns; i++) {
> +            if (mt->columns[i].column == column) {
> +                /* column exists */
> +                return;
> +            }
> +        }
> +    }

ovsdb_monitor_compose_row_update() and
ovsdb_monitor_compose_row_update2() iterate through all columns and then
skip the ones that are not monitored.  Can they just iterate through the
monitored ones, e.g. change
     for (i = 0; i < mt->n_columns; i++) {
to
     for (i = 0; i < mt->n_monitored_columns; i++) {



More information about the dev mailing list