Bug 1940346 - [OVN-SCALE] OVN: Optimize trivial logical flow to OF rule translation.
Summary: [OVN-SCALE] OVN: Optimize trivial logical flow to OF rule translation.
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux Fast Datapath
Classification: Red Hat
Component: ovn2.13
Version: FDP 20.H
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: OVN Team
QA Contact: Jianlin Shi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-18 09:10 UTC by Dumitru Ceara
Modified: 2023-07-13 07:25 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
OVN NB sample database. (15.46 MB, text/plain)
2021-03-18 09:10 UTC, Dumitru Ceara
no flags Details

Description Dumitru Ceara 2021-03-18 09:10:31 UTC
Created attachment 1764301 [details]
OVN NB sample database.

Description of problem:

In large scale deployments OVN topologies usually consist of a large number of logical switches/routers.

The logical flow pipelines for logical datapaths have a number of common flows (trivial flows) that are identical across all datapaths and usually just advance to the next table in the pipeline.

Currently, with logical_dp_groups enabled, all these flows are associated to a datapath group that consists of all logical switches/routers.

However, ovn-controller, when generating OF rules, expands the trivial logical flow applied on a datapath group with N datapaths into N individual openflows, prepending the "metadata=<datapath-key>" match to each of the openflows.

For example, with the attached OVN NB database (from a scale test run), ovn-controller generates ~400K openflows on a single hypervisor.

Changing ovn-controller to not match on logical datapath key for trivial flows could reduce the number of openflows to ~200K.

Potential implementation:
- extend the Logical_DP_Group SB schema to add a column to allow specifying if the datapath group consists of all switches/routers in the topology.
- in the first stage of the switch/router pipeline store in the "flags" logical register a bit to indicate that the packet is processed on a switch or router pipeline.
- when processing logical flows applied to datapath groups, if the group includes all switches, instead of generating N OF rules, one for each datapath in the group, generate a single OF rule with an additional match on the "flags" register bit that indicates that the packet is processed on the switch pipeline.
- similarly, OF rules can be optimized for trivial logical flows applied to logical routers.

Initial scale tests show an improvement of ~8% in time it takes to bring up an OVN node with an OpenShift-like deployment.  This is explained by the fact that ovn-controller spends constant time in generating trivial flows.


Note You need to log in before you can comment on or make changes to this bug.