]> git.proxmox.com Git - mirror_ovs.git/commit
ovn-controller: Avoid recomputing when there are in-flight msgs.
authorHan Zhou <zhouhan@gmail.com>
Sat, 22 Apr 2017 01:55:27 +0000 (18:55 -0700)
committerBen Pfaff <blp@ovn.org>
Mon, 1 May 2017 20:53:00 +0000 (13:53 -0700)
commit74c760c8fe99d554b94423d49d13d5ca3dea0d9e
treebfb8d4e0a3032fb17dca56bb3989ef5304340cb7
parent1e31e24232c1d868d054c0e588dca57461ec5dc6
ovn-controller: Avoid recomputing when there are in-flight msgs.

When there are in-flight msgs being sent to OVS, ofctrl_put will
skip, which makes all the flows computed in that main loop
iteration useless. To avoid the wasted CPU cycles, a check is added
before lflow/physical flow run in each iteration.

This has huge performance improvement in below testing:
- 1 lswitch with 10 lports bound locally
- Each lport has an ingress ACL, referencing the same address-set
- The address-set has 10,000 IPv4 addresses

For each IP address in the address-set, there will be 3
OpenFlow rules generated for each ACL. So the total number
of rules is 300k+.

Without the patch, it takes 50+ minutes to install all the
rules to ovs-vswitchd.

With the patch, it takes 16 seconds to install all the rules
to ovs-vswitchd.

The reason is that the large number of rules are sent to
ovs-vswitchd gradually in many iterations of ovn-controller
main loop. Without the patch, cpu cycles are wasted in
lflow_run to re-processing the large address set in every
main loop iteration. With the patch, this re-processing is
avoided in iterations when there are pending rules sending.

Signed-off-by: Han Zhou <zhouhan@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
ovn/controller/ofctrl.c
ovn/controller/ofctrl.h
ovn/controller/ovn-controller.c