[ovs-discuss] Communicate flow-mod info to kernel module

Madhu Challa challa at noironetworks.com
Sun May 25 01:06:17 UTC 2014


Hi Jesse,

Thanks for the clarifications.


On Fri, May 23, 2014 at 9:52 AM, Jesse Gross <jesse at nicira.com> wrote:

> On Thu, May 22, 2014 at 5:02 PM, Madhu Challa <challa at 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.
>

I was making this assumption based on the comments in the TODO list.

" * On-demand flow counters. I think this might be a real optimization in
some cases for the software switch.
[optional for OF1.3+]"

I would guess the last used field is the one needed to age out the flows,
but if we also have to increment the counters we would need the lock and
there would not be much savings I can think of.

Pl let me know what you think. I will start looking into some other 1.3+
items in that list.

Thanks.


>
> > 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20140524/469f66ce/attachment-0002.html>


More information about the discuss mailing list