From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1blp0183.outbound.protection.outlook.com [207.46.163.183]) by dpdk.org (Postfix) with ESMTP id 7E2ED58D0 for ; Wed, 5 Mar 2014 14:30:42 +0100 (CET) Received: from BLUPR05MB200.namprd05.prod.outlook.com (10.255.191.14) by BLUPR05MB119.namprd05.prod.outlook.com (10.255.214.21) with Microsoft SMTP Server (TLS) id 15.0.893.10; Wed, 5 Mar 2014 13:32:09 +0000 Received: from BLUPR05MB200.namprd05.prod.outlook.com ([169.254.12.221]) by BLUPR05MB200.namprd05.prod.outlook.com ([169.254.12.218]) with mapi id 15.00.0888.003; Wed, 5 Mar 2014 13:32:09 +0000 From: Patrick McGleenon To: "dev@dpdk.org" Thread-Topic: kni: error building with kernel < 3.3 and ether_addr_equal backport Thread-Index: Ac84dlOOoPvdUuXnTFGRi4FmcJP3/A== Date: Wed, 5 Mar 2014 13:32:08 +0000 Message-ID: <9cfac239bfe0489d901fe0158ff227ec@BLUPR05MB200.namprd05.prod.outlook.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [86.138.252.62] x-forefront-prvs: 01415BB535 x-forefront-antispam-report: SFV:NSPM; SFS:(10019001)(6009001)(428001)(199002)(189002)(74316001)(76176001)(81816001)(81686001)(79102001)(76576001)(77982001)(59766001)(15975445006)(74366001)(95666003)(15202345003)(65816001)(80022001)(81542001)(66066001)(77096001)(80976001)(76786001)(76796001)(74706001)(63696002)(19580395003)(33646001)(83322001)(81342001)(69226001)(4396001)(53806001)(575784001)(86362001)(93516002)(92566001)(83072002)(93136001)(51856001)(85852003)(97186001)(90146001)(87266001)(46102001)(50986001)(76482001)(74662001)(47446002)(2656002)(74502001)(74876001)(54316002)(56776001)(94946001)(56816005)(47976001)(87936001)(85306002)(31966008)(95416001)(49866001)(54356001)(47736001)(94316002)(24736002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR05MB119; H:BLUPR05MB200.namprd05.prod.outlook.com; CLIP:86.138.252.62; FPR:BEB9D176.1E3BDD58.C2E16F77.58C77A79.202B8; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (: owmobility.com does not designate permitted sender hosts) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: owmobility.com Subject: [dpdk-dev] kni: error building with kernel < 3.3 and ether_addr_equal backport X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 13:30:43 -0000 Here is a patch to building DPDK 1.6 on RHEL 6 kernels. It's similar to t= he issue below. The kernel version check really only applies to vanilla k= ernels - for commercial distributions it's common for features from later k= ernels to be backported. Should we be using autoconf or something to chec= k if the code is present instead of the kernel version check? http://www.dpdk.org/browse/dpdk/commit/?id=3Dcaa3d413086205f3bff0fa4753edb7= dfbfc1f633 diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c b/lib/librt= e_eal/linuxapp/kni/ethtool/igb/igb_main.c index 6933626..33bb858 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, u= 8* addr, u16 queue) if (is_zero_ether_addr(addr)) return 0; for (i =3D 0; i < hw->mac.rar_entry_count; i++) { - if (ether_addr_equal(addr, adapter->mac_table[i].addr) && + if (kni_ether_addr_equal(addr, adapter->mac_table[i].addr) = && adapter->mac_table[i].queue =3D=3D queue) { adapter->mac_table[i].state =3D IGB_MAC_STATE_MODIF= IED; 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 a404c9f..f6f6635 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h @@ -3528,11 +3528,12 @@ extern void _kc_skb_add_rx_frag(struct sk_buff *, i= nt, 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) +static inline bool kni_ether_addr_equal(const u8 *addr1, const u8 *addr2) { return !compare_ether_addr(addr1, addr2); } #else +typedef ether_addr_equal kni_ether_addr_equal; #define HAVE_FDB_OPS #define HAVE_ETHTOOL_GET_TS_INFO #endif /* < 3.5.0 */ diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c b/lib/l= ibrte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c index cb56906..dea2192 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 =3D 0; i < hw->mac.num_rar_entries; i++) { - if (ether_addr_equal(addr, adapter->mac_table[i].addr) && + if (kni_ether_addr_equal(addr, adapter->mac_table[i].addr) = && adapter->mac_table[i].queue =3D=3D queue) { adapter->mac_table[i].state |=3D IXGBE_MAC_STATE_MO= DIFIED; adapter->mac_table[i].state &=3D ~IXGBE_MAC_STATE_I= N_USE; diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h b/lib/libr= te_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h index 3fb6b14..45f6c4c 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h @@ -3107,11 +3107,12 @@ typedef netdev_features_t kni_netdev_features_t; =20 /*************************************************************************= ****/ #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) ) -static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) +static inline bool kni_ether_addr_equal(const u8 *addr1, const u8 *addr2) { return !compare_ether_addr(addr1, addr2); } #else +typedef ether_addr_equal kni_ether_addr_equal; #define HAVE_FDB_OPS #endif /* < 3.5.0 */