From patchwork Mon Mar 20 11:22:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 22003 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 1605D377A; Mon, 20 Mar 2017 12:22:35 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id EAD2D1075 for ; Mon, 20 Mar 2017 12:22:32 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP; 20 Mar 2017 04:22:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.36,194,1486454400"; d="scan'208"; a="1124823028" Received: from sivswdev02.ir.intel.com ([10.237.217.46]) by fmsmga001.fm.intel.com with ESMTP; 20 Mar 2017 04:22:30 -0700 From: Ferruh Yigit To: Jerin Jacob Cc: dev@dpdk.org, Ferruh Yigit Date: Mon, 20 Mar 2017 11:22:08 +0000 Message-Id: <20170320112208.7941-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.8.4 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] kni: fix build with kernel 4.11 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" compile error: .../build/build/lib/librte_eal/linuxapp/kni/kni_net.c:124:6: error: implicit declaration of function ‘signal_pending’ [-Werror=implicit-function-declaration] if (signal_pending(current) || ret_val <= 0) { ^~~~~~~~~~~~~~ Linux 4.11 moves signal function declarations to its own header file: Linux: 174cd4b1e5fb ("sched/headers: Prepare to move signal wakeup & sigpending methods from into ") User new header file "linux/sched/signal.h" to fix build error. Reported-by: Jerin Jacob Signed-off-by: Ferruh Yigit Tested-by: Jerin Jacob Tested-by:pagupta@redhat.com --- lib/librte_eal/linuxapp/kni/compat.h | 6 ++++++ lib/librte_eal/linuxapp/kni/kni_dev.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lib/librte_eal/linuxapp/kni/compat.h b/lib/librte_eal/linuxapp/kni/compat.h index 78da08e..d96275a 100644 --- a/lib/librte_eal/linuxapp/kni/compat.h +++ b/lib/librte_eal/linuxapp/kni/compat.h @@ -2,6 +2,8 @@ * Minimal wrappers to allow compiling kni on older kernels. */ +#include + #ifndef RHEL_RELEASE_VERSION #define RHEL_RELEASE_VERSION(a, b) (((a) << 8) + (b)) #endif @@ -67,3 +69,7 @@ (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34))) #undef NET_NAME_UNKNOWN #endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) +#define HAVE_SIGNAL_FUNCTIONS_OWN_HEADER +#endif diff --git a/lib/librte_eal/linuxapp/kni/kni_dev.h b/lib/librte_eal/linuxapp/kni/kni_dev.h index 002e5fa..72385ab 100644 --- a/lib/librte_eal/linuxapp/kni/kni_dev.h +++ b/lib/librte_eal/linuxapp/kni/kni_dev.h @@ -30,9 +30,15 @@ #endif #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include "compat.h" + #include #include +#ifdef HAVE_SIGNAL_FUNCTIONS_OWN_HEADER +#include +#else #include +#endif #include #include #include