Skip to contentSkip to conversation

kni: fix build with Linux kernel 4.1 or later

PATCH In review Stephen Hemminger 3 participants 5 messages Jul 9, 2015 – Jul 10, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kni: fix build with Linux kernel 4.1 or later

From: Stephen Hemminger <[email protected]>

The internal API for some functions used by KNI changes in current kernel. KNI really needs to be submitted upstream (by Intel) to keep it maintainable.

---
 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 12 +++++++++++-
 lib/librte_eal/linuxapp/kni/kni_net.c              |  6 ++++--
 2 files changed, 15 insertions(+), 3 deletions(-)
lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +11 -1
index fa24d16..62fb53b 100644
@@ -2250,10 +2250,16 @@ static int igb_ndo_bridge_setlink(struct net_device *dev,
 }
 
 #ifdef HAVE_BRIDGE_FILTER
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev, u32 filter_mask)
 #else
 static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
+				  struct net_device *dev,
+				  u32 filter_mask, int nlflags)
+#endif
+#else
+static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				  struct net_device *dev)
 #endif
 {
@@ -2269,7 +2275,11 @@ static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 		mode = BRIDGE_MODE_VEPA;
 
 #ifdef HAVE_NDO_FDB_ADD_VID
-	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
+	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, nl_flags);
+#else
+	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, 0);
+#endif
 #else
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode);
 #endif /* HAVE_NDO_FDB_ADD_VID */
lib/librte_eal/linuxapp/kni/kni_net.c +4 -2
index e34a0fd..e29caeb 100644
@@ -601,7 +601,7 @@ kni_net_header(struct sk_buff *skb, struct net_device *dev,
 	return dev->hard_header_len;
 }
 
-
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
 /*
  * Re-fill the eth header
  */
@@ -616,6 +616,7 @@ kni_net_rebuild_header(struct sk_buff *skb)
 
 	return 0;
 }
+#endif
 
 /**
  * kni_net_set_mac - Change the Ethernet Address of the KNI NIC
@@ -646,8 +647,9 @@ static int kni_net_change_carrier(struct net_device *dev, bool new_carrier)
 
 static const struct header_ops kni_net_header_ops = {
 	.create  = kni_net_header,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
 	.rebuild = kni_net_rebuild_header,
-	.cache   = NULL,  /* disable caching */
+#endif
 };
 
 static const struct net_device_ops kni_net_netdev_ops = {
Signature · 1 line
2.1.4
#1 lore raw

2015-07-09 10:43, Stephen Hemminger:

Quoted 7 lines

From: Stephen Hemminger <[email protected]>

The internal API for some functions used by KNI changes in current kernel. KNI really needs to be submitted upstream (by Intel) to keep it maintainable.

There was already a similar patchset from Miguel Bernal Marin waiting for review:
http://dpdk.org/dev/patchwork/patch/5862
http://dpdk.org/dev/patchwork/patch/5863
http://dpdk.org/dev/patchwork/patch/5864

#2 lore raw

Hi Thomas,

Quoted 14 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Thomas Monjalon
Sent: Friday, July 10, 2015 1:54 AM
To: Stephen Hemminger
Cc: [email protected]; Stephen Hemminger
Subject: Re: [dpdk-dev] [PATCH] kni: fix build with Linux kernel 4.1 or later

2015-07-09 10:43, Stephen Hemminger:

Quoted 6 lines

From: Stephen Hemminger <[email protected]>

The internal API for some functions used by KNI changes in current kernel. KNI really needs to be submitted upstream (by Intel) to keep it maintainable.

Quoted 7 lines
Quoted 1 line

There was already a similar patchset from Miguel Bernal Marin waiting for review:
http://dpdk.org/dev/patchwork/patch/5862
http://dpdk.org/dev/patchwork/patch/5863
http://dpdk.org/dev/patchwork/patch/5864

I acked this patch series. Are you waiting for another reviewer?

Thanks,
Pablo

#3 lore raw

2015-07-10 07:16, De Lara Guarch, Pablo:

Quoted 10 lines

From: dev [mailto:[email protected]] On Behalf Of Thomas Monjalon

Quoted 9 lines

2015-07-09 10:43, Stephen Hemminger:

Quoted 7 lines

From: Stephen Hemminger <[email protected]>

The internal API for some functions used by KNI changes in current kernel. KNI really needs to be submitted upstream (by Intel) to keep it maintainable.

Quoted 7 lines
Quoted 5 lines

There was already a similar patchset from Miguel Bernal Marin waiting for review:
http://dpdk.org/dev/patchwork/patch/5862
http://dpdk.org/dev/patchwork/patch/5863
http://dpdk.org/dev/patchwork/patch/5864

I acked this patch series. Are you waiting for another reviewer?

Ah OK, missed it. Thanks

#4 lore raw
In reply to Thomas Monjalon
Quoted 7 lines · On Fri, 10 Jul 2015 02:53:51 +0200 Thomas Monjalon <[email protected]>…

2015-07-09 10:43, Stephen Hemminger:

Quoted 6 lines

From: Stephen Hemminger <[email protected]>

The internal API for some functions used by KNI changes in current kernel. KNI really needs to be submitted upstream (by Intel) to keep it maintainable.

Quoted 6 lines
Quoted 1 line

There was already a similar patchset from Miguel Bernal Marin waiting for review:
http://dpdk.org/dev/patchwork/patch/5862
http://dpdk.org/dev/patchwork/patch/5863
http://dpdk.org/dev/patchwork/patch/5864

Sure Intel patch is cleaner.
But KNI, is heading down an #ifdef rathole.