datapath: IFF_OVS_DATAPATH is backported by RHEL 6.2.
authorJesse Gross <jesse@nicira.com>
Wed, 11 Jan 2012 23:01:37 +0000 (15:01 -0800)
committerJesse Gross <jesse@nicira.com>
Thu, 12 Jan 2012 23:32:16 +0000 (15:32 -0800)
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_PORT and below to 0.  There isn't
really a good reason to use IFF_BRIDGE_PORT 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 <ben42ml@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/linux/compat/include/linux/if.h
datapath/vport-netdev.c

index 5ea620d..a09f112 100644 (file)
 #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
index 2db5592..07c7abd 100644 (file)
@@ -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))