From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id 8C606AFD9 for ; Tue, 15 Apr 2014 15:51:30 +0200 (CEST) Received: by mail-wi0-f177.google.com with SMTP id cc10so5703841wib.4 for ; Tue, 15 Apr 2014 06:51:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=Y/1ASz65yuMCp6c/vb4Yz0rL4xQzpin9iZZSRejeNa8=; b=WAMiFcbBinWaBLWlwszRxXusefVZzU1JnM9TJmfxN6+Wtjs3XaY7/9lMSXKBjiiejJ RCpTCQPY1bvwwtCf69ibtQaxHTDb1/dYQs74myCLnnJ3cuuoKFH5vouGv1Evbq4IX+9q e0IAxdbonTkfaRswNb9OrX95YWebJakkbvPj1eDXlle8DSyCN2wQtQL1ETGs51tavnEF E50EjJLcgtdaMe6BOgReT1BypLbqdzSNzWEDb0MtOyvDlY56XDBcepG1bwySkVQGmbFO ADAyDwqS9scuTxKwfbtWokvDJHFdLGXemwRfzdqdqqqmZJy9bHG1NXhBv8CBUa2D+qc3 xotw== X-Gm-Message-State: ALoCoQlhTE1tYn1SfJq8YxU+/9EFEJ3ot8yG9cwAZChFqAwPW8aDESzSiD5OTvR3sJ1hf0s3HRp+ X-Received: by 10.194.188.41 with SMTP id fx9mr1805501wjc.56.1397569890836; Tue, 15 Apr 2014 06:51:30 -0700 (PDT) Received: from alcyon.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id go20sm1995477wjc.18.2014.04.15.06.51.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Apr 2014 06:51:30 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Tue, 15 Apr 2014 15:51:23 +0200 Message-Id: <1397569883-16761-2-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1397569883-16761-1-git-send-email-david.marchand@6wind.com> References: <1397569883-16761-1-git-send-email-david.marchand@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/2] kni: more compatibility with RHEL 6.4/6.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: Tue, 15 Apr 2014 13:51:31 -0000 From: Jean-Mickael Guerin For RH 6.5: - always include mdio.h to get the definitions of MDIO_EEE, ETHTOOL_GEEE - is_link_local_ether_addr(), pcie_capability_clear_and_set_word(), and ether_addr_equal() have been backported For RH 6.4: - same issue with ether_addr_equal() - here ETH_GEE is defined without having the functions. igb_ethtool.c:2441: error: implicit declaration of function ‘mmd_eee_adv_to_ethtool_adv_t’ Signed-off-by: Jean-Mickael Guerin --- lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.c | 6 ++++-- lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 17 ++++++++++++----- lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h | 2 ++ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.c index d45eec5..bde3a83 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.c @@ -1270,7 +1270,8 @@ int _kc_simple_open(struct inode *inode, struct file *file) /******************************************************************************/ #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) ) -#if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) +#if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) && \ + !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5)) static inline int __kc_pcie_cap_version(struct pci_dev *dev) { int pos; @@ -1425,7 +1426,8 @@ int __kc_pcie_capability_clear_and_set_word(struct pci_dev *dev, int pos, return ret; } -#endif /* !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) */ +#endif /* !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) && \ + !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5)) */ #endif /* < 3.7.0 */ /******************************************************************************/ diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h index 70bc1a2..511596b 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h @@ -3534,16 +3534,19 @@ 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) +#if !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,4)) static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) { return !compare_ether_addr(addr1, addr2); } +#endif #else #define HAVE_FDB_OPS #define HAVE_ETHTOOL_GET_TS_INFO #endif /* < 3.5.0 */ /*****************************************************************************/ +#include #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0) ) #define PCI_EXP_LNKCAP2 44 /* Link Capability 2 */ @@ -3565,8 +3568,6 @@ static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) #ifndef MDIO_EEE_10GKR #define MDIO_EEE_10GKR 0x0040 /* 10G KR EEE cap */ #endif -#else /* < 3.6.0 */ -#include #endif /* < 3.6.0 */ /******************************************************************************/ @@ -3584,6 +3585,8 @@ static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) #define ADVERTISED_40000baseSR4_Full (1 << 25) #define ADVERTISED_40000baseLR4_Full (1 << 26) #endif + +#if !defined(ETHTOOL_GEEE) || (RHEL_RELEASE_CODE && RHEL_RELEASE_CODE <= RHEL_RELEASE_VERSION(6,4)) /** * mmd_eee_cap_to_ethtool_sup_t * @eee_cap: value of the MMD EEE Capability register @@ -3666,6 +3669,7 @@ static inline u16 ethtool_adv_to_mmd_eee_adv_t(u32 adv) return reg; } +#endif #ifndef pci_pcie_type #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) ) @@ -3687,7 +3691,8 @@ static inline u8 pci_pcie_type(struct pci_dev *pdev) #define ptp_clock_register(caps, args...) ptp_clock_register(caps) -#if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) +#if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) && \ + !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5)) int __kc_pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val); #define pcie_capability_read_word(d,p,v) __kc_pcie_capability_read_word(d,p,v) int __kc_pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val); @@ -3704,7 +3709,8 @@ static inline int pcie_capability_clear_word(struct pci_dev *dev, int pos, { return __kc_pcie_capability_clear_and_set_word(dev, pos, clear, 0); } -#endif /* !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) */ +#endif /* !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) && \ + !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5)) */ #if (SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) #define USE_CONST_DEV_UC_CHAR @@ -3727,7 +3733,8 @@ static inline int pcie_capability_clear_word(struct pci_dev *dev, int pos, /* Reserved Ethernet Addresses per IEEE 802.1Q */ static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 }; -#if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) +#if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) &&\ + !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5)) static inline bool is_link_local_ether_addr(const u8 *addr) { __be16 *a = (__be16 *)addr; diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h index 3fb6b14..4126d14 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h @@ -3107,10 +3107,12 @@ typedef netdev_features_t kni_netdev_features_t; /*****************************************************************************/ #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) ) +#if !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,4)) static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) { return !compare_ether_addr(addr1, addr2); } +#endif #else #define HAVE_FDB_OPS #endif /* < 3.5.0 */ -- 1.7.10.4