From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by dpdk.org (Postfix) with ESMTP id A9DF72C2F for ; Tue, 5 Sep 2017 11:55:58 +0200 (CEST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A9FE6ABDE; Tue, 5 Sep 2017 09:55:57 +0000 (UTC) To: Ferruh Yigit Cc: dev@dpdk.org References: <20170829150613.10597-1-ndas@suse.de> <08b26c8d-a239-87b9-cb96-20730f0fb206@intel.com> From: Nirmoy Das Message-ID: <6ed1338c-e9b3-6765-b31b-7f1156f31dbd@suse.de> Date: Tue, 5 Sep 2017 11:55:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <08b26c8d-a239-87b9-cb96-20730f0fb206@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH v2] kni: fix build on SLE12 SP3 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: , X-List-Received-Date: Tue, 05 Sep 2017 09:55:58 -0000 On 09/04/2017 11:46 AM, Ferruh Yigit wrote: > On 8/29/2017 4:06 PM, Nirmoy Das wrote: >> compilation error: >> build/lib/librte_eal/linuxapp/kni/kni_net.c:215:5: error: >> =E2=80=98struct net_device=E2=80=99 has no member named =E2=80=98trans= _start=E2=80=99 >> dev->trans_start =3D jiffies; >> >> Signed-off-by: Nirmoy Das >> --- >> lib/librte_eal/linuxapp/kni/compat.h | 32 +++++++++++++++++++++++++++= ++++- >> 1 file changed, 31 insertions(+), 1 deletion(-) >> >> diff --git a/lib/librte_eal/linuxapp/kni/compat.h b/lib/librte_eal/lin= uxapp/kni/compat.h >> index 6a1587b4e..19f8e96ce 100644 >> --- a/lib/librte_eal/linuxapp/kni/compat.h >> +++ b/lib/librte_eal/linuxapp/kni/compat.h >> @@ -8,6 +8,34 @@ >> #define RHEL_RELEASE_VERSION(a, b) (((a) << 8) + (b)) >> #endif >> =20 >> +/* SuSE version macro is the same as Linux kernel version */ >> +#ifndef SLE_VERSION >> +#define SLE_VERSION(a, b, c) KERNEL_VERSION(a, b, c) >> +#endif >> +#ifdef CONFIG_SUSE_KERNEL >> +#if (LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 4, 57)) >> +/* SLES12SP3 is at least 4.4.57+ based */ >> +#define SLE_VERSION_CODE SLE_VERSION(12, 3, 0) > Just to double check, is there a macro set in SUSE that we can use here= , > instead of defining here ourselves, like RHEL_RELEASE_CODE? Unfortunately SUSE doesn't have such logic/macro. > >> +#elif (LINUX_VERSION_CODE >=3D KERNEL_VERSION(3, 12, 28)) >> +/* SLES12 is at least 3.12.28+ based */ >> +#define SLE_VERSION_CODE SLE_VERSION(12, 0, 0) >> +#elif ((LINUX_VERSION_CODE >=3D KERNEL_VERSION(3, 0, 61)) && \ >> + (LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0))) > This line gives following checkpatch warning: > WARNING:LEADING_SPACE: please, no spaces at the start of a line > >> +/* SLES11 SP3 is at least 3.0.61+ based */ >> +#define SLE_VERSION_CODE SLE_VERSION(11, 3, 0) >> +#elif (LINUX_VERSION_CODE =3D=3D KERNEL_VERSION(2, 6, 32)) >> +/* SLES11 SP1 is 2.6.32 based */ >> +#define SLE_VERSION_CODE SLE_VERSION(11, 1, 0) >> +#elif (LINUX_VERSION_CODE =3D=3D KERNEL_VERSION(2, 6, 27)) >> +/* SLES11 GA is 2.6.27 based */ >> +#define SLE_VERSION_CODE SLE_VERSION(11, 0, 0) >> +#endif /* LINUX_VERSION_CODE =3D=3D KERNEL_VERSION(x,y,z) */ >> +#endif /* CONFIG_SUSE_KERNEL */ >> +#ifndef SLE_VERSION_CODE >> +#define SLE_VERSION_CODE 0 > [1] see below. > >> +#endif /* SLE_VERSION_CODE */ >> + >> + >> #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) && \ >> (!(defined(RHEL_RELEASE_CODE) && \ >> RHEL_RELEASE_CODE >=3D RHEL_RELEASE_VERSION(6, 4))) >> @@ -55,7 +83,9 @@ >> =20 >> #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 7, 0) || \ >> (defined(RHEL_RELEASE_CODE) && \ >> - RHEL_RELEASE_CODE >=3D RHEL_RELEASE_VERSION(7, 4)) >> + RHEL_RELEASE_CODE >=3D RHEL_RELEASE_VERSION(7, 4)) || \ >> + (defined(SLE_VERSION_CODE) && \ > defined check is not required, since SLE_VERSION_CODE always defined [1= ]. > > It can be either: > a) (SLE_VERSION_CODE && SLE_VERSION_CODE =3D=3D SLE_VERSION(12, 3, 0)) > or directly check: > b) (SLE_VERSION_CODE =3D=3D SLE_VERSION(12, 3, 0)) Thanks for your comments I will modify the patch. > >> + SLE_VERSION_CODE =3D=3D SLE_VERSION(12, 3, 0)) >> #define HAVE_TRANS_START_HELPER >> #endif >> =20 >> Regards, Nirmoy