On Thu, May 22, 2014 at 5:02 PM, Madhu Challa <cha...@noironetworks.com> wrote: > I am looking at adding support for On-demand flow counters and figured one > of the benefits of doing this is reduced lock contention in > ovs_flow_stats_update. > > If my understanding is correct, this involves processing flags > OFPFF13_NO_PKT_COUNTS and OFPFF13_NO_BYT_COUNTS and communicating them so > when the kernel flows are created / updated we somehow pass this info along > so the stats do not get updated for such flows.
It's not clear that this is really the case. OVS still needs to maintain stats in order to age out idle flows, etc. even if they aren't used by the controller. > The closest mod flag to this is OFPFF12_RESET_COUNTS, so I started tracing > how this gets sent to the kernel module. > > However I figured there is a similar flag in dpif DPIF_FP_ZERO_STATS and was > unable to link the two. In general, it's not really desirable to have userspace set the kernel stats. Usually "resetting" the stats can be done in userspace by storing the current values and subtracting this from future values. However, this is likely difficult now that ofproto has become stateless. The zero stats kernel command was originally implemented just for things that can't be offset in this manner, such as TCP flags. > ofputil_flow_mod.flags has the OFPFF12_RESET_COUNTS set in > handle_flow_mod__() and I am not sure how that can be made available after > flow translation in dpif_linux_operate__() That's probably why there is this comment :) /* FIXME: Implement OFPFUTIL_FF_RESET_COUNTS */ There is no direct connection at this point, you would have to iterate over the kernel flows or wait until the next iteration. > Also I was curious why we use node specific counters in the kernel instead > of percpu ? Is it to save on memory footprint ? Percpu counters were used originally but were change to use per-node to reduce allocation time on flow setup and contention on retrieving stats. _______________________________________________ discuss mailing list discuss@openvswitch.org http://openvswitch.org/mailman/listinfo/discuss