All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
To: dev@dpdk.org
Subject: [PATCH 1/2] kni: fix igb_ndo_bridge_getlink to build with 4.1
Date: Thu, 25 Jun 2015 14:09:39 -0500	[thread overview]
Message-ID: <1435259380-26251-2-git-send-email-miguel.bernal.marin@linux.intel.com> (raw)
In-Reply-To: <1435259380-26251-1-git-send-email-miguel.bernal.marin@linux.intel.com>

ndo_bridge_getlink has changed in kernel release 4.1. It
adds new parameter which brakes compilation.

This patch add the properly checks to fix it.

Fixes: 46c264daaaa5 ("bridge/nl: remove wrong use of NLM_F_MULTI")

Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
---
 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 10 ++++++++++
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h  |  5 +++++
 2 files changed, 15 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 fa24d16..47198bb 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -2250,8 +2250,14 @@ static int igb_ndo_bridge_setlink(struct net_device *dev,
 }
 
 #ifdef HAVE_BRIDGE_FILTER
+#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+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 */
 #else
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev)
@@ -2269,7 +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
+	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 */
 #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 44b9ebf..96d68a2 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -3891,4 +3891,9 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
 #define vlan_tx_tag_present skb_vlan_tag_present
 #define HAVE_NDO_BRIDGE_SET_DEL_LINK_FLAGS
 #endif /* 4.0.0 */
+
+#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) )
+/* ndo_bridge_getlink adds new nlflags parameter */
+#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#endif /* >= 4.1.0 */
 #endif /* _KCOMPAT_H_ */
-- 
2.3.3

  reply	other threads:[~2015-06-25 19:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 19:09 [PATCH 0/2] kni: fix build with kernel 4.1 Miguel Bernal Marin
2015-06-25 19:09 ` Miguel Bernal Marin [this message]
2015-06-25 19:09 ` [PATCH 2/2] kni: fix header_ops to build with 4.1 Miguel Bernal Marin
2015-06-25 21:56 ` [PATCH 0/2] kni: fix build with kernel 4.1 De Lara Guarch, Pablo
2015-06-26 14:36   ` Miguel Bernal Marin
2015-06-26 22:14 ` [PATCH v2 0/4] " Miguel Bernal Marin
2015-06-26 22:14   ` [PATCH v2 1/4] kni: fix igb_ndo_bridge_getlink to build with 4.1 Miguel Bernal Marin
2015-07-10 15:41     ` Zhang, Helin
2015-06-26 22:14   ` [PATCH v2 2/4] kni: fix header_ops " Miguel Bernal Marin
2015-07-10 15:31     ` Zhang, Helin
2015-06-26 22:14   ` [PATCH v2 3/4] kni: fix function parameter from proto_ops pointers Miguel Bernal Marin
2015-07-10 15:34     ` Zhang, Helin
2015-07-10 15:42       ` Thomas Monjalon
2015-06-26 22:14   ` [PATCH v2 4/4] kni: fix missing validation when vhost HDR is enabled Miguel Bernal Marin
2015-07-10 15:35     ` Zhang, Helin
2015-07-01 13:14   ` [PATCH v2 0/4] kni: fix build with kernel 4.1 De Lara Guarch, Pablo
2015-07-10 10:00     ` 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=1435259380-26251-2-git-send-email-miguel.bernal.marin@linux.intel.com \
    --to=miguel.bernal.marin@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.