New upstream version 18.11.2
[deb_dpdk.git] / debian / patches / lp-1827102-kni-fix-build-with-Linux-5.1.patch
1 From db9178c24c1643b5ef58f2a9ff87c3eef8e0e1e4 Mon Sep 17 00:00:00 2001
2 From: Ferruh Yigit <ferruh.yigit@intel.com>
3 Date: Mon, 8 Apr 2019 15:22:26 +0100
4 Subject: [PATCH] kni: fix build with Linux 5.1
5
6 Build error seen with Linux kernel 5.1 and
7 when CONFIG_RTE_KNI_KMOD_ETHTOOL is enabled.
8
9 Build error:
10 kernel/linux/kni/igb_main.c:2352:18:
11   error: initialization of ... from incompatible pointer type ...
12   [-Werror=incompatible-pointer-types]
13     .ndo_fdb_add  = igb_ndo_fdb_add,
14                       ^~~~~~~~~~~~~~~
15
16 ndo_fdb_add() is changed in Linux kernel version 5.1 and now requires
17 a new parameter, 'struct netlink_ext_ack *extack':
18 Linux Commit 87b0984ebfab ("net: Add extack argument to ndo_fdb_add()")
19
20 ndo_fdb_add() parameter updated with compile time Linux kernel version
21 check.
22
23 Cc: stable@dpdk.org
24
25 Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
26 Tested-by: Bruce Richardson <bruce.richardson@intel.com>
27 Reviewed-by: Rami Rosen <ramirose@gmail.com>
28
29 Origin: upstream, https://git.dpdk.org/dpdk/commit/?id=db9178c24c1643b5ef58f2a9ff87c3eef8e0e1e4
30 Bug-Ubuntu: https://bugs.launchpad.net/bugs/1827102
31 Last-Update: 2019-05-03
32
33 ---
34  kernel/linux/kni/ethtool/igb/igb_main.c | 6 ++++++
35  kernel/linux/kni/ethtool/igb/kcompat.h  | 4 ++++
36  2 files changed, 10 insertions(+)
37
38 diff --git a/kernel/linux/kni/ethtool/igb/igb_main.c b/kernel/linux/kni/ethtool/igb/igb_main.c
39 index 0b4faeae5..cda2b063d 100644
40 --- a/kernel/linux/kni/ethtool/igb/igb_main.c
41 +++ b/kernel/linux/kni/ethtool/igb/igb_main.c
42 @@ -2112,7 +2112,13 @@ static int igb_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
43  #ifdef HAVE_NDO_FDB_ADD_VID
44                            u16 vid,
45  #endif
46 +#ifdef HAVE_NDO_FDB_ADD_EXTACK
47 +                          u16 flags,
48 +                          struct netlink_ext_ack *extack)
49 +#else
50                            u16 flags)
51 +#endif
52 +
53  #else
54  static int igb_ndo_fdb_add(struct ndmsg *ndm,
55                            struct net_device *dev,
56 diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h
57 index 11b15f3a9..649a69c81 100644
58 --- a/kernel/linux/kni/ethtool/igb/kcompat.h
59 +++ b/kernel/linux/kni/ethtool/igb/kcompat.h
60 @@ -3945,6 +3945,10 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
61  #define HAVE_NDO_BRIDGE_SETLINK_EXTACK
62  #endif /* >= 5.0.0 */
63  
64 +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0) )
65 +#define HAVE_NDO_FDB_ADD_EXTACK
66 +#endif /* >= 5.1.0 */
67 +
68  #if defined(timer_setup) && defined(from_timer)
69  #define HAVE_TIMER_SETUP
70  #endif
71 -- 
72 2.21.0
73