refresh 0004-build-bump-minimum-Meson-version-to-0.47.1.patch for 18.11.1
[deb_dpdk.git] / debian / patches / 0002-kni-fix-build-for-igb_ndo_bridge_setlink-in-Linux-5..patch
1 From 18cb8293e312bc3bd67211a5a540676f1c667d88 Mon Sep 17 00:00:00 2001
2 From: Ferruh Yigit <ferruh.yigit@intel.com>
3 Date: Tue, 22 Jan 2019 15:44:29 +0000
4 Subject: [PATCH 2/2] kni: fix build for igb_ndo_bridge_setlink in Linux 5.0
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Build error seen with Linux kernel 5.0 and
10 when CONFIG_RTE_KNI_KMOD_ETHTOOL is enabled.
11
12 build error:
13 .../build/build/kernel/linux/kni/igb_main.c:2348:24:
14   error: initialization of
15   ‘int (*)(struct net_device *, struct nlmsghdr *, u16,
16         struct netlink_ext_ack *)’
17   {aka ‘int (*)(struct net_device *, struct nlmsghdr *,
18         short unsigned int,  struct netlink_ext_ack *)’}
19   from incompatible pointer type
20   ‘int (*)(struct net_device *, struct nlmsghdr *, u16)’
21   {aka ‘int (*)(struct net_device *, struct nlmsghdr *,
22         short unsigned int)’}
23   [-Werror=incompatible-pointer-types]
24   .ndo_bridge_setlink = igb_ndo_bridge_setlink,
25                         ^~~~~~~~~~~~~~~~~~~~~~
26 .../build/build/kernel/linux/kni/igb_main.c:2348:24:
27   note: (near initialization for ‘igb_netdev_ops.ndo_bridge_setlink’)
28
29 igb_ndo_bridge_setlink() is changed in Linux kernel version 5.0
30 and now requires a new parameter, 'struct netlink_ext_ack *extack'.
31 Fixed by adding a new parameter with a kernel version check.
32
33 Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
34
35 Origin: upstream, https://git.dpdk.org/dpdk/commit/?id=18cb8293e312bc3bd67211a5a540676f1c667d88
36 Bug-Ubuntu: https://bugs.launchpad.net/bugs/1814919
37 Last-Update: 2019-02-07
38
39 ---
40  kernel/linux/kni/ethtool/igb/igb_main.c | 5 +++++
41  kernel/linux/kni/ethtool/igb/kcompat.h  | 1 +
42  2 files changed, 6 insertions(+)
43
44 diff --git a/kernel/linux/kni/ethtool/igb/igb_main.c b/kernel/linux/kni/ethtool/igb/igb_main.c
45 index af378d2f2..0b4faeae5 100644
46 --- a/kernel/linux/kni/ethtool/igb/igb_main.c
47 +++ b/kernel/linux/kni/ethtool/igb/igb_main.c
48 @@ -2207,7 +2207,12 @@ static int igb_ndo_fdb_dump(struct sk_buff *skb,
49  #ifdef HAVE_NDO_BRIDGE_SET_DEL_LINK_FLAGS
50  static int igb_ndo_bridge_setlink(struct net_device *dev,
51                                   struct nlmsghdr *nlh,
52 +#ifdef HAVE_NDO_BRIDGE_SETLINK_EXTACK
53 +                                 u16 flags, struct netlink_ext_ack *extack)
54 +#else
55                                   u16 flags)
56 +#endif
57 +
58  #else
59  static int igb_ndo_bridge_setlink(struct net_device *dev,
60                                   struct nlmsghdr *nlh)
61 diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h
62 index 068cfeb52..11b15f3a9 100644
63 --- a/kernel/linux/kni/ethtool/igb/kcompat.h
64 +++ b/kernel/linux/kni/ethtool/igb/kcompat.h
65 @@ -3942,6 +3942,7 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
66  
67  #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) )
68  #define dev_open(x) dev_open(x, NULL)
69 +#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
70  #endif /* >= 5.0.0 */
71  
72  #if defined(timer_setup) && defined(from_timer)
73 -- 
74 2.17.1
75