kni: fix build with kernel < 3.3 with netdev_features_t backport
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>
Thu, 21 Mar 2013 10:09:23 +0000 (11:09 +0100)
committerDavid Marchand <david.marchand@6wind.com>
Wed, 26 Feb 2014 10:07:28 +0000 (11:07 +0100)
commit205c33c45af62349fcbfa700c7cf5d2b32973498
tree9db953b568c2b2424a574f5c917b20c82353de4d
parentfd52b477818e3844f62f3d43d2c321af39c3f287
kni: fix build with kernel < 3.3 with netdev_features_t backport

The netdev_features_t typedef appeared in Linux 3.3, but checking the kernel
version isn't enough with some distributions (such as Debian Wheezy) that
backported it into 3.2, causing a compilation failure due to redefinition.

Since the presence of a typedef can't be tested at compile time, this commit
adds type kni_netdev_features_t, which, depending on the kernel version,
translates either to u32 or netdev_features_t.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h