On Tue, Aug 3, 2010 at 11:15 AM, Ben Pfaff <span dir="ltr"><<a href="mailto:blp@nicira.com">blp@nicira.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
+ if (!flow_node) {<br></blockquote><div><br></div><div>While you're in here, can you put in an unlikely()?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
+ /* Check whether we've looped too much. */<br>
+ loop = &get_cpu_var(dp_loop_counters).counters[!!in_interrupt()];<br>
+ if (++loop->count > DP_MAX_LOOPS)<br>
+ loop->looping = true;</blockquote><div><br></div><div>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).</div>
<div><br></div><div>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.</div></div>