[ovs-git] [openvswitch/ovs] 1fba38: ovn-northd: Simplify struct ovn_port_group.

GitHub noreply at github.com
Tue Aug 7 22:21:35 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 1fba38f1680bb85593c3142bf588c354a78f6bf0
      https://github.com/openvswitch/ovs/commit/1fba38f1680bb85593c3142bf588c354a78f6bf0
  Author: Han Zhou <zhouhan at gmail.com>
  Date:   2018-08-07 (Tue, 07 Aug 2018)

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

  Log Message:
  -----------
  ovn-northd: Simplify struct ovn_port_group.

Remove the redundant members that's already in nb_pg.

Signed-off-by: Han Zhou <hzhou8 at ebay.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Mark Michelson <mmichels at redhat.com>


  Commit: 5cf668728a7411d22c27f31aacda776a781f56b5
      https://github.com/openvswitch/ovs/commit/5cf668728a7411d22c27f31aacda776a781f56b5
  Author: Han Zhou <zhouhan at gmail.com>
  Date:   2018-08-07 (Tue, 07 Aug 2018)

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

  Log Message:
  -----------
  ovn-northd: Improve efficiency of stateful checking for ACLs on port groups.

Currently in has_stateful_acl(), to check if a datapath has stateful ACLs,
it needs to iterate all port groups and check if the current datapath is
related to each port group, and then iterate the ACLs on the port group. This
is inefficient if there are a lot of port groups. A typical scenario is in
OpenStack each tenant will have a default security group which will be mapped
as a port group, and the default security group is supposed to contain ports
of the tenant only, so most likely only the logical switches belonging to the
tenant should be related to the port group, but we are checking all the port
groups belonging to all tenants for each datapath.

To improve this, a reverse direction of hmap is built from logical switch to
port group, so that the iteration is avoided. The time complexity of this
function improves from O(P * A) to O(PL * A), P = total number of port groups
in NB, PL = number of port groups related to the logical switch, A = number
of ACLs.

Signed-off-by: Han Zhou <hzhou8 at ebay.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Mark Michelson <mmichels at redhat.com>


  Commit: fdf541d482983426c593449a488fc2baf4604e8e
      https://github.com/openvswitch/ovs/commit/fdf541d482983426c593449a488fc2baf4604e8e
  Author: Han Zhou <zhouhan at gmail.com>
  Date:   2018-08-07 (Tue, 07 Aug 2018)

  Changed paths:
    M ovn/utilities/ovn-trace.c

  Log Message:
  -----------
  ovn-trace: Fix warnings when port is found but not in current datapath.

When port group is used, ovn-trace may print warnings like this:

$ ovn-trace ls1 'inport == "lp111" && eth.src == f0:00:00:00:01:11 && eth.dst == f0:00:00:00:01:12  && ip4.src == 192.168.11.1 && ip4.dst == 192.168.11.2 && ip.ttl == 10'
2018-08-02T01:43:23Z|00001|ovntrace|WARN|lp211: not in datapath ls1
2018-08-02T01:43:23Z|00002|ovntrace|WARN|lp211: unknown logical port
2018-08-02T01:43:23Z|00003|ovntrace|WARN|lp221: not in datapath ls1
2018-08-02T01:43:23Z|00004|ovntrace|WARN|lp221: unknown logical port
2018-08-02T01:43:23Z|00005|ovntrace|WARN|lp231: not in datapath ls1
2018-08-02T01:43:23Z|00006|ovntrace|WARN|lp231: unknown logical port

There are 2 warnings:

For the first one, it might be reasonable
before port group is supported, but now since ports in a port group
can span across multiple datapaths, this situation is normal, and
warning should not be printed.

For the second one, it is misleading, and it should not be printed
in this situation even before port group is supported. It should be
printed only if the port is not found at all.

This patch fixes both.

Signed-off-by: Han Zhou <hzhou8 at ebay.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Mark Michelson <mmichels at redhat.com>


Compare: https://github.com/openvswitch/ovs/compare/e2e11c890e1e...fdf541d48298
      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the git mailing list