DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] kni: disable FDB operations on RHEL 6.5
@ 2014-04-15 13:51 David Marchand
  2014-04-15 13:51 ` [dpdk-dev] [PATCH 2/2] kni: more compatibility with RHEL 6.4/6.5 David Marchand
  2014-04-17 22:23 ` [dpdk-dev] [PATCH 1/2] kni: disable FDB operations on RHEL 6.5 Thomas Monjalon
  0 siblings, 2 replies; 4+ messages in thread
From: David Marchand @ 2014-04-15 13:51 UTC (permalink / raw)
  To: dev

From: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>

On RH 6.5:
igb_main.c:2298: error: unknown field ‘ndo_fdb_add’ specified in
initializer

FDB ops are present in RH 6.5 via the extension of netdev, so add the
ifdef inside the netdev ops definition of igb.

However, FDB functions are not set for RHEL 6.5: the implementation
relies on dev_mc_add_excl API which has not been backported.

Signed-off-by: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
---
 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c |    2 ++
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h  |    6 ++++++
 2 files changed, 8 insertions(+)

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..54b3ccf 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -2294,12 +2294,14 @@ static const struct net_device_ops igb_netdev_ops = {
 #ifdef HAVE_VLAN_RX_REGISTER
 	.ndo_vlan_rx_register	= igb_vlan_mode,
 #endif
+#ifndef HAVE_RHEL6_NETDEV_OPS_EXT_FDB
 #ifdef NTF_SELF
 	.ndo_fdb_add		= igb_ndo_fdb_add,
 #ifndef USE_DEFAULT_FDB_DEL_DUMP
 	.ndo_fdb_del		= igb_ndo_fdb_del,
 	.ndo_fdb_dump		= igb_ndo_fdb_dump,
 #endif
+#endif /* ! HAVE_RHEL6_NETDEV_OPS_EXT_FDB */
 #ifdef HAVE_BRIDGE_ATTRIBS
 	.ndo_bridge_setlink	= igb_ndo_bridge_setlink,
 	.ndo_bridge_getlink	= igb_ndo_bridge_getlink,
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
index a404c9f..70bc1a2 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -2837,6 +2837,12 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
 #define HAVE_ETHTOOL_GET_TS_INFO
 #endif /* RHEL >= 6.4 && RHEL < 7.0 */
 
+#if (RHEL_RELEASE_CODE && \
+     (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5)) && \
+     (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0)))
+#define HAVE_RHEL6_NETDEV_OPS_EXT_FDB
+#endif /* RHEL >= 6.5 && RHEL < 7.0 */
+
 #else /* < 2.6.33 */
 #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
 #ifndef HAVE_NETDEV_OPS_FCOE_GETWWN
-- 
1.7.10.4

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

* [dpdk-dev] [PATCH 2/2] kni: more compatibility with RHEL 6.4/6.5
  2014-04-15 13:51 [dpdk-dev] [PATCH 1/2] kni: disable FDB operations on RHEL 6.5 David Marchand
@ 2014-04-15 13:51 ` David Marchand
  2014-04-17 22:24   ` Thomas Monjalon
  2014-04-17 22:23 ` [dpdk-dev] [PATCH 1/2] kni: disable FDB operations on RHEL 6.5 Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: David Marchand @ 2014-04-15 13:51 UTC (permalink / raw)
  To: dev

From: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>

For RH 6.5:
- always include mdio.h to get the definitions of MDIO_EEE, ETHTOOL_GEEE
- is_link_local_ether_addr(), pcie_capability_clear_and_set_word(),  and
  ether_addr_equal() have been backported

For RH 6.4:
- same issue with ether_addr_equal()
- here ETH_GEE is defined without having the functions.

igb_ethtool.c:2441: error: implicit declaration of function ‘mmd_eee_adv_to_ethtool_adv_t’

Signed-off-by: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
---
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.c   |    6 ++++--
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h   |   17 ++++++++++++-----
 lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h |    2 ++
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.c
index d45eec5..bde3a83 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.c
@@ -1270,7 +1270,8 @@ int _kc_simple_open(struct inode *inode, struct file *file)
 
 /******************************************************************************/
 #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) )
-#if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0))
+#if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) && \
+    !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5))
 static inline int __kc_pcie_cap_version(struct pci_dev *dev)
 {
 	int pos;
@@ -1425,7 +1426,8 @@ int __kc_pcie_capability_clear_and_set_word(struct pci_dev *dev, int pos,
 
 	return ret;
 }
-#endif /* !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) */
+#endif /* !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) && \
+          !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5)) */
 #endif /* < 3.7.0 */
 
 /******************************************************************************/
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
index 70bc1a2..511596b 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -3534,16 +3534,19 @@ 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)
+#if !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,4))
 static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
 {
 	return !compare_ether_addr(addr1, addr2);
 }
+#endif
 #else
 #define HAVE_FDB_OPS
 #define HAVE_ETHTOOL_GET_TS_INFO
 #endif /* < 3.5.0 */
 
 /*****************************************************************************/
+#include <linux/mdio.h>
 #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0) )
 #define PCI_EXP_LNKCAP2		44	/* Link Capability 2 */
 
@@ -3565,8 +3568,6 @@ static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
 #ifndef MDIO_EEE_10GKR
 #define MDIO_EEE_10GKR		0x0040	/* 10G KR EEE cap */
 #endif
-#else /* < 3.6.0 */
-#include <linux/mdio.h>
 #endif /* < 3.6.0 */
 
 /******************************************************************************/
@@ -3584,6 +3585,8 @@ static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
 #define ADVERTISED_40000baseSR4_Full	(1 << 25)
 #define ADVERTISED_40000baseLR4_Full	(1 << 26)
 #endif
+
+#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
@@ -3666,6 +3669,7 @@ static inline u16 ethtool_adv_to_mmd_eee_adv_t(u32 adv)
 
 	return reg;
 }
+#endif
 
 #ifndef pci_pcie_type
 #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) )
@@ -3687,7 +3691,8 @@ static inline u8 pci_pcie_type(struct pci_dev *pdev)
 
 #define ptp_clock_register(caps, args...) ptp_clock_register(caps)
 
-#if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0))
+#if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) && \
+    !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5))
 int __kc_pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val);
 #define pcie_capability_read_word(d,p,v) __kc_pcie_capability_read_word(d,p,v)
 int __kc_pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val);
@@ -3704,7 +3709,8 @@ static inline int pcie_capability_clear_word(struct pci_dev *dev, int pos,
 {
 	return __kc_pcie_capability_clear_and_set_word(dev, pos, clear, 0);
 }
-#endif /* !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) */
+#endif /* !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) && \
+          !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5)) */
 
 #if (SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0))
 #define USE_CONST_DEV_UC_CHAR
@@ -3727,7 +3733,8 @@ static inline int pcie_capability_clear_word(struct pci_dev *dev, int pos,
 /* Reserved Ethernet Addresses per IEEE 802.1Q */
 static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) = {
 	0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
-#if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0))
+#if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) &&\
+    !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5))
 static inline bool is_link_local_ether_addr(const u8 *addr)
 {
 	__be16 *a = (__be16 *)addr;
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h
index 3fb6b14..4126d14 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h
@@ -3107,10 +3107,12 @@ typedef netdev_features_t kni_netdev_features_t;
 
 /*****************************************************************************/
 #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) )
+#if !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,4))
 static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
 {
 	return !compare_ether_addr(addr1, addr2);
 }
+#endif
 #else
 #define HAVE_FDB_OPS
 #endif /* < 3.5.0 */
-- 
1.7.10.4

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

* Re: [dpdk-dev] [PATCH 1/2] kni: disable FDB operations on RHEL 6.5
  2014-04-15 13:51 [dpdk-dev] [PATCH 1/2] kni: disable FDB operations on RHEL 6.5 David Marchand
  2014-04-15 13:51 ` [dpdk-dev] [PATCH 2/2] kni: more compatibility with RHEL 6.4/6.5 David Marchand
@ 2014-04-17 22:23 ` Thomas Monjalon
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2014-04-17 22:23 UTC (permalink / raw)
  To: Jean-Mickael Guerin; +Cc: dev

> From: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
> 
> On RH 6.5:
> igb_main.c:2298: error: unknown field ‘ndo_fdb_add’ specified in
> initializer
> 
> FDB ops are present in RH 6.5 via the extension of netdev, so add the
> ifdef inside the netdev ops definition of igb.
> 
> However, FDB functions are not set for RHEL 6.5: the implementation
> relies on dev_mc_add_excl API which has not been backported.
> 
> Signed-off-by: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>

Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>

It's applied for version 1.6.0r2.

Thanks
-- 
Thomas

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

* Re: [dpdk-dev] [PATCH 2/2] kni: more compatibility with RHEL 6.4/6.5
  2014-04-15 13:51 ` [dpdk-dev] [PATCH 2/2] kni: more compatibility with RHEL 6.4/6.5 David Marchand
@ 2014-04-17 22:24   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2014-04-17 22:24 UTC (permalink / raw)
  To: Jean-Mickael Guerin; +Cc: dev

2014-04-15 15:51, David Marchand:
> From: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
> 
> For RH 6.5:
> - always include mdio.h to get the definitions of MDIO_EEE, ETHTOOL_GEEE
> - is_link_local_ether_addr(), pcie_capability_clear_and_set_word(),  and
>   ether_addr_equal() have been backported
> 
> For RH 6.4:
> - same issue with ether_addr_equal()
> - here ETH_GEE is defined without having the functions.
> 
> igb_ethtool.c:2441: error: implicit declaration of function
> ‘mmd_eee_adv_to_ethtool_adv_t’
> 
> Signed-off-by: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>

Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>

It's applied for version 1.6.0r2.

Thanks
-- 
Thomas

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

end of thread, other threads:[~2014-04-17 22:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-15 13:51 [dpdk-dev] [PATCH 1/2] kni: disable FDB operations on RHEL 6.5 David Marchand
2014-04-15 13:51 ` [dpdk-dev] [PATCH 2/2] kni: more compatibility with RHEL 6.4/6.5 David Marchand
2014-04-17 22:24   ` Thomas Monjalon
2014-04-17 22:23 ` [dpdk-dev] [PATCH 1/2] kni: disable FDB operations on RHEL 6.5 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).