diff options
author | Ben Pfaff <blp@nicira.com> | 2011-11-28 10:35:15 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-11-28 10:35:15 -0800 |
commit | 5fcc0d004ae0aa080deed51c842d074a83ec1f67 (patch) | |
tree | 1b3938b503d8f792ee61c1d5a0d3ead30ad0337e /vswitchd/bridge.c | |
parent | 9b16c4394b940573d733c47fa7213bbe99a456d9 (diff) |
ofproto: Add "fast path".
The key to getting good performance on the netperf CRR test seems to be to
handle the first packet of each new flow as quickly as possible. Until
now, we've only had one opportunity to do that on each trip through the
main poll loop. One way to improve would be to make that poll loop
circulate more quickly. My experiments show, however, that even just
commenting out the slower parts of the poll loop yield minimal improvement.
This commit takes another approach. Instead of making the poll loop
overall faster, it invokes the performance-critical parts of it more than
once during each poll loop.
My measurements show that this commit improves netperf CRR performance by
24% versus the previous commit, for an overall improvement of 87% versus
the baseline just before the commit that removed the poll_fd_woke(). With
this commit, ovs-benchmark performance has also improved by 13% overall
since that baseline.
Diffstat (limited to 'vswitchd/bridge.c')
-rw-r--r-- | vswitchd/bridge.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index aadb0c7a..d2dcd027 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -1782,13 +1782,28 @@ refresh_cfm_stats(void) } } +/* Performs periodic activity required by bridges that needs to be done with + * the least possible latency. + * + * It makes sense to call this function a couple of times per poll loop, to + * provide a significant performance boost on some benchmarks with ofprotos + * that use the ofproto-dpif implementation. */ +void +bridge_run_fast(void) +{ + struct bridge *br; + + HMAP_FOR_EACH (br, node, &all_bridges) { + ofproto_run_fast(br->ofproto); + } +} + void bridge_run(void) { const struct ovsrec_open_vswitch *cfg; bool vlan_splinters_changed; - bool datapath_destroyed; bool database_changed; struct bridge *br; @@ -1811,15 +1826,8 @@ bridge_run(void) cfg = ovsrec_open_vswitch_first(idl); /* Let each bridge do the work that it needs to do. */ - datapath_destroyed = false; HMAP_FOR_EACH (br, node, &all_bridges) { - int error = ofproto_run(br->ofproto); - if (error) { - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); - VLOG_ERR_RL(&rl, "bridge %s: datapath was destroyed externally, " - "forcing reconfiguration", br->name); - datapath_destroyed = true; - } + ofproto_run(br->ofproto); } /* Re-configure SSL. We do this on every trip through the main loop, @@ -1847,7 +1855,7 @@ bridge_run(void) } } - if (database_changed || datapath_destroyed || vlan_splinters_changed) { + if (database_changed || vlan_splinters_changed) { if (cfg) { struct ovsdb_idl_txn *txn = ovsdb_idl_txn_create(idl); |