On Fri, Aug 6, 2010 at 11:05 AM, Simon Horman <span dir="ltr">&lt;<a href="mailto:horms@verge.net.au" target="_blank">horms@verge.net.au</a>&gt;</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">




This adds compatibility with kernel changeset<br>
of changeset &quot;net: replace hooks in __netif_receive_skb V5&quot;,<br>
which was also added between 2.6.35 and 2.6.35-rc1<br></blockquote><div><br></div><div>The upper bound on the version numbers should be 2.6.36-rc1, right?  Actually, I see this on all the commit messages.</div><div> </div>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 /*<br>
  * Used as br_handle_frame_hook.  (Cannot run bridge at the same time, even on<br>
  * different set of devices!)<br>
  */<br>
+#ifdef HAVE_BR_HANDLE_FRAME_HOOK<br>
 #if LINUX_VERSION_CODE &gt;= KERNEL_VERSION(2,6,22)<br></blockquote><div><br></div><div>Rather than having nested #if ... it might be cleaner to just have #if &gt;= 2.6.36; #elif &gt;= 2.6.22; #else</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


+static int netdev_init(void) { return 0; }<br>
+static void netdev_exit(void) { ; }<br></blockquote><div><br></div><div>You shouldn&#39;t need a semicolon here.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


        dev_set_promiscuity(netdev_vport-&gt;dev, 1);<br>
        dev_disable_lro(netdev_vport-&gt;dev);<br>
-       rcu_assign_pointer(netdev_vport-&gt;dev-&gt;br_port, (struct net_bridge_port *)vport);<br>
-<br>
-       return 0;<br>
+       rcu_assign_pointer(netdev_vport-&gt;dev-&gt;br_port,<br>
+                          (struct net_bridge_port *)vport);<br>
+#ifndef HAVE_BR_HANDLE_FRAME_HOOK<br>
+       err = netdev_rx_handler_register(netdev_vport-&gt;dev, netdev_frame_hook);<br>
+#endif<br></blockquote><div><br></div><div>We need to do some rearranging here in case netdev_rx_handler_register() fails.  I think we can just move dev_set_prosmiscuity() and dev_disable_lro() after registering the rx_handler().</div>



<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+  OVS_GREP_IFELSE([$KSRC26/include/linux/if_bridge.h],<br>
+                  [br_handle_frame_hook],<br>
+                  [OVS_DEFINE([HAVE_BR_HANDLE_FRAME_HOOK])])<br></blockquote><div><br></div><div>Usually we just use these configure tests on an as-needed basis for functions that have been backported to older kernels and directly check the version number in other cases.  This is obviously complicated by the fact that 2.6.36-rc1 doesn&#39;t exist yet and therefore the version number will still show up as 2.6.35 but that will change in the relatively near future.  For tests that are repeated we can just define a symbol based on the version, without actually having to do a test.</div>

</div>