[dpdk-dev] kni: fix compilation error when debug enabled

Message ID 1473941204-14587-1-git-send-email-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Commit Message

Ferruh Yigit Sept. 15, 2016, 12:06 p.m. UTC
  Fix build error with Linux kernel >= v4.7

Fix compile error because of Linux API change, 'trans_start' field
removed from 'struct net_device'.

Linux: 9b36627acecd ("net: remove dev->trans_start")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_eal/linuxapp/kni/kni_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Sept. 21, 2016, 4:06 p.m. UTC | #1
2016-09-15 13:06, Ferruh Yigit:
> Fix build error with Linux kernel >= v4.7
> 
> Fix compile error because of Linux API change, 'trans_start' field
> removed from 'struct net_device'.
> 
> Linux: 9b36627acecd ("net: remove dev->trans_start")
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c
index fc82193..371bbfa 100644
--- a/lib/librte_eal/linuxapp/kni/kni_net.c
+++ b/lib/librte_eal/linuxapp/kni/kni_net.c
@@ -508,7 +508,7 @@  kni_net_tx_timeout (struct net_device *dev)
 	struct kni_dev *kni = netdev_priv(dev);
 
 	KNI_DBG("Transmit timeout at %ld, latency %ld\n", jiffies,
-			jiffies - dev->trans_start);
+			jiffies - dev_trans_start(dev));
 
 	kni->stats.tx_errors++;
 	netif_wake_queue(dev);