[ovs-git] [ovn-org/ovn] de7761: ovn-northd-ddlog: Intern all strings in OVSDB tables.

Leonid Ryzhyk noreply at github.com
Thu Sep 16 20:16:19 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/ovn-org/ovn
  Commit: de77614bcb64a1d7b121cf5aeccc8f6167342742
      https://github.com/ovn-org/ovn/commit/de77614bcb64a1d7b121cf5aeccc8f6167342742
  Author: Leonid Ryzhyk <lryzhyk at vmware.com>
  Date:   2021-09-16 (Thu, 16 Sep 2021)

  Changed paths:
    M configure.ac
    M manpages.mk
    M northd/copp.dl
    M northd/helpers.dl
    M northd/ipam.dl
    M northd/lrouter.dl
    M northd/lswitch.dl
    M northd/multicast.dl
    M northd/ovn-nb.dlopts
    M northd/ovn-sb.dlopts
    M northd/ovn.dl
    M northd/ovn_northd.dl
    M northd/ovsdb2ddlog2c

  Log Message:
  -----------
  ovn-northd-ddlog: Intern all strings in OVSDB tables.

The ovsdb2ddlog compiler now represents all OVSDB strings as `istring`
instead of `string`.  This commit fixes type errors resulting from that
change.  ovn-northd-ddlog should be somewhat faster and leaner now.

Signed-off-by: Leonid Ryzhyk <lryzhyk at vmware.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Mark Michelson <mmichels at redhat.com>


  Commit: d29ac71010f8139e27430943bd643324e5ca4040
      https://github.com/ovn-org/ovn/commit/d29ac71010f8139e27430943bd643324e5ca4040
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-09-16 (Thu, 16 Sep 2021)

  Changed paths:
    M northd/lrouter.dl
    M northd/ovn_northd.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Make joins for ARP/ND flows slightly more efficient.

DDlog can index equality joins within a expression like this, but not
conditional expression that follow such an expression.  This doesn't
actually matter much in this case because ordinarily the expression
will be true (most router ports are enabled).

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


  Commit: dbd8c1f900d5679830f0fb9bf11f51ec95c47c0f
      https://github.com/ovn-org/ovn/commit/dbd8c1f900d5679830f0fb9bf11f51ec95c47c0f
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-09-16 (Thu, 16 Sep 2021)

  Changed paths:
    M northd/lrouter.dl
    M northd/ovn_northd.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Derive load balancer IP addresses in new LoadBalancer.

This makes the get_router_load_balancer_ips() function much faster.
This function is a hot path for the use of load balancers, so it
improves performance overall when they are in use.

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


  Commit: 63bd0274a309fa89478f4400b739eef459eae30b
      https://github.com/ovn-org/ovn/commit/63bd0274a309fa89478f4400b739eef459eae30b
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-09-16 (Thu, 16 Sep 2021)

  Changed paths:
    M northd/lrouter.dl
    M northd/ovn_northd.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Reverse order of joins for connection tracking flows.

DDlog evaluates rules in the order given by syntax.  The rules for
load balancers all first evaluated a Router or Switch, then joined
that against the load balancers.  However, the expensive logic was
all on the load balancers.  This meant that the load balancer logic
was happening many times, once per switch or router that contained
it.  When a single load balancer was part of many switches or
routers, this did a lot of redundant processing.  This commit
reverses the join order, which speeds up processing a lot.

This commit looks big because it also converts a lot of rules from
the FLWOR syntax to traditional Datalog-style syntax.  This is not
completely needed, but the Datalog-style syntax is more versatile
(it supports FlatMap and aggregation), so I tend to make that sort
of change as I refactor things.

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


  Commit: 0cd420a26d2d1de98b65c351b5c7c28e2c7380bb
      https://github.com/ovn-org/ovn/commit/0cd420a26d2d1de98b65c351b5c7c28e2c7380bb
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-09-16 (Thu, 16 Sep 2021)

  Changed paths:
    M northd/ovn_northd.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Avoid re-parsing LB IP addresses and ports.

The LBVIPs already contain parsed versions of the load balancer
keys, but the code was parsing it redundantly.

Slight performance improvement but much cleaner.

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


  Commit: f8c67ed8c7a5e1a21e65029d46b2a7aebb05e5bb
      https://github.com/ovn-org/ovn/commit/f8c67ed8c7a5e1a21e65029d46b2a7aebb05e5bb
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-09-16 (Thu, 16 Sep 2021)

  Changed paths:
    M northd/lswitch.dl
    M northd/ovn_northd.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Simplify LBVIPWithStatus to include up_backends string.

There was only one use for the 'backends' map, which was to be converted
to a string that listed all the backends that were up, so we might as
well do that at its point of origination.  At the same time, everything
else in LBVIPWithStatus was just a copy of the underlying LBVIP, so we
might as well just reference it.

Only slight improvement to performance.

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


  Commit: 1c92a32ad514eb754756905efc12224ee68ab081
      https://github.com/ovn-org/ovn/commit/1c92a32ad514eb754756905efc12224ee68ab081
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-09-16 (Thu, 16 Sep 2021)

  Changed paths:
    M northd/lrouter.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Avoid storing unused 'lbs' field in Router.

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


  Commit: 111f314117dc725f4132ff76181936d025996c5f
      https://github.com/ovn-org/ovn/commit/111f314117dc725f4132ff76181936d025996c5f
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-09-16 (Thu, 16 Sep 2021)

  Changed paths:
    M northd/ovn_northd.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Intern strings before joining when possible.

By interning earlier, we do less copying across the joins with
Router and Switch, because DDlog always copies by value and
copying an interned string is cheap.

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


  Commit: d01209c9f4c46ddbe485e7326f5bde0aa0bd2754
      https://github.com/ovn-org/ovn/commit/d01209c9f4c46ddbe485e7326f5bde0aa0bd2754
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-09-16 (Thu, 16 Sep 2021)

  Changed paths:
    M northd/ovn_northd.dl
    M tests/ovn-northd.at

  Log Message:
  -----------
  ovn-northd-ddlog: Avoid map(ival) for ARP flows.

It's expensive for a long list.  All it buys us is sorting the list in
alphabetical order (rather than in order of Intern hash value), which isn't
that valuable.

This also updates a test that depended on the sort order.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Suggested-by: Leonid Ryzhyk <lryzhyk at vmware.com>
Acked-by: Mark Michelson <mmichels at redhat.com>


  Commit: 92b35d4b2d6f8d8ec3300b5665f7b556c826b3e4
      https://github.com/ovn-org/ovn/commit/92b35d4b2d6f8d8ec3300b5665f7b556c826b3e4
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-09-16 (Thu, 16 Sep 2021)

  Changed paths:
    M northd/ovn_northd.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Avoid unnecessary joins for SwitchPortARPForwards.

SwitchPortARPForwards already has all the necessary data in it and joining
with SwitchPort just wastes time.

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


  Commit: 7cab63a1b508db88b546ed011a512789a63eb80a
      https://github.com/ovn-org/ovn/commit/7cab63a1b508db88b546ed011a512789a63eb80a
  Author: Leonid Ryzhyk <lryzhyk at vmware.com>
  Date:   2021-09-16 (Thu, 16 Sep 2021)

  Changed paths:
    M northd/lrouter.dl
    M northd/lswitch.dl
    M northd/ovn_northd.dl

  Log Message:
  -----------
  Reduce churn and eliminate Cartesian joins.

`Router` and `Switch` relations used to store associated LB UUIDs,
causing a lot of churn when the set of LBs changed.  We remove this
field from `Router` and `Switch` and introduce separate tables
to track the Router-to-LB and Switch-to-LB relations.

In addition we rewrite several rules that computed a Cartesian product
of LBVIP and `Router` or `Switch` tables.

Signed-off-by: Leonid Ryzhyk <lryzhyk at vmware.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Mark Michelson <mmichels at redhat.com>


Compare: https://github.com/ovn-org/ovn/compare/b55035a3ec66...7cab63a1b508


More information about the git mailing list