diff options
author | Jesse Gross <jesse@nicira.com> | 2012-01-11 15:01:37 -0800 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2012-01-12 15:32:16 -0800 |
commit | e25c55d28f30b537aa657797c41483a9bab59b93 (patch) | |
tree | 205372184fd0f8fa3749773c6b60dee9705a3923 | |
parent | 247527db0f3530480bde88c59c1fadd5d51505fc (diff) |
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 <ben42ml@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
-rw-r--r-- | datapath/linux/compat/include/linux/if.h | 6 | ||||
-rw-r--r-- | 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)) |