From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id EA894C9EA for ; Sat, 27 Jun 2015 00:14:50 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 26 Jun 2015 15:14:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,687,1427785200"; d="scan'208";a="595535266" Received: from mbernalm-mobl3.amr.corp.intel.com (HELO mbernalm-mobl3.zpn.intel.com) ([10.219.18.109]) by orsmga003.jf.intel.com with ESMTP; 26 Jun 2015 15:14:49 -0700 From: Miguel Bernal Marin To: dev@dpdk.org Date: Fri, 26 Jun 2015 17:14:36 -0500 Message-Id: <1435356878-10304-3-git-send-email-miguel.bernal.marin@linux.intel.com> X-Mailer: git-send-email 2.4.4 In-Reply-To: <1435356878-10304-1-git-send-email-miguel.bernal.marin@linux.intel.com> References: <1435259380-26251-1-git-send-email-miguel.bernal.marin@linux.intel.com> <1435356878-10304-1-git-send-email-miguel.bernal.marin@linux.intel.com> Subject: [dpdk-dev] [PATCH v2 2/4] kni: fix header_ops to build with 4.1 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: Fri, 26 Jun 2015 22:14:51 -0000 rebuild member was removed from headers_ops in kernel release 4.1. Therefore kni module compilation breaks. This patch add the properly checks to fix it. Fixes: d476059e77d1 ("net: Kill dev_rebuild_header") Signed-off-by: Miguel Bernal Marin --- lib/librte_eal/linuxapp/kni/kni_net.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c index e34a0fd..ab5add4 100644 --- a/lib/librte_eal/linuxapp/kni/kni_net.c +++ b/lib/librte_eal/linuxapp/kni/kni_net.c @@ -605,6 +605,7 @@ kni_net_header(struct sk_buff *skb, struct net_device *dev, /* * Re-fill the eth header */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)) static int kni_net_rebuild_header(struct sk_buff *skb) { @@ -616,6 +617,7 @@ kni_net_rebuild_header(struct sk_buff *skb) return 0; } +#endif /* < 4.1.0 */ /** * kni_net_set_mac - Change the Ethernet Address of the KNI NIC @@ -646,7 +648,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, +#endif /* < 4.1.0 */ .cache = NULL, /* disable caching */ }; -- 2.4.4