[ovs-git] [openvswitch/ovs] f58578: ofproto-dpif: Cache result of time_msec() for rule...

GitHub noreply at github.com
Thu Jun 2 20:22:08 UTC 2016

  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: f5857865770efb5a5383fa7aa886c0ff15f2038a
  Author: Daniele Di Proietto <diproiettod at vmware.com>
  Date:   2016-06-02 (Thu, 02 Jun 2016)

  Changed paths:
    M ofproto/ofproto-dpif.c

  Log Message:
  ofproto-dpif: Cache result of time_msec() for rule_expire().

In the run() function of ofproto-dpif we call rule_expire() for every
possible flow that has a timeout and rule_expire() calls time_msec().
Calling time_msec() repeatedly can be pretty expensive, even though most
of the time it involves only a vdso call.

This commit calls time_msec only once in run(), to reduce the workload.

Keeping the flows ordered by expiration in some kind of heap or timing
wheel data structure could help make this process more efficient, if
rule_expire() turns out to be a bottleneck.

VMware-BZ: #1655122
Signed-off-by: Daniele Di Proietto <diproiettod at vmware.com>
Acked-by: Ben Pfaff <blp at ovn.org>

More information about the git mailing list