On kernels 2.6.37 and above IFF_OVS_DATAPATH has a unique value upstream,
on 2.6.36 we define it to be IFF_BRIDGE_DATAPATH and below to 0.  There
isn't really a good reason to use IFF_BRIDGE_DATAPATH on 2.6.36 (and it's
perhaps bad because it's checked in a few places and we don't want those
checks to trigger on just this kernel) and it makes it difficult to know
what value we should use in the face of backporting.  Therefore, this
just uses 0 on the places where we don't have a real value.

Reported-by: Benoit ML <ben4...@gmail.com>
Signed-off-by: Jesse Gross <je...@nicira.com>
---
 datapath/linux/compat/include/linux/if.h |    6 ++----
 datapath/vport-netdev.c                  |    2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/datapath/linux/compat/include/linux/if.h 
b/datapath/linux/compat/include/linux/if.h
index 5ea620d..a09f112 100644
--- a/datapath/linux/compat/include/linux/if.h
+++ b/datapath/linux/compat/include/linux/if.h
@@ -14,10 +14,8 @@
 #define IFF_TX_SKB_SHARING 0
 #endif
 
-#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,36)
-#define IFF_OVS_DATAPATH IFF_BRIDGE_PORT
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
-#define IFF_OVS_DATAPATH 0             /* no-op flag */
+#ifndef IFF_OVS_DATAPATH
+#define IFF_OVS_DATAPATH 0
 #endif
 
 #endif
diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c
index 2db5592..f9129f4 100644
--- a/datapath/vport-netdev.c
+++ b/datapath/vport-netdev.c
@@ -386,7 +386,7 @@ error:
 struct vport *ovs_netdev_get_vport(struct net_device *dev)
 {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
-#if IFF_BRIDGE_PORT != IFF_OVS_DATAPATH
+#if IFF_OVS_DATAPATH != 0 
        if (likely(dev->priv_flags & IFF_OVS_DATAPATH))
 #else
        if (likely(rcu_access_pointer(dev->rx_handler) == netdev_frame_hook))
-- 
1.7.5.4

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to