[ovs-dev] [PATCH ovn v3 0/6] Combine Logical Flows by Logical Datapath.

Ilya Maximets i.maximets at ovn.org
Fri Dec 4 17:54:08 UTC 2020


This series is aimed to reduce size of a Southbound DB.
In modern OVN cluster there is a big probability that same logical
flows are installed for several logical switches.  Currently, OVN
will create a separate logical flow for each logical switch (datapath)
filled with exact same match, actions and so on.  The only difference
between these flows is a logical_datapath column.  Depending on
a size of a cluster, there could be hundreds or even thousands of
copies of the same flow.

This change introduces new table Logical Datapath Group.  With
this table we could combine datapaths in a single set and link
the whole datapath group to a single logical flow.

In my testing for a 7MB Northbound DB with 100 logical switches
taken from the ovn-k8s cluster test, size of a Southbound DB
decreased from 480 MB to 90 MB.

Number of logical flows in SB DB for this test case:
  Currently    - 1173779
  With patches - 171632

Version 3:
  * Added ACKs from Mark and Dumitru to all patches, except for patch #3.
  * Minor typos and style issues fixed.
  * Condition to update SB monitors made stricter as suggestd by Dumitru.

  Basically, beside typos and indentation changes, here is the full diff
  with v2:

| diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
| index eb0de32a3..90a0d9cf5 100644
| --- a/controller/ovn-controller.c
| +++ b/controller/ovn-controller.c
| @@ -2868,11 +2868,10 @@ main(int argc, char *argv[])
|                                      br_int, chassis,
|                                      &runtime_data->local_datapaths,
|                                      &runtime_data->active_tunnels);
| -                        /* Updating monitor conditions if runtime data changed
| -                         * and, also, on flow output changes since this might
| -                         * mean update of logical datapath goups. */
| +                        /* Updating monitor conditions if runtime data or
| +                         * logical datapath goups changed. */
|                          if (engine_node_changed(&en_runtime_data)
| -                            || engine_node_changed(&en_flow_output)) {
| +                            || engine_node_changed(&en_sb_logical_dp_group)) {
|                              ovnsb_expected_cond_seqno =
|                                  update_sb_monitors(
|                                      ovnsb_idl_loop.idl, chassis,
| ---


Version 2:
  * Implemented backward compatibility.
  * Datapath groups are not created for a single datapath.
  * Added index for faster iteration over changed logical flows.
  * Introduced option to enable this feature.  Disabled by default due
    to possible performance penalty in some cases (see commit messages
    and documentation).
  * All the unit tests fixed (passed with config enabled and disabled).
    -- Special thanks to Dumitru for the great help with debugging!
  * Added special unit test.  It should be useful to run all tests with
    and without datapath groups, but it will be much easier to implement
    later with testsuite updates made by Ben for ddlog.
  * ovn-detrace updated to support datapath groups.
  * General code cleanup + extra comments.


Ilya Maximets (6):
  tests: Sort flow and database dumps.
  ovn-sb.ovsschema: Add Logical Datapath Groups.
  controller: Add support for Logical Datapath Groups.
  utilities: Add support for Logical Datapath Groups.
  northd: Add support for Logical Datapath Groups.
  northd: Config option to enable use of Logical Datapath Groups.

 NEWS                        |   5 +
 controller/lflow.c          | 125 +++++++++++----
 controller/lflow.h          |   2 +
 controller/ovn-controller.c |  53 ++++++-
 lib/ovn-util.c              |  14 +-
 lib/ovn-util.h              |   3 +-
 northd/ovn-northd.c         | 302 ++++++++++++++++++++++++++++++------
 ovn-nb.xml                  |  20 +++
 ovn-sb.ovsschema            |  22 ++-
 ovn-sb.xml                  |  42 +++--
 tests/ovn-northd.at         |  84 +++++++++-
 tests/ovn.at                |   8 +-
 utilities/ovn-detrace.in    |   8 +-
 utilities/ovn-sbctl.c       | 108 +++++++++----
 utilities/ovn-trace.c       |  40 +++--
 15 files changed, 675 insertions(+), 161 deletions(-)

-- 
2.25.4



More information about the dev mailing list