ovn-controller: Optimize processing for non-local datapath without patch ports.
authorHan Zhou <zhouhan@gmail.com>
Tue, 29 Mar 2016 19:26:18 +0000 (12:26 -0700)
committerBen Pfaff <blp@ovn.org>
Wed, 30 Mar 2016 23:20:33 +0000 (16:20 -0700)
commitc4f3269632ba321bef50cf5f44165a54895f7cc0
treef381169864d4edabdf97d73e82fb54b43a73a9d6
parentfaa9e2355ef7f697710a175dcf0c2ca501bbf2dc
ovn-controller: Optimize processing for non-local datapath without patch ports.

For non-local datapaths, if there are no patch ports attached, it
means the lflows and port bindings would never be needed on the
Chassis. Since lflow_run() and physical_run() are the bottlenecks,
skipping the processing for such lflows and port bindings can save
significant amount of CPU, at the same time largely reduce the
number of rules in local openflow tables. This is specifically
useful when most of the lswitches are created for bridged networks,
where logical router is not used.

Test precondition:
2k hypervisors, 20k lports, 200 lswitches (each with a localnet
port).

Test case:
step1: add 50 hypervisors (simulated on 1 BM with 40 cores), and
       wait for flow updates complete on all new hypervisors.
step2: create a lswitch and a localnet port, create and bind 100
       lports evenly on these hypervisors. Repeat this 5 times.

Before the change:
Step1 took around 20 minutes.
Step2 took 936 seconds.

After the change:
Step1 took less than 1 minute: 20x faster.
Step2 took 464 seconds: 2x faster.

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