DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] kni: bug fix for compile issue in KNI on Fedora 18 with kernel 3.6.10
@ 2014-05-22  3:35 Helin Zhang
  2014-05-22 14:32 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Helin Zhang @ 2014-05-22  3:35 UTC (permalink / raw)
  To: dev

Error of "implicit-function-declaration" can be seen when building KNI
kernel module on Linux kernel 3.6.10 platform, as follows.
"x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/igb_ethtool.c:
  In function \u2018igb_get_eee\u2019:
x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/igb_ethtool.c:
  2441:4: error: implicit declaration of function
  \u2018mmd_eee_adv_to_ethtool_adv_t\u2019
  [-Werror=implicit-function-declaration]
x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/igb_ethtool.c:
 In function \u2018igb_set_eee\u2019:
x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/igb_ethtool.c:
  2551:2: error: implicit declaration of function
  \u2018ethtool_adv_to_mmd_eee_adv_t\u2019
  [-Werror=implicit-function-declaration]"

The root cause is as follows.
On Fedora 18 with kernel 3.6.10, ETHTOOL_GEEE is defined in Linux
header file of "linux/ethtool.h", while is not defined in most of other
linux kernel versions.
mmd_eee_cap_to_ethtool_sup_t(), mmd_eee_adv_to_ethtool_adv_t() and
ethtool_adv_to_mmd_eee_adv_t() in kcompat.h are disabled by "#if
!defined(ETHTOOL_GEEE) || (RHEL_RELEASE_CODE && RHEL_RELEASE_CODE <=
RHEL_RELEASE_VERSION(6,4))", while are called in igb_get_eee() in
igb_ethtool.c which is enabled by "#ifdef ETHTOOL_GEEE".

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
index e9e80ea..4c27d5d 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -3586,7 +3586,7 @@ static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
 #define ADVERTISED_40000baseLR4_Full	(1 << 26)
 #endif
 
-#if !defined(ETHTOOL_GEEE) || (RHEL_RELEASE_CODE && RHEL_RELEASE_CODE <= RHEL_RELEASE_VERSION(6,4))
+#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
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-22 14:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-22  3:35 [dpdk-dev] [PATCH v2] kni: bug fix for compile issue in KNI on Fedora 18 with kernel 3.6.10 Helin Zhang
2014-05-22 14:32 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).