DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] kni: fix igb build with kernel 4.2
@ 2015-08-27 11:11 ` Pablo de Lara
  2015-10-12 12:46   ` [dpdk-dev] " Pablo de Lara
                     ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Pablo de Lara @ 2015-08-27 11:11 UTC (permalink / raw)
  To: dev

Kernel 4.2 has introduced two new parameters in ndo_bridge_getlink,
which breaks DPDK compilation.

Linux: 7d4f8d87 ("switchdev: ad VLAN support for ports bridge-getlink")

This patch adds the necessary checks to fix it.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 13 +++++++++----
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h  |  7 ++++++-
 2 files changed, 15 insertions(+), 5 deletions(-)

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 eed8df6..b330b20 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -2250,14 +2250,14 @@ static int igb_ndo_bridge_setlink(struct net_device *dev,
 }
 
 #ifdef HAVE_BRIDGE_FILTER
-#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev, u32 filter_mask,
 				  int nlflags)
 #else
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev, u32 filter_mask)
-#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK */
+#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */
 #else
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev)
@@ -2275,11 +2275,16 @@ static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 		mode = BRIDGE_MODE_VEPA;
 
 #ifdef HAVE_NDO_FDB_ADD_VID
-#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
+#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL
+	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0,
+				nlflags, filter_mask, NULL);
+#else
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags);
+#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL */
 #else
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0);
-#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK */
+#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */
 #else
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode);
 #endif /* HAVE_NDO_FDB_ADD_VID */
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
index 852f80f..5f45b8b 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -3899,6 +3899,11 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
 
 #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) )
 /* ndo_bridge_getlink adds new nlflags parameter */
-#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#define HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
 #endif /* >= 4.1.0 */
+
+#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) )
+/* ndo_bridge_getlink adds new filter_mask and vlan_fill parameters */
+#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL
+#endif /* >= 4.2.0 */
 #endif /* _KCOMPAT_H_ */
-- 
2.1.0

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

* [dpdk-dev]  kni: fix igb build with kernel 4.2
  2015-08-27 11:11 ` [dpdk-dev] [PATCH] kni: fix igb build with kernel 4.2 Pablo de Lara
@ 2015-10-12 12:46   ` Pablo de Lara
  2015-10-12 12:49   ` Pablo de Lara
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Pablo de Lara @ 2015-10-12 12:46 UTC (permalink / raw)
  To: pablo.de.lara.guarch, dev

From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>

Kernel 4.2 has introduced two new parameters in ndo_bridge_getlink,
which breaks DPDK compilation.

Linux: 7d4f8d87 ("switchdev: ad VLAN support for ports bridge-getlink")

This patch adds the necessary checks to fix it.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

---
lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 13 +++++++++----
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h  |  7 ++++++-
 2 files changed, 15 insertions(+), 5 deletions(-)

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 eed8df6..b330b20 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -2250,14 +2250,14 @@ static int igb_ndo_bridge_setlink(struct net_device *dev,
 }
 
 #ifdef HAVE_BRIDGE_FILTER
-#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev, u32 filter_mask,
 				  int nlflags)
 #else
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev, u32 filter_mask)
-#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK */
+#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */
 #else
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev)
@@ -2275,11 +2275,16 @@ static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 		mode = BRIDGE_MODE_VEPA;
 
 #ifdef HAVE_NDO_FDB_ADD_VID
-#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
+#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL
+	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0,
+				nlflags, filter_mask, NULL);
+#else
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags);
+#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL */
 #else
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0);
-#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK */
+#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */
 #else
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode);
 #endif /* HAVE_NDO_FDB_ADD_VID */
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
index 852f80f..5f45b8b 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -3899,6 +3899,11 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
 
 #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) )
 /* ndo_bridge_getlink adds new nlflags parameter */
-#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#define HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
 #endif /* >= 4.1.0 */
+
+#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) )
+/* ndo_bridge_getlink adds new filter_mask and vlan_fill parameters */
+#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL
+#endif /* >= 4.2.0 */
 #endif /* _KCOMPAT_H_ */

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

* [dpdk-dev]  kni: fix igb build with kernel 4.2
  2015-08-27 11:11 ` [dpdk-dev] [PATCH] kni: fix igb build with kernel 4.2 Pablo de Lara
  2015-10-12 12:46   ` [dpdk-dev] " Pablo de Lara
@ 2015-10-12 12:49   ` Pablo de Lara
  2015-10-12 12:51   ` De Lara Guarch, Pablo
  2015-10-12 12:52   ` [dpdk-dev] [PATCH v2 0/2] Fix " Pablo de Lara
  3 siblings, 0 replies; 9+ messages in thread
From: Pablo de Lara @ 2015-10-12 12:49 UTC (permalink / raw)
  To: pablo.de.lara.guarch, dev

From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>

Kernel 4.2 has introduced two new parameters in ndo_bridge_getlink,
which breaks DPDK compilation.

Linux: 7d4f8d87 ("switchdev: ad VLAN support for ports bridge-getlink")

This patch adds the necessary checks to fix it.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

---
lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 13 +++++++++----
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h  |  7 ++++++-
 2 files changed, 15 insertions(+), 5 deletions(-)

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 eed8df6..b330b20 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -2250,14 +2250,14 @@ static int igb_ndo_bridge_setlink(struct net_device *dev,
 }
 
 #ifdef HAVE_BRIDGE_FILTER
-#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev, u32 filter_mask,
 				  int nlflags)
 #else
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev, u32 filter_mask)
-#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK */
+#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */
 #else
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev)
@@ -2275,11 +2275,16 @@ static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 		mode = BRIDGE_MODE_VEPA;
 
 #ifdef HAVE_NDO_FDB_ADD_VID
-#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
+#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL
+	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0,
+				nlflags, filter_mask, NULL);
+#else
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags);
+#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL */
 #else
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0);
-#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK */
+#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */
 #else
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode);
 #endif /* HAVE_NDO_FDB_ADD_VID */
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
index 852f80f..5f45b8b 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -3899,6 +3899,11 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
 
 #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) )
 /* ndo_bridge_getlink adds new nlflags parameter */
-#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#define HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
 #endif /* >= 4.1.0 */
+
+#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) )
+/* ndo_bridge_getlink adds new filter_mask and vlan_fill parameters */
+#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL
+#endif /* >= 4.2.0 */
 #endif /* _KCOMPAT_H_ */

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

* Re: [dpdk-dev] kni: fix igb build with kernel 4.2
  2015-08-27 11:11 ` [dpdk-dev] [PATCH] kni: fix igb build with kernel 4.2 Pablo de Lara
  2015-10-12 12:46   ` [dpdk-dev] " Pablo de Lara
  2015-10-12 12:49   ` Pablo de Lara
@ 2015-10-12 12:51   ` De Lara Guarch, Pablo
  2015-10-12 12:52   ` [dpdk-dev] [PATCH v2 0/2] Fix " Pablo de Lara
  3 siblings, 0 replies; 9+ messages in thread
From: De Lara Guarch, Pablo @ 2015-10-12 12:51 UTC (permalink / raw)
  To: dev



> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Monday, October 12, 2015 1:50 PM
> To: De Lara Guarch, Pablo; dev@dpdk.org
> Subject: [dpdk-dev] kni: fix igb build with kernel 4.2
> 
> From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
> 
> Kernel 4.2 has introduced two new parameters in ndo_bridge_getlink,
> which breaks DPDK compilation.
> 
> Linux: 7d4f8d87 ("switchdev: ad VLAN support for ports bridge-getlink")
> 
> This patch adds the necessary checks to fix it.
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

NACK this and previous patch. I was trying to send a v2 of this.
Sorry for the spam!

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

* [dpdk-dev] [PATCH v2 0/2] Fix build with kernel 4.2
  2015-08-27 11:11 ` [dpdk-dev] [PATCH] kni: fix igb build with kernel 4.2 Pablo de Lara
                     ` (2 preceding siblings ...)
  2015-10-12 12:51   ` De Lara Guarch, Pablo
@ 2015-10-12 12:52   ` Pablo de Lara
  2015-10-12 12:52     ` [dpdk-dev] [PATCH v2 1/2] kni: rename HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK macro Pablo de Lara
                       ` (2 more replies)
  3 siblings, 3 replies; 9+ messages in thread
From: Pablo de Lara @ 2015-10-12 12:52 UTC (permalink / raw)
  To: dev

Kernel 4.2 has introduced two new parameters in
function ndo_bridge_netlink and therefore,
DPDK does not build with it.

This patchset adds the necessary checks and
rename a previous defined macro, in order
to have a more meaningful name.

Changes in v2:
- Split patch in two patches

Pablo de Lara (2):
  kni: rename HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK macro
  kni: fix igb build with kernel 4.2

 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 13 +++++++++----
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h  |  7 ++++++-
 2 files changed, 15 insertions(+), 5 deletions(-)

-- 
2.1.0

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

* [dpdk-dev] [PATCH v2 1/2] kni: rename HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK macro
  2015-10-12 12:52   ` [dpdk-dev] [PATCH v2 0/2] Fix " Pablo de Lara
@ 2015-10-12 12:52     ` Pablo de Lara
  2015-10-12 12:52     ` [dpdk-dev] [PATCH v2 2/2] kni: fix igb build with kernel 4.2 Pablo de Lara
  2015-10-12 13:25     ` [dpdk-dev] [PATCH v2 0/2] Fix " Ferruh Yigit
  2 siblings, 0 replies; 9+ messages in thread
From: Pablo de Lara @ 2015-10-12 12:52 UTC (permalink / raw)
  To: dev

Rename HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK macro for
a more meaningful HAVE_NDO_BRIDGE_GETLINK_NLFLAGS,
as the macro is used to know if igb_ndo_bridge_getlink
function has nlflags parameter.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 8 ++++----
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h  | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

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 eed8df6..0494780 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -2250,14 +2250,14 @@ static int igb_ndo_bridge_setlink(struct net_device *dev,
 }
 
 #ifdef HAVE_BRIDGE_FILTER
-#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev, u32 filter_mask,
 				  int nlflags)
 #else
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev, u32 filter_mask)
-#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK */
+#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */
 #else
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev)
@@ -2275,11 +2275,11 @@ static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 		mode = BRIDGE_MODE_VEPA;
 
 #ifdef HAVE_NDO_FDB_ADD_VID
-#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags);
 #else
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0);
-#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK */
+#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */
 #else
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode);
 #endif /* HAVE_NDO_FDB_ADD_VID */
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
index 852f80f..e4fad18 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -3899,6 +3899,6 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
 
 #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) )
 /* ndo_bridge_getlink adds new nlflags parameter */
-#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#define HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
 #endif /* >= 4.1.0 */
 #endif /* _KCOMPAT_H_ */
-- 
2.1.0

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

* [dpdk-dev] [PATCH v2 2/2] kni: fix igb build with kernel 4.2
  2015-10-12 12:52   ` [dpdk-dev] [PATCH v2 0/2] Fix " Pablo de Lara
  2015-10-12 12:52     ` [dpdk-dev] [PATCH v2 1/2] kni: rename HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK macro Pablo de Lara
@ 2015-10-12 12:52     ` Pablo de Lara
  2015-10-12 13:25     ` [dpdk-dev] [PATCH v2 0/2] Fix " Ferruh Yigit
  2 siblings, 0 replies; 9+ messages in thread
From: Pablo de Lara @ 2015-10-12 12:52 UTC (permalink / raw)
  To: dev

Kernel 4.2 has introduced two new parameters in ndo_bridge_getlink,
which breaks DPDK compilation.

Linux: 7d4f8d87 ("switchdev: ad VLAN support for ports
bridge-getlink")

This patch adds the necessary checks to fix it.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 5 +++++
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h  | 5 +++++
 2 files changed, 10 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 0494780..b330b20 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -2276,7 +2276,12 @@ static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 
 #ifdef HAVE_NDO_FDB_ADD_VID
 #ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
+#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL
+	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0,
+				nlflags, filter_mask, NULL);
+#else
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags);
+#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL */
 #else
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0);
 #endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
index e4fad18..5f45b8b 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -3901,4 +3901,9 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
 /* ndo_bridge_getlink adds new nlflags parameter */
 #define HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
 #endif /* >= 4.1.0 */
+
+#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) )
+/* ndo_bridge_getlink adds new filter_mask and vlan_fill parameters */
+#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL
+#endif /* >= 4.2.0 */
 #endif /* _KCOMPAT_H_ */
-- 
2.1.0

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

* Re: [dpdk-dev] [PATCH v2 0/2] Fix build with kernel 4.2
  2015-10-12 12:52   ` [dpdk-dev] [PATCH v2 0/2] Fix " Pablo de Lara
  2015-10-12 12:52     ` [dpdk-dev] [PATCH v2 1/2] kni: rename HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK macro Pablo de Lara
  2015-10-12 12:52     ` [dpdk-dev] [PATCH v2 2/2] kni: fix igb build with kernel 4.2 Pablo de Lara
@ 2015-10-12 13:25     ` Ferruh Yigit
  2015-11-04  1:36       ` Thomas Monjalon
  2 siblings, 1 reply; 9+ messages in thread
From: Ferruh Yigit @ 2015-10-12 13:25 UTC (permalink / raw)
  To: dev

On Mon, Oct 12, 2015 at 01:52:56PM +0100, Pablo de Lara wrote:
> Kernel 4.2 has introduced two new parameters in
> function ndo_bridge_netlink and therefore,
> DPDK does not build with it.
> 
> This patchset adds the necessary checks and
> rename a previous defined macro, in order
> to have a more meaningful name.
> 
> Changes in v2:
> - Split patch in two patches
> 
> Pablo de Lara (2):
>   kni: rename HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK macro
>   kni: fix igb build with kernel 4.2
> 
>  lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 13 +++++++++----
>  lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h  |  7 ++++++-
>  2 files changed, 15 insertions(+), 5 deletions(-)
> 
> -- 
> 2.1.0
> 

Series Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

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

* Re: [dpdk-dev] [PATCH v2 0/2] Fix build with kernel 4.2
  2015-10-12 13:25     ` [dpdk-dev] [PATCH v2 0/2] Fix " Ferruh Yigit
@ 2015-11-04  1:36       ` Thomas Monjalon
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2015-11-04  1:36 UTC (permalink / raw)
  To: pablo.de.lara.guarch; +Cc: dev

2015-10-12 14:25, Ferruh Yigit:
> On Mon, Oct 12, 2015 at 01:52:56PM +0100, Pablo de Lara wrote:
> > Kernel 4.2 has introduced two new parameters in
> > function ndo_bridge_netlink and therefore,
> > DPDK does not build with it.
> > 
> > This patchset adds the necessary checks and
> > rename a previous defined macro, in order
> > to have a more meaningful name.
> > 
> > Changes in v2:
> > - Split patch in two patches
> > 
> > Pablo de Lara (2):
> >   kni: rename HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK macro
> >   kni: fix igb build with kernel 4.2
> 
> Series Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied, thanks

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

end of thread, other threads:[~2015-11-04  1:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1444654017-18819-1-git-send-email-pablo.de.lara.guarch@intel.com>
2015-08-27 11:11 ` [dpdk-dev] [PATCH] kni: fix igb build with kernel 4.2 Pablo de Lara
2015-10-12 12:46   ` [dpdk-dev] " Pablo de Lara
2015-10-12 12:49   ` Pablo de Lara
2015-10-12 12:51   ` De Lara Guarch, Pablo
2015-10-12 12:52   ` [dpdk-dev] [PATCH v2 0/2] Fix " Pablo de Lara
2015-10-12 12:52     ` [dpdk-dev] [PATCH v2 1/2] kni: rename HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK macro Pablo de Lara
2015-10-12 12:52     ` [dpdk-dev] [PATCH v2 2/2] kni: fix igb build with kernel 4.2 Pablo de Lara
2015-10-12 13:25     ` [dpdk-dev] [PATCH v2 0/2] Fix " Ferruh Yigit
2015-11-04  1:36       ` 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).