summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@nsn.com>2014-02-04 13:59:09 +0100
committerDavid Marchand <david.marchand@6wind.com>2014-02-26 11:07:29 +0100
commit645b0d13c93d1761d7ba2aa138403df817348f30 (patch)
tree1b04ad8ef733e07ac98f55341bac40b633dcd685
parent205c33c45af62349fcbfa700c7cf5d2b32973498 (diff)
downloaddpdk-645b0d13c93d1761d7ba2aa138403df817348f30.zip
dpdk-645b0d13c93d1761d7ba2aa138403df817348f30.tar.gz
dpdk-645b0d13c93d1761d7ba2aa138403df817348f30.tar.xz
kni: fix build with kernel 3.14
ether_addr_equal() was added in Linux 3.5. compare_ether_addr() was deleted in 3.14. Start using ether_addr_equal() and provide an own implementation for older kernels. This fixes the compilation with Linux 3.14-rc1. Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
-rw-r--r--lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c2
-rw-r--r--lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h4
-rw-r--r--lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c2
-rw-r--r--lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h4
4 files changed, 10 insertions, 2 deletions
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
index a647644..6933626 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -9275,7 +9275,7 @@ int igb_del_mac_filter(struct igb_adapter *adapter, u8* addr, u16 queue)
if (is_zero_ether_addr(addr))
return 0;
for (i = 0; i < hw->mac.rar_entry_count; i++) {
- if (!compare_ether_addr(addr, adapter->mac_table[i].addr) &&
+ if (ether_addr_equal(addr, adapter->mac_table[i].addr) &&
adapter->mac_table[i].queue == queue) {
adapter->mac_table[i].state = IGB_MAC_STATE_MODIFIED;
memset(adapter->mac_table[i].addr, 0, ETH_ALEN);
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
index 9dc9c9c..a404c9f 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -3528,6 +3528,10 @@ extern void _kc_skb_add_rx_frag(struct sk_buff *, int, struct page *,
/*****************************************************************************/
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) )
#define skb_tx_timestamp(skb) do {} while (0)
+static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
+{
+ return !compare_ether_addr(addr1, addr2);
+}
#else
#define HAVE_FDB_OPS
#define HAVE_ETHTOOL_GET_TS_INFO
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c
index 947be44..cb56906 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c
@@ -525,7 +525,7 @@ int ixgbe_del_mac_filter(struct ixgbe_adapter *adapter, u8* addr, u16 queue)
if (is_zero_ether_addr(addr))
return 0;
for (i = 0; i < hw->mac.num_rar_entries; i++) {
- if (!compare_ether_addr(addr, adapter->mac_table[i].addr) &&
+ if (ether_addr_equal(addr, adapter->mac_table[i].addr) &&
adapter->mac_table[i].queue == queue) {
adapter->mac_table[i].state |= IXGBE_MAC_STATE_MODIFIED;
adapter->mac_table[i].state &= ~IXGBE_MAC_STATE_IN_USE;
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h
index 3fe777a..3fb6b14 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h
@@ -3107,6 +3107,10 @@ typedef netdev_features_t kni_netdev_features_t;
/*****************************************************************************/
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) )
+static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
+{
+ return !compare_ether_addr(addr1, addr2);
+}
#else
#define HAVE_FDB_OPS
#endif /* < 3.5.0 */