From e25c55d28f30b537aa657797c41483a9bab59b93 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Wed, 11 Jan 2012 15:01:37 -0800 Subject: [PATCH] datapath: IFF_OVS_DATAPATH is backported by RHEL 6.2. 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 Signed-off-by: Jesse Gross --- 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 5ea620dc..a09f1128 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 2db55929..07c7abdb 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)) -- 2.30.2