[ovs-dev] [loops 6/6] datapath: Detect and suppress flows that are implicated in loops.
Ben Pfaff
blp at nicira.com
Tue Aug 3 21:42:30 UTC 2010
On Tue, Aug 03, 2010 at 01:58:51PM -0700, Jesse Gross wrote:
> 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()?
OK, sure.
> + /* 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()
> though).
Thanks, I added it here too.
> 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.
I didn't see any easy way either. Thanks again, I pushed this out.
More information about the dev
mailing list