From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 691D4106B for ; Sun, 22 Mar 2015 19:03:27 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 22 Mar 2015 11:03:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,447,1422950400"; d="scan'208";a="696002789" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by fmsmga002.fm.intel.com with ESMTP; 22 Mar 2015 11:03:24 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.49]) by irsmsx105.ger.corp.intel.com ([163.33.3.28]) with mapi id 14.03.0224.002; Sun, 22 Mar 2015 18:03:23 +0000 From: "De Lara Guarch, Pablo" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH] kni: fix compilation issue on kernel 3.19 Thread-Index: AQHQXOnp1xWy1UAcS0OpVJBMXIIn5p0l7kmAgALsprA= Date: Sun, 22 Mar 2015 18:03:23 +0000 Message-ID: References: <1426181069-31469-1-git-send-email-pablo.de.lara.guarch@intel.com> <1426891155.RSIx7FYEKj@xps13> In-Reply-To: <1426891155.RSIx7FYEKj@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] kni: fix compilation issue on kernel 3.19 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: Sun, 22 Mar 2015 18:03:28 -0000 Hi Thomas, > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Friday, March 20, 2015 9:23 PM > To: De Lara Guarch, Pablo > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] kni: fix compilation issue on kernel 3.19 >=20 > Hi Pablo, >=20 > 2015-03-12 17:24, Pablo de Lara: > > Due to API changes in functions ndo_dflt_bridge_getlink > > and igb_ndo_fdb_add in kernel 3.19, DPDK would not build. >=20 > Please provide the Linux commit id for this change. >=20 > > This patch solves the problem, by checking the kernel version > > and adding the necessary new parameters > > > > Signed-off-by: Pablo de Lara > > --- > > lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 7 +++++++ > > lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 3 +++ > > 2 files changed, 10 insertions(+), 0 deletions(-) > > > > diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c > b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c > > index a802a02..24b147d 100644 > > --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c > > +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c > > @@ -2103,6 +2103,9 @@ static int igb_set_features(struct net_device > *netdev, > > static int igb_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], > > struct net_device *dev, > > const unsigned char *addr, > > +#ifdef HAVE_NDO_FDB_ADD_VID > > + u16 vid, > > +#endif > > u16 flags) > > #else >=20 > You should explain in commit message why the change is not needed in > #else > (!USE_CONST_DEV_UC_CHAR for version < 3.7). >=20 > > static int igb_ndo_fdb_add(struct ndmsg *ndm, > > @@ -2259,7 +2262,11 @@ static int igb_ndo_bridge_getlink(struct sk_buff > *skb, u32 pid, u32 seq, > > else > > mode =3D BRIDGE_MODE_VEPA; > > > > +#ifdef HAVE_NDO_FDB_ADD_VID > > + return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0); > > +#else > > return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode); > > +#endif /* HAVE_NDO_FDB_ADD_VID */ > > } > > #endif /* HAVE_BRIDGE_ATTRIBS */ > > #endif /* NTF_SELF */ > > diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h > b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h > > index 1213cc6..5c799e9 100644 > > --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h > > +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h > > @@ -3881,4 +3881,7 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, > __always_unused int type) > > #define HAVE_VF_MIN_MAX_TXRATE 1 > > #endif /* >=3D 3.16.0 */ > > > > +#if ( LINUX_VERSION_CODE >=3D KERNEL_VERSION(3,19,0) ) > > +#define HAVE_NDO_FDB_ADD_VID > > +#endif /* >=3D 3.19.0 */ > > #endif /* _KCOMPAT_H_ */ >=20 > A blank line is missing here. > Are you sure there is no macro defined in the Linux changes which could b= e > checked instead of version number? I dislike version checks because of > backport problems. I am not aware of such macro in the kernel, unfortunately. I just sent a v2. Thanks, Pablo