From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 4BA5D68F2 for ; Mon, 30 May 2016 13:22:42 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 30 May 2016 04:22:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,389,1459839600"; d="scan'208";a="817664791" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 30 May 2016 04:22:39 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u4UBMbAM013370; Mon, 30 May 2016 12:22:37 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id u4UBMadW022762; Mon, 30 May 2016 12:22:36 +0100 Received: (from fyigit@localhost) by sivswdev02.ir.intel.com with id u4UBMak1022758; Mon, 30 May 2016 12:22:36 +0100 From: Ferruh Yigit To: dev@dpdk.org Cc: Helin Zhang , Ferruh Yigit Date: Mon, 30 May 2016 12:22:32 +0100 Message-Id: <1464607354-22728-1-git-send-email-ferruh.yigit@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH 1/3] kni: fix compile error for Linux 4.7 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2016 11:22:42 -0000 Fix compile error becuase of Linux API change, 'trans_start' field removed from 'struct net_device'. Linux: 9b36627acecd ("net: remove dev->trans_start") Signed-off-by: Ferruh Yigit --- lib/librte_eal/linuxapp/kni/compat.h | 4 ++++ lib/librte_eal/linuxapp/kni/kni_net.c | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/kni/compat.h b/lib/librte_eal/linuxapp/kni/compat.h index cf100b6..0e939e4 100644 --- a/lib/librte_eal/linuxapp/kni/compat.h +++ b/lib/librte_eal/linuxapp/kni/compat.h @@ -27,3 +27,7 @@ #if ( LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) ) #define HAVE_KIOCB_MSG_PARAM #endif /* < 4.1.0 */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0) +#define HAVE_TRANS_START_HELPER +#endif diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c index 4095382..076372c 100644 --- a/lib/librte_eal/linuxapp/kni/kni_net.c +++ b/lib/librte_eal/linuxapp/kni/kni_net.c @@ -38,6 +38,8 @@ #include #include + +#include "compat.h" #include "kni_dev.h" #define WD_TIMEOUT 5 /*jiffies */ @@ -426,7 +428,12 @@ kni_net_tx(struct sk_buff *skb, struct net_device *dev) struct rte_kni_mbuf *pkt_kva = NULL; struct rte_kni_mbuf *pkt_va = NULL; - dev->trans_start = jiffies; /* save the timestamp */ + /* save the timestamp */ +#ifdef HAVE_TRANS_START_HELPER + netif_trans_update(dev); +#else + dev->trans_start = jiffies; +#endif /* Check if the length of skb is less than mbuf size */ if (skb->len > kni->mbuf_size) -- 2.5.5