From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f41.google.com (mail-pg0-f41.google.com [74.125.83.41]) by dpdk.org (Postfix) with ESMTP id 50CB62BD8 for ; Tue, 29 Aug 2017 17:12:55 +0200 (CEST) Received: by mail-pg0-f41.google.com with SMTP id r133so11621480pgr.3 for ; Tue, 29 Aug 2017 08:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5+UXp6x/3nS1O1F9yXdXFFbmMZnlSm/FkoB+ELwi7C0=; b=uIfAGUePmLq3zX9Bndg/eDRWcUYe1MXesgUtiNVZgTMtGUZXJKBoTiHqpDdFJrZl65 GPl8Q30ZobwZ6HOWNkNJf4/zyCe8aXfN06vHw+OBKstNKt7DgsDv0qBMiOdcC+fLKXUY T/NgZM0XpTjpyElKYSQyiRSGV5F3v3nZmMIH8m9u08imRgknw4aH/T+oWBX8RsvsR0ef 8QqF4P456hj/gIrLyTM4MjFnsr+G/OOYpRpF3yHj1gXPX8VLPr7ZpFq+nPklTz2bjb3w 9dZQz7JR+qqrKPgrQ6bXBwCKV0hL+o/yIDf8bYpfbLnhKjSi0kMXUikUZLISGmfVK9PY w0kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5+UXp6x/3nS1O1F9yXdXFFbmMZnlSm/FkoB+ELwi7C0=; b=hIQoXKng88gaVvYJ+i/Vch33JfsAyJrYhu0WA4H5Eno/92thAC4JmbIqgUmM17Fmmp 3m0M+GuEY57mEwiz6tgIWdq6opYe+VMUONqhO9/11/EO8dCLPbznhacCXnO9ZEskfFQm eHonaNCvpZFJ6mhIbUGE0paWoZPBMKAly/3yh3dKtWDHii6MccTQAwz13sIZ6HeRHlCM pHr0nPykRpfeVKtWbBCQvfwU2D3MIUU0TkDA0okv+8c/Jg1rcapzwEDoL7XVzBpjt5I2 ASYIA8N0ZLyYdwRqecEniMUoAfMngC06XYnfxSauiH+D2uVoHJXvGsWgwV4LWf1SYfzh a4zQ== X-Gm-Message-State: AHYfb5grGMTMpeXhhJboEd9+qPBrUe4iei7/9liOWrFxZ3hZ44mJ57r/ BW9OD1gXJ0p1SICA X-Received: by 10.84.217.11 with SMTP id o11mr828535pli.245.1504019574426; Tue, 29 Aug 2017 08:12:54 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id b8sm5605562pfe.8.2017.08.29.08.12.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2017 08:12:54 -0700 (PDT) Date: Tue, 29 Aug 2017 08:12:52 -0700 From: Stephen Hemminger To: Nirmoy Das Cc: ferruh.yigit@intel.com, dev@dpdk.org Message-ID: <20170829081252.562f9313@xeon-e3> In-Reply-To: <20170829150613.10597-1-ndas@suse.de> References: <20170829150613.10597-1-ndas@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, 29 Aug 2017 15:12:55 -0000 On Tue, 29 Aug 2017 17:06:13 +0200 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_st= art=E2=80=99 > dev->trans_start =3D jiffies; >=20 > Signed-off-by: Nirmoy Das > --- > lib/librte_eal/linuxapp/kni/compat.h | 32 ++++++++++++++++++++++++++++++= +- > 1 file changed, 31 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_eal/linuxapp/kni/compat.h b/lib/librte_eal/linuxa= pp/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) > +#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))) > +/* 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 > +#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) && \ > + SLE_VERSION_CODE =3D=3D SLE_VERSION(12, 3, 0)) > #define HAVE_TRANS_START_HELPER > #endif > =20 Sigh. KNI needs to get upstream, or we need to leave RHEL and SLES version magic to the distros to manage as their own patches. This kind of spaghetti of ifdef's is unmanageable, untestable, and=20 just plain ugly.