From: Ferruh Yigit <ferruh.yigit@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/2] kni: fix build for 5.0 for igb_ndo_bridge_setlink()
Date: Tue, 22 Jan 2019 15:44:29 +0000 [thread overview]
Message-ID: <20190122154429.41882-2-ferruh.yigit@intel.com> (raw)
In-Reply-To: <20190122154429.41882-1-ferruh.yigit@intel.com>
Build error seen with Linux kernel 5.0 and
when CONFIG_RTE_KNI_KMOD_ETHTOOL is enabled.
build error:
.../build/build/kernel/linux/kni/igb_main.c:2348:24:
error: initialization of
‘int (*)(struct net_device *, struct nlmsghdr *, u16,
struct netlink_ext_ack *)’
{aka ‘int (*)(struct net_device *, struct nlmsghdr *,
short unsigned int, struct netlink_ext_ack *)’}
from incompatible pointer type
‘int (*)(struct net_device *, struct nlmsghdr *, u16)’
{aka ‘int (*)(struct net_device *, struct nlmsghdr *,
short unsigned int)’}
[-Werror=incompatible-pointer-types]
.ndo_bridge_setlink = igb_ndo_bridge_setlink,
^~~~~~~~~~~~~~~~~~~~~~
.../build/build/kernel/linux/kni/igb_main.c:2348:24:
note: (near initialization for ‘igb_netdev_ops.ndo_bridge_setlink’)
igb_ndo_bridge_setlink() is changed in Linux kernel version 5.0
and now requires a new parameter, 'struct netlink_ext_ack *extack'.
Fixed by adding a new parameter with a kernel version check.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
kernel/linux/kni/ethtool/igb/igb_main.c | 5 +++++
kernel/linux/kni/ethtool/igb/kcompat.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/kernel/linux/kni/ethtool/igb/igb_main.c b/kernel/linux/kni/ethtool/igb/igb_main.c
index af378d2f2..0b4faeae5 100644
--- a/kernel/linux/kni/ethtool/igb/igb_main.c
+++ b/kernel/linux/kni/ethtool/igb/igb_main.c
@@ -2207,7 +2207,12 @@ static int igb_ndo_fdb_dump(struct sk_buff *skb,
#ifdef HAVE_NDO_BRIDGE_SET_DEL_LINK_FLAGS
static int igb_ndo_bridge_setlink(struct net_device *dev,
struct nlmsghdr *nlh,
+#ifdef HAVE_NDO_BRIDGE_SETLINK_EXTACK
+ u16 flags, struct netlink_ext_ack *extack)
+#else
u16 flags)
+#endif
+
#else
static int igb_ndo_bridge_setlink(struct net_device *dev,
struct nlmsghdr *nlh)
diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h
index 068cfeb52..11b15f3a9 100644
--- a/kernel/linux/kni/ethtool/igb/kcompat.h
+++ b/kernel/linux/kni/ethtool/igb/kcompat.h
@@ -3942,6 +3942,7 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) )
#define dev_open(x) dev_open(x, NULL)
+#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
#endif /* >= 5.0.0 */
#if defined(timer_setup) && defined(from_timer)
--
2.17.2
next prev parent reply other threads:[~2019-01-22 15:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 15:44 [dpdk-dev] [PATCH 1/2] kni: fix build for 5.0 for dev_open() Ferruh Yigit
2019-01-22 15:44 ` Ferruh Yigit [this message]
2019-01-22 16:59 ` Ferruh Yigit
2019-01-23 21:39 ` Thomas Monjalon
2019-01-24 8:35 ` Ferruh Yigit
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=20190122154429.41882-2-ferruh.yigit@intel.com \
--to=ferruh.yigit@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).