DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] kni: error building with kernel < 3.3 and ether_addr_equal backport
@ 2014-03-05 13:32 Patrick McGleenon
  2014-03-05 16:00 ` David Marchand
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick McGleenon @ 2014-03-05 13:32 UTC (permalink / raw)
  To: dev

Here is a patch to building DPDK 1.6 on RHEL 6 kernels.   It's similar to the issue below.   The kernel version check really only applies to vanilla kernels - for commercial distributions it's common for features from later kernels to be backported.   Should we be using autoconf or something to check if the code is present instead of the kernel version check?

http://www.dpdk.org/browse/dpdk/commit/?id=caa3d413086205f3bff0fa4753edb7dfbfc1f633

diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
index 6933626..33bb858 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -9275,7 +9275,7 @@ int igb_del_mac_filter(struct igb_adapter *adapter, u8* addr, u16 queue)
        if (is_zero_ether_addr(addr))
                return 0;
        for (i = 0; i < hw->mac.rar_entry_count; i++) {
-               if (ether_addr_equal(addr, adapter->mac_table[i].addr) &&
+               if (kni_ether_addr_equal(addr, adapter->mac_table[i].addr) &&
                    adapter->mac_table[i].queue == queue) {
                        adapter->mac_table[i].state = IGB_MAC_STATE_MODIFIED;
                        memset(adapter->mac_table[i].addr, 0, ETH_ALEN);
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 */
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c
index cb56906..dea2192 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c
@@ -525,7 +525,7 @@ int ixgbe_del_mac_filter(struct ixgbe_adapter *adapter, u8* addr, u16 queue)
        if (is_zero_ether_addr(addr))
                return 0;
        for (i = 0; i < hw->mac.num_rar_entries; i++) {
-               if (ether_addr_equal(addr, adapter->mac_table[i].addr) &&
+               if (kni_ether_addr_equal(addr, adapter->mac_table[i].addr) &&
                    adapter->mac_table[i].queue == queue) {
                        adapter->mac_table[i].state |= IXGBE_MAC_STATE_MODIFIED;
                        adapter->mac_table[i].state &= ~IXGBE_MAC_STATE_IN_USE;
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 */

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

* Re: [dpdk-dev] kni: error building with kernel < 3.3 and ether_addr_equal backport
  2014-03-05 13:32 [dpdk-dev] kni: error building with kernel < 3.3 and ether_addr_equal backport Patrick McGleenon
@ 2014-03-05 16:00 ` David Marchand
  2014-03-06 14:53   ` Patrick McGleenon
  0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2014-03-05 16:00 UTC (permalink / raw)
  To: Patrick McGleenon; +Cc: dev

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@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

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

* Re: [dpdk-dev] kni: error building with kernel < 3.3 and ether_addr_equal backport
  2014-03-05 16:00 ` David Marchand
@ 2014-03-06 14:53   ` Patrick McGleenon
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick McGleenon @ 2014-03-06 14:53 UTC (permalink / raw)
  To: David Marchand; +Cc: dev

Hello David

Good point - I only compiled it on RHEL 6.4.   If you remove the typedefs it should compile on the later kernel

thanks
Patrick

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

end of thread, other threads:[~2014-03-06 14:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-05 13:32 [dpdk-dev] kni: error building with kernel < 3.3 and ether_addr_equal backport Patrick McGleenon
2014-03-05 16:00 ` David Marchand
2014-03-06 14:53   ` Patrick McGleenon

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