From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <shemming@brocade.com>
Subject: [PATCH] kni: fix build with Linux kernel 4.1 or later
Date: Thu, 9 Jul 2015 10:43:26 -0700 [thread overview]
Message-ID: <1436463806-2729-1-git-send-email-stephen@networkplumber.org> (raw)
From: Stephen Hemminger <shemming@brocade.com>
The internal API for some functions used by KNI changes in current
kernel. KNI really needs to be submitted upstream (by Intel)
to keep it maintainable.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 12 +++++++++++-
lib/librte_eal/linuxapp/kni/kni_net.c | 6 ++++--
2 files changed, 15 insertions(+), 3 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 fa24d16..62fb53b 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -2250,10 +2250,16 @@ static int igb_ndo_bridge_setlink(struct net_device *dev,
}
#ifdef HAVE_BRIDGE_FILTER
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
struct net_device *dev, u32 filter_mask)
#else
static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
+ struct net_device *dev,
+ u32 filter_mask, int nlflags)
+#endif
+#else
+static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
struct net_device *dev)
#endif
{
@@ -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
- return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
+ return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, nl_flags);
+#else
+ return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, 0);
+#endif
#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/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c
index e34a0fd..e29caeb 100644
--- a/lib/librte_eal/linuxapp/kni/kni_net.c
+++ b/lib/librte_eal/linuxapp/kni/kni_net.c
@@ -601,7 +601,7 @@ kni_net_header(struct sk_buff *skb, struct net_device *dev,
return dev->hard_header_len;
}
-
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
/*
* Re-fill the eth header
*/
@@ -616,6 +616,7 @@ kni_net_rebuild_header(struct sk_buff *skb)
return 0;
}
+#endif
/**
* kni_net_set_mac - Change the Ethernet Address of the KNI NIC
@@ -646,8 +647,9 @@ static int kni_net_change_carrier(struct net_device *dev, bool new_carrier)
static const struct header_ops kni_net_header_ops = {
.create = kni_net_header,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
.rebuild = kni_net_rebuild_header,
- .cache = NULL, /* disable caching */
+#endif
};
static const struct net_device_ops kni_net_netdev_ops = {
--
2.1.4
next reply other threads:[~2015-07-09 17:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-09 17:43 Stephen Hemminger [this message]
2015-07-10 0:53 ` [PATCH] kni: fix build with Linux kernel 4.1 or later Thomas Monjalon
2015-07-10 7:16 ` De Lara Guarch, Pablo
2015-07-10 8:00 ` Thomas Monjalon
2015-07-10 17:25 ` Stephen Hemminger
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=1436463806-2729-1-git-send-email-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=shemming@brocade.com \
/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.