From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 617B1B0C0 for ; Wed, 11 Jun 2014 07:47:12 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 10 Jun 2014 22:47:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,456,1400050800"; d="scan'208";a="546107177" Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228]) by fmsmga001.fm.intel.com with ESMTP; 10 Jun 2014 22:47:25 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 10 Jun 2014 22:47:25 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 10 Jun 2014 22:47:25 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.192]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.23]) with mapi id 14.03.0123.003; Wed, 11 Jun 2014 13:46:48 +0800 From: "Zhang, Helin" To: Neil Horman , Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH] kni: fix compile errors on Oracle Linux6.4 and RHEL6.5 Thread-Index: AQHPhJ5i5kZRffLfV0ewSZXA9DDz8ptrZo7g Date: Wed, 11 Jun 2014 05:46:47 +0000 Message-ID: References: <1402303135-28248-1-git-send-email-helin.zhang@intel.com> <20140610112321.GA6275@hmsreliant.think-freely.org> In-Reply-To: <20140610112321.GA6275@hmsreliant.think-freely.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] kni: fix compile errors on Oracle Linux6.4 and RHEL6.5 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, 11 Jun 2014 05:47:13 -0000 Hi Horman and Thomas Thank you guys for the good comments for this patch! The checking if a function is defined will be removed, and will use self-de= fined functions no matter they have been defined somewhere or not. This wil= l have the same behavior of latest Linux ixgbe/igb driver. I guess the KNI ethtool support might need to be updated soon to which is b= ased on the latest Linux source code. Regards, Helin -----Original Message----- From: Neil Horman [mailto:nhorman@tuxdriver.com]=20 Sent: Tuesday, June 10, 2014 7:23 PM To: Zhang, Helin Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] kni: fix compile errors on Oracle Linux6.4 = and RHEL6.5 On Mon, Jun 09, 2014 at 04:38:55PM +0800, Helin Zhang wrote: > From: HELIN ZHANG >=20 > The compile errors are as follows. The fixes came from standard Linux=20 > drivers of ixgbe-3.21.2 and igb-5.1.2. >=20 > * Oracle Linux6.4 > lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h:3111: > error: redefinition of 'ether_addr_equal' > include/linux/etherdevice.h:180: note: previous definition of=20 > 'ether_addr_equal' was here > * RHEL6.5 > lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h:3597: > error: redefinition of 'mmd_eee_cap_to_ethtool_sup_t' > include/linux/mdio.h:387: note: previous definition of=20 > 'mmd_eee_cap_to_ethtool_sup_t' was here > lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h:3625: > error: redefinition of 'mmd_eee_adv_to_ethtool_adv_t' > include/linux/mdio.h:415: note: previous definition of=20 > 'mmd_eee_adv_to_ethtool_adv_t' was here > lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h:3653: > error: redefinition of 'ethtool_adv_to_mmd_eee_adv_t' > include/linux/mdio.h:443: note: previous definition of=20 > 'ethtool_adv_to_mmd_eee_adv_t' was here >=20 > Signed-off-by: Helin Zhang > Acked-by: Cunming Liang > Tested-by: Waterman Cao > --- > lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 29 ++++++++++++++++= ------ > .../linuxapp/kni/ethtool/ixgbe/kcompat.h | 5 ++-- > 2 files changed, 24 insertions(+), 10 deletions(-) >=20 > diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h=20 > b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h > index 4c27d5d..26bf0b2 100644 > --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h > +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h > @@ -3534,12 +3534,13 @@ extern void _kc_skb_add_rx_frag(struct sk_buff=20 > *, int, struct page *, =20 > /********************************************************************* > ********/ #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) ) #define=20 > skb_tx_timestamp(skb) do {} while (0) -#if !(RHEL_RELEASE_CODE &&=20 > RHEL_RELEASE_CODE >=3D RHEL_RELEASE_VERSION(6,4)) -static inline bool=20 > ether_addr_equal(const u8 *addr1, const u8 *addr2) > +#ifndef ether_addr_equal > +static inline bool __kc_ether_addr_equal(const u8 *addr1, const u8=20 > +*addr2) > { > return !compare_ether_addr(addr1, addr2); } -#endif > +#define ether_addr_equal(_addr1, _addr2)=20 > +__kc_ether_addr_equal((_addr1),(_addr2)) > +#endif /* __kc_ether_addr_equal*/ I don't see why you're wrapping this in a macro twice, just #defining ether= _addr_equal to !compare_ether_addr should be sufficient here. > #else > #define HAVE_FDB_OPS > #define HAVE_ETHTOOL_GET_TS_INFO > @@ -3586,7 +3587,8 @@ static inline bool ether_addr_equal(const u8 *addr1= , const u8 *addr2) > #define ADVERTISED_40000baseLR4_Full (1 << 26) > #endif > =20 > -#if defined(ETHTOOL_GEEE) || (RHEL_RELEASE_CODE && RHEL_RELEASE_CODE=20 > <=3D RHEL_RELEASE_VERSION(6,4)) > +#if defined(ETHTOOL_GEEE) > +#ifndef mmd_eee_cap_to_ethtool_sup_t Why are we even bothering with gating this on ETHTOOL_GEEE? Or building it= in at all for that matter? ETHTOOL_GEEE doesn't having any dependence on = any hardware feature availability, we can just enable it unilaterally (if i= ts not already defined, though doing an ifndef on a function thats defined = as such is a bit wierd). =20 Theres also an argument for not doing this compat code at all, as nothing c= urrently uses it. the KNI is the only code that could reach this path, and= nothing in the KNI does so at the moment. We could just remove this code = and turn off support in the igb pmd instead, it would save some useless cod= e space. > /** > * mmd_eee_cap_to_ethtool_sup_t > * @eee_cap: value of the MMD EEE Capability register @@ -3594,7=20 > +3596,7 @@ static inline bool ether_addr_equal(const u8 *addr1, const u8 = *addr2) > * A small helper function that translates MMD EEE Capability (3.20) bit= s > * to ethtool supported settings. > */ > -static inline u32 mmd_eee_cap_to_ethtool_sup_t(u16 eee_cap) > +static inline u32 __kc_mmd_eee_cap_to_ethtool_sup_t(u16 eee_cap) > { > u32 supported =3D 0; > =20 > @@ -3613,7 +3615,11 @@ static inline u32=20 > mmd_eee_cap_to_ethtool_sup_t(u16 eee_cap) > =20 > return supported; > } > +#define mmd_eee_cap_to_ethtool_sup_t(eee_cap) \ > + __kc_mmd_eee_cap_to_ethtool_sup_t(eee_cap) > +#endif /* __kc_mmd_eee_cap_to_ethtool_sup_t */ > =20 > +#ifndef mmd_eee_adv_to_ethtool_adv_t > /** > * mmd_eee_adv_to_ethtool_adv_t > * @eee_adv: value of the MMD EEE Advertisement/Link Partner Ability=20 > registers @@ -3622,7 +3628,7 @@ static inline u32 mmd_eee_cap_to_ethtool_= sup_t(u16 eee_cap) > * and MMD EEE Link Partner Ability (7.61) bits to ethtool advertisement > * settings. > */ > -static inline u32 mmd_eee_adv_to_ethtool_adv_t(u16 eee_adv) > +static inline u32 __kc_mmd_eee_adv_to_ethtool_adv_t(u16 eee_adv) > { > u32 adv =3D 0; > =20 > @@ -3641,7 +3647,11 @@ static inline u32=20 > mmd_eee_adv_to_ethtool_adv_t(u16 eee_adv) > =20 > return adv; > } > +#define mmd_eee_adv_to_ethtool_adv_t(eee_adv) \ > + __kc_mmd_eee_adv_to_ethtool_adv_t(eee_adv) > +#endif /* mmd_eee_adv_to_ethtool_adv_t */ > =20 > +#ifndef ethtool_adv_to_mmd_eee_adv_t > /** > * ethtool_adv_to_mmd_eee_adv_t > * @adv: the ethtool advertisement settings @@ -3650,7 +3660,7 @@=20 > static inline u32 mmd_eee_adv_to_ethtool_adv_t(u16 eee_adv) > * to EEE advertisements for the MMD EEE Advertisement (7.60) and > * MMD EEE Link Partner Ability (7.61) registers. > */ > -static inline u16 ethtool_adv_to_mmd_eee_adv_t(u32 adv) > +static inline u16 __kc_ethtool_adv_to_mmd_eee_adv_t(u32 adv) > { > u16 reg =3D 0; > =20 > @@ -3669,7 +3679,10 @@ static inline u16=20 > ethtool_adv_to_mmd_eee_adv_t(u32 adv) > =20 > return reg; > } > -#endif > +#define ethtool_adv_to_mmd_eee_adv_t(adv) \ > +__kc_ethtool_adv_to_mmd_eee_adv_t(adv) > +#endif /* ethtool_adv_to_mmd_eee_adv_t */ #endif /* */ > =20 > #ifndef pci_pcie_type > #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) ) diff --git=20 > a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h=20 > b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h > index 4126d14..4e97886 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=20 > kni_netdev_features_t; > =20 > =20 > /********************************************************************* > ********/ #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) ) -#if=20 > !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >=3D RHEL_RELEASE_VERSION(6,4))= =20 > -static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) > +#ifndef ether_addr_equal > +static inline bool __kc_ether_addr_equal(const u8 *addr1, const u8=20 > +*addr2) > { > return !compare_ether_addr(addr1, addr2); } > +#define ether_addr_equal(_addr1, _addr2)=20 > +__kc_ether_addr_equal((_addr1),(_addr2)) > #endif > #else > #define HAVE_FDB_OPS > -- > 1.8.1.4 >=20 >=20