[dpdk-dev] kni: fix igb build with kernel 4.2
Commit Message
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 <pablo.de.lara.guarch@intel.com>
---
lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 13 +++++++++----
lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 7 ++++++-
2 files changed, 15 insertions(+), 5 deletions(-)
Comments
> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Monday, October 12, 2015 1:50 PM
> To: De Lara Guarch, Pablo; dev@dpdk.org
> Subject: [dpdk-dev] kni: fix igb build with kernel 4.2
>
> From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
>
> 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 <pablo.de.lara.guarch@intel.com>
NACK this and previous patch. I was trying to send a v2 of this.
Sorry for the spam!
Kernel 4.2 has introduced two new parameters in
function ndo_bridge_netlink and therefore,
DPDK does not build with it.
This patchset adds the necessary checks and
rename a previous defined macro, in order
to have a more meaningful name.
Changes in v2:
- Split patch in two patches
Pablo de Lara (2):
kni: rename HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK macro
kni: fix igb build with kernel 4.2
lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 13 +++++++++----
lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 7 ++++++-
2 files changed, 15 insertions(+), 5 deletions(-)
2015-10-12 14:25, Ferruh Yigit:
> On Mon, Oct 12, 2015 at 01:52:56PM +0100, Pablo de Lara wrote:
> > Kernel 4.2 has introduced two new parameters in
> > function ndo_bridge_netlink and therefore,
> > DPDK does not build with it.
> >
> > This patchset adds the necessary checks and
> > rename a previous defined macro, in order
> > to have a more meaningful name.
> >
> > Changes in v2:
> > - Split patch in two patches
> >
> > Pablo de Lara (2):
> > kni: rename HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK macro
> > kni: fix igb build with kernel 4.2
>
> Series Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied, thanks
@@ -2250,14 +2250,14 @@ static int igb_ndo_bridge_setlink(struct net_device *dev,
}
#ifdef HAVE_BRIDGE_FILTER
-#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
struct net_device *dev, u32 filter_mask,
int nlflags)
#else
static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
struct net_device *dev, u32 filter_mask)
-#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK */
+#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */
#else
static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
struct net_device *dev)
@@ -2275,11 +2275,16 @@ static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
mode = BRIDGE_MODE_VEPA;
#ifdef HAVE_NDO_FDB_ADD_VID
-#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#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_FILTER_MASK */
+#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */
#else
return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode);
#endif /* HAVE_NDO_FDB_ADD_VID */
@@ -3899,6 +3899,11 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) )
/* ndo_bridge_getlink adds new nlflags parameter */
-#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK
+#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_ */