From 00c14643821c619375bf04264cf3afeb899b1e7a Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Mon, 12 Oct 2015 13:52:58 +0100 Subject: [PATCH] kni: fix igb build with kernel 4.2 Kernel 4.2 has introduced two new parameters in ndo_bridge_getlink, which breaks DPDK compilation. Linux: 7d4f8d87 ("switchdev: ad VLAN support for ports bridge-getlink") This patch adds the necessary checks to fix it. Signed-off-by: Pablo de Lara Acked-by: Ferruh Yigit --- lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 5 +++++ lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 5 +++++ 2 files changed, 10 insertions(+) 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 0494780f43..b330b200c5 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c @@ -2276,7 +2276,12 @@ static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, #ifdef HAVE_NDO_FDB_ADD_VID #ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS +#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL + return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, + nlflags, filter_mask, NULL); +#else return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags); +#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL */ #else return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0); #endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */ diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h index e4fad186b3..5f45b8b7e9 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h @@ -3901,4 +3901,9 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) /* ndo_bridge_getlink adds new nlflags parameter */ #define HAVE_NDO_BRIDGE_GETLINK_NLFLAGS #endif /* >= 4.1.0 */ + +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) ) +/* ndo_bridge_getlink adds new filter_mask and vlan_fill parameters */ +#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL +#endif /* >= 4.2.0 */ #endif /* _KCOMPAT_H_ */ -- 2.20.1