kni: disable FDB operations on RHEL 6.5
authorJean-Mickael Guerin <jean-mickael.guerin@6wind.com>
Tue, 15 Apr 2014 13:51:22 +0000 (15:51 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 17 Apr 2014 22:20:04 +0000 (00:20 +0200)
On RH 6.5:
igb_main.c:2298: error: unknown field ‘ndo_fdb_add’ specified in
initializer

FDB ops are present in RH 6.5 via the extension of netdev, so add the
ifdef inside the netdev ops definition of igb.

However, FDB functions are not set for RHEL 6.5: the implementation
relies on dev_mc_add_excl API which has not been backported.

Signed-off-by: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h

index 6388207..fd48881 100644 (file)
@@ -2294,12 +2294,14 @@ static const struct net_device_ops igb_netdev_ops = {
 #ifdef HAVE_VLAN_RX_REGISTER
        .ndo_vlan_rx_register   = igb_vlan_mode,
 #endif
+#ifndef HAVE_RHEL6_NETDEV_OPS_EXT_FDB
 #ifdef NTF_SELF
        .ndo_fdb_add            = igb_ndo_fdb_add,
 #ifndef USE_DEFAULT_FDB_DEL_DUMP
        .ndo_fdb_del            = igb_ndo_fdb_del,
        .ndo_fdb_dump           = igb_ndo_fdb_dump,
 #endif
+#endif /* ! HAVE_RHEL6_NETDEV_OPS_EXT_FDB */
 #ifdef HAVE_BRIDGE_ATTRIBS
        .ndo_bridge_setlink     = igb_ndo_bridge_setlink,
        .ndo_bridge_getlink     = igb_ndo_bridge_getlink,
index 4b2c940..166b064 100644 (file)
@@ -2837,6 +2837,12 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
 #define HAVE_ETHTOOL_GET_TS_INFO
 #endif /* RHEL >= 6.4 && RHEL < 7.0 */
 
+#if (RHEL_RELEASE_CODE && \
+     (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5)) && \
+     (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0)))
+#define HAVE_RHEL6_NETDEV_OPS_EXT_FDB
+#endif /* RHEL >= 6.5 && RHEL < 7.0 */
+
 #else /* < 2.6.33 */
 #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
 #ifndef HAVE_NETDEV_OPS_FCOE_GETWWN