[ovs-git] [openvswitch/ovs] c381bc: ofproto: Make ofproto_port_open_type() faster.

GitHub noreply at github.com
Mon Feb 26 19:36:07 UTC 2018

  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: c381bca52f629f3d35f00471dcd10cba1a9a3d99
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-02-26 (Mon, 26 Feb 2018)

  Changed paths:
    M ofproto/in-band.c
    M ofproto/ofproto.c
    M ofproto/ofproto.h
    M vswitchd/bridge.c

  Log Message:
  ofproto: Make ofproto_port_open_type() faster.

ofproto_port_open_type() was surprisingly slow because it called the
function ofproto_class_find__(), which itself was surprisingly slow because
it actually creates a set of strings and enumerates all of the available

This patch improves performance by eliminating the call to
ofproto_class_find__() from ofproto_port_open_type().  In turn that
required changing a parameter type and updating all the callers.

Possibly it would be worth making ofproto_class_find__() itself faster,
but it doesn't look like any of its other callers would be used in inner

For more background, see also

This patch arises as a result of testing done by Ali Ginwala and Han Zhou.
Their test showed that commit 2d4beba resulted in slower performance of
ovs-vswitchd than was seen in previous versions of OVS.

With this patch, Ali retested and reported that performance drastically
improved by ~60%. The test for 10k lports, 40 LSs and 8 LRs and 1k HVs just
got completed in 3 hours 39 min vs 8+ hours for branch-2.9. Cpu utilization
graph of a farm comparing Ben's ofproto patch vs branch-2.9 is available @

Reported-by: Mark Michelson <mmichels at redhat.com>
Acked-by: Mark Michelson <mmichels at redhat.com>
Tested-by: aginwala <aginwala at asu.edu>
Signed-off-by: Ben Pfaff <blp at ovn.org>

More information about the git mailing list