[dpdk-dev] kni: error building with kernel < 3.3 and ether_addr_equal backport

David Marchand david.marchand at 6wind.com
Wed Mar 5 17:00:55 CET 2014


Hello Patrick,

I encountered this problem as well, we are currently working on a fix.

I have a few concerns, see below, but if you address them, feel free to
contribute a new patch.


On Wed, Mar 5, 2014 at 2:32 PM, Patrick McGleenon <
Patrick.McGleenon at owmobility.com> wrote:

> [..]
> diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
> b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
> index a404c9f..f6f6635 100644
> --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
> +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
> @@ -3528,11 +3528,12 @@ 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)
> -static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
> +static inline bool kni_ether_addr_equal(const u8 *addr1, const u8 *addr2)
>  {
>         return !compare_ether_addr(addr1, addr2);
>  }
>  #else
> +typedef ether_addr_equal kni_ether_addr_equal;
>  #define HAVE_FDB_OPS
>  #define HAVE_ETHTOOL_GET_TS_INFO
>  #endif /* < 3.5.0 */
>

I am not sure this typedef will work.
Did you try to build on kernels >= 3.5 ?


> diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h
> b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h
> index 3fb6b14..45f6c4c 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 kni_netdev_features_t;
>
>
>  /*****************************************************************************/
>  #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) )
> -static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
> +static inline bool kni_ether_addr_equal(const u8 *addr1, const u8 *addr2)
>  {
>         return !compare_ether_addr(addr1, addr2);
>  }
>  #else
> +typedef ether_addr_equal kni_ether_addr_equal;
>  #define HAVE_FDB_OPS
>  #endif /* < 3.5.0 */
>

Same comment.


Regards,
-- 
David Marchand


More information about the dev mailing list