DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] kni: fix igb build with kernel 4.2
Date: Thu, 27 Aug 2015 12:11:59 +0100	[thread overview]
Message-ID: <1440673919-17740-1-git-send-email-pablo.de.lara.guarch@intel.com> (raw)

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

WARNING: multiple messages have this Message-ID
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: pablo.de.lara.guarch@intel.com, dev@dpdk.org
Subject: [dpdk-dev]  kni: fix igb build with kernel 4.2
Date: Mon, 12 Oct 2015 13:46:57 +0100	[thread overview]
Message-ID: <1440673919-17740-1-git-send-email-pablo.de.lara.guarch@intel.com> (raw)
Message-ID: <20151012124657.eCqDSp47OEtlGxBpna6vb1mqeuv9_Ln_FUpTw6aZYko@z> (raw)
In-Reply-To: <1444654017-18819-1-git-send-email-pablo.de.lara.guarch@intel.com>

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_ */

WARNING: multiple messages have this Message-ID
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: pablo.de.lara.guarch@intel.com, dev@dpdk.org
Subject: [dpdk-dev]  kni: fix igb build with kernel 4.2
Date: Mon, 12 Oct 2015 13:49:30 +0100	[thread overview]
Message-ID: <1440673919-17740-1-git-send-email-pablo.de.lara.guarch@intel.com> (raw)
Message-ID: <20151012124930.710aV3pcqHGnjefdhMqUt1FqQULDqmamOl63h115P_4@z> (raw)
In-Reply-To: <1444654170-19048-1-git-send-email-pablo.de.lara.guarch@intel.com>

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_ */

             reply	other threads:[~2015-08-27 11:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1444654017-18819-1-git-send-email-pablo.de.lara.guarch@intel.com>
2015-08-27 11:11 ` Pablo de Lara [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440673919-17740-1-git-send-email-pablo.de.lara.guarch@intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).