[ovs-dev] [loops 6/6] datapath: Detect and suppress flows that are implicated in loops.

Jesse Gross jesse at nicira.com
Tue Aug 3 20:58:51 UTC 2010

On Tue, Aug 3, 2010 at 11:15 AM, Ben Pfaff <blp at nicira.com> wrote:

> +       if (!flow_node) {

While you're in here, can you put in an unlikely()?

+       /* Check whether we've looped too much. */
> +       loop = &get_cpu_var(dp_loop_counters).counters[!!in_interrupt()];
> +       if (++loop->count > DP_MAX_LOOPS)
> +               loop->looping = true;

This is the extra branch that I was referring to.  We can't eliminate it
completely but now in the non-loop case it will never be taken so it will be
no problem for the branch predictor (we could throw in an unlikely()

Other than these minor things it looks good.  I tried to think of ways to
eliminate additional work but didn't really see any.  It should be pretty
insignificant though.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20100803/f79bee40/attachment-0003.html>

More information about the dev mailing list