[ovs-git] [openvswitch/ovs] 993d47: ovn-controller.c: Refactor meter-table-list and me...

Han Zhou noreply at github.com
Thu Jan 2 18:30:47 UTC 2020


  Branch: refs/heads/branch-2.12
  Home:   https://github.com/openvswitch/ovs
  Commit: 993d472b9b3bf3e478f42094fbe91a45f2f4450d
      https://github.com/openvswitch/ovs/commit/993d472b9b3bf3e478f42094fbe91a45f2f4450d
  Author: Han Zhou <hzhou at ovn.org>
  Date:   2020-01-02 (Thu, 02 Jan 2020)

  Changed paths:
    M ovn/controller/ovn-controller.c

  Log Message:
  -----------
  ovn-controller.c: Refactor meter-table-list and meter-group-list commands.

Remove redundant code.

Acked-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Han Zhou <hzhou at ovn.org>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: c5687ee6ebcaf15df82218d58803d6f0c88eb9a9
      https://github.com/openvswitch/ovs/commit/c5687ee6ebcaf15df82218d58803d6f0c88eb9a9
  Author: Han Zhou <hzhou at ovn.org>
  Date:   2020-01-02 (Thu, 02 Jan 2020)

  Changed paths:
    M ovn/controller/ovn-controller.c
    M tests/ovn.at

  Log Message:
  -----------
  ovn-controller: Fix meter-table-list and group-table-list commands.

These commands are supposed to print existing items of the tables,
but they actually print only items that is in existing table but not
in desired table, which is useless because this would print nothing
in normal conditions. The patch fixes it so that they behave as
what the document says.

Acked-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Han Zhou <hzhou at ovn.org>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: 64941134b7888debc3ca855bfdcd3f711c08d6ff
      https://github.com/openvswitch/ovs/commit/64941134b7888debc3ca855bfdcd3f711c08d6ff
  Author: Han Zhou <hzhou at ovn.org>
  Date:   2020-01-02 (Thu, 02 Jan 2020)

  Changed paths:
    M ovn/lib/extend-table.c

  Log Message:
  -----------
  extend-table.c: Refactor code.

Reuse xxx_clear() function in xxx_destroy() and remove redundant code.

Acked-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Han Zhou <hzhou at ovn.org>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: 684ac90826965aec6e4bb66b41c54ee4ce678f8d
      https://github.com/openvswitch/ovs/commit/684ac90826965aec6e4bb66b41c54ee4ce678f8d
  Author: Han Zhou <hzhou at ovn.org>
  Date:   2020-01-02 (Thu, 02 Jan 2020)

  Changed paths:
    M ovn/lib/extend-table.c
    M ovn/lib/extend-table.h
    M tests/ovn.at

  Log Message:
  -----------
  extend-table: Fix reusing group/meter by multiple logical flows.

A meter/group can be used by multiple logical flows. However, current
code didn't handle this properly. Each table_info item has a lflow_uuid
field, which can keep track of only a single lflow.

In most cases this doesn't create problems because multiple table_info
entries are created even for same "name".

However, when multiple lflows are added in the same main loop iteration
using the same "name" (i.e. when the new_table_id == true), the function
ovn_extend_table_assign_id() will return the old id without creating a
new entry, and the reference by the second lflow is untracked. Later
with incremental processing, if the old lflow is deleted, the table_info
will be deleted, which results in the deletion of group/meter in OVS,
even when it is still used by the second lflow.

This patch fixes the problem by adding a hmap in each desired table_info
item to keep track of multiple lflow references. A test case is added.
The test case would fail without this fix.

At the same time, this patch adds an index that maps from lflow_uuid to
a list of desired table_info items used by the lflow, so that the
ovn_extend_table_remove_desired() is more efficient, without having
to do a O(N) iteration every time.

Fixes: ca278d98a4f5 ("ovn-controller: Initial use of incremental engine - quiet mode.")
Acked-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Han Zhou <hzhou at ovn.org>
Signed-off-by: Ben Pfaff <blp at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/62b3f430c297...684ac9082696


More information about the git mailing list