kni: fix build on Fedora 18 with kernel 3.6.10
authorHelin Zhang <helin.zhang@intel.com>
Thu, 22 May 2014 03:35:17 +0000 (11:35 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 22 May 2014 14:30:28 +0000 (16:30 +0200)
commitd719bc02aa4acdc147512b23ecab123a49ff3bac
treed75f80914629575afbc5e15f197a1c6214ee58e1
parent1f1f3a0078c449e82f81be3d934c7f24441e3db4
kni: fix build on Fedora 18 with kernel 3.6.10

Error of "implicit-function-declaration" can be seen when building KNI
kernel module on Linux kernel 3.6.10 platform, as follows.
  lib/librte_eal/linuxapp/kni/igb_ethtool.c:
    In function igb_get_eee:
  lib/librte_eal/linuxapp/kni/igb_ethtool.c:
    2441:4: error: implicit declaration of function
    mmd_eee_adv_to_ethtool_adv_t
  lib/librte_eal/linuxapp/kni/igb_ethtool.c:
    In function igb_set_eee:
  lib/librte_eal/linuxapp/kni/igb_ethtool.c:
    2551:2: error: implicit declaration of function
    ethtool_adv_to_mmd_eee_adv_t

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".

Reported-by: Prashant Upadhyaya <prashant.upadhyaya@aricent.com>
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h