Bug 1825766

Summary: [RFE] [OVN SCALE] ovn-controller : Have a separate thread to program flows
Product: Red Hat Enterprise Linux Fast Datapath Reporter: Numan Siddique <nusiddiq>
Component: OVNAssignee: anil venkata <vkommadi>
Status: ASSIGNED --- QA Contact: Jianlin Shi <jishi>
Severity: unspecified Docs Contact:
Priority: medium    
Version: FDP 20.ACC: ctrautma, mmichels
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Numan Siddique 2020-04-20 08:05:00 UTC
Explore ovn-controller having the separate thread for pushing the flows to the switch.

When the switch has pending packets for processing, ovn-controller will skip the engine to avoid generating the flows
and instead retriggers forced computes for the next engine runs, which will regenerate all logical and physical flows.
Explore if we can avoid this i.e let engine not consider pending packets in the switch and continue with the flow
generation and ofctrl then should take care of pushing those flows when the switch is not processing packets.

Comment 1 anil venkata 2020-05-06 06:15:58 UTC
I tried this approach https://github.com/venkataanil/ovn/tree/thread i.e
splitting ovn-controller into two threads (similar to produce consumer approach)
1) main thread will continue with generating flows
2) new thread will push these flows to the switch when there are no pending packets
but I don't see much performance improvement as scheduling this new thread by kernel
when it gets new flows also consumes some time.

Comment 2 anil venkata 2020-05-06 06:34:26 UTC
Enhanced the thread approach here https://github.com/venkataanil/ovn/tree/p10_thread

Now trying the below approach
Want to avoid thread and instead define the msgs as static so that they will be
avialable across engine runs. engine will keep on generating messages according to
flow changes without checking if the switch has pending packets. ofctrl put will
avoid pushing the packets to switch when it has pending packets and will send them
during next engine run. 
https://github.com/venkataanil/ovn/tree/ofctrl_put_delay