1 Description: compile error:
2 CC [M] .../lib/librte_eal/linuxapp/kni/igb_main.o
3 .../lib/librte_eal/linuxapp/kni/igb_main.c:2317:21:
4 error: initialization from incompatible pointer type
5 [-Werror=incompatible-pointer-types]
6 .ndo_set_vf_vlan = igb_ndo_set_vf_vlan,
9 Linux kernel 4.9 updates API for ndo_set_vf_vlan:
10 Linux: 79aab093a0b5 ("net: Update API for VF vlan protocol 802.1ad support")
12 Use new API for Linux kernels >= 4.9
14 Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
15 Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
17 Origin: Upstream, http://dpdk.org/dev/patchwork/patch/16651/
18 Author: Luca Boccassi <luca.boccassi@gmail.com>
19 Last-Update: 2016-10-17
21 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 19 +++++++++++++++++++
22 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 4 ++++
23 2 files changed, 23 insertions(+)
25 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
26 +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
27 @@ -195,7 +195,11 @@ static void igb_process_mdd_event(struct
29 static int igb_ndo_set_vf_mac( struct net_device *netdev, int vf, u8 *mac);
30 static int igb_ndo_set_vf_vlan(struct net_device *netdev,
31 +#ifdef HAVE_VF_VLAN_PROTO
32 + int vf, u16 vlan, u8 qos, __be16 vlan_proto);
34 int vf, u16 vlan, u8 qos);
36 #ifdef HAVE_VF_SPOOFCHK_CONFIGURE
37 static int igb_ndo_set_vf_spoofchk(struct net_device *netdev, int vf,
39 @@ -6411,7 +6415,11 @@ static void igb_set_vmvir(struct igb_ada
42 static int igb_ndo_set_vf_vlan(struct net_device *netdev,
43 +#ifdef HAVE_VF_VLAN_PROTO
44 + int vf, u16 vlan, u8 qos, __be16 vlan_proto)
46 int vf, u16 vlan, u8 qos)
50 struct igb_adapter *adapter = netdev_priv(netdev);
51 @@ -6419,6 +6427,12 @@ static int igb_ndo_set_vf_vlan(struct ne
52 /* VLAN IDs accepted range 0-4094 */
53 if ((vf >= adapter->vfs_allocated_count) || (vlan > VLAN_VID_MASK-1) || (qos > 7))
56 +#ifdef HAVE_VF_VLAN_PROTO
57 + if (vlan_proto != htons(ETH_P_8021Q))
58 + return -EPROTONOSUPPORT;
62 err = igb_vlvf_set(adapter, vlan, !!vlan, vf);
64 @@ -6579,7 +6593,12 @@ static inline void igb_vf_reset(struct i
65 if (adapter->vf_data[vf].pf_vlan)
66 igb_ndo_set_vf_vlan(adapter->netdev, vf,
67 adapter->vf_data[vf].pf_vlan,
68 +#ifdef HAVE_VF_VLAN_PROTO
69 + adapter->vf_data[vf].pf_qos,
70 + htons(ETH_P_8021Q));
72 adapter->vf_data[vf].pf_qos);
75 igb_clear_vf_vfta(adapter, vf);
77 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
78 +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
79 @@ -3906,6 +3906,10 @@ skb_set_hash(struct sk_buff *skb, __u32
80 #endif /* !RHEL 7.2 */
83 +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) )
84 +#define HAVE_VF_VLAN_PROTO
85 +#endif /* >= 4.9.0 */
87 #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) )
88 /* ndo_bridge_getlink adds new nlflags parameter */
89 #define HAVE_NDO_BRIDGE_GETLINK_NLFLAGS