From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH] kni: fix build on Centos 7.4 when Ethtool enabled Date: Tue, 22 May 2018 11:25:55 +0100 Message-ID: <688b865e-b37d-042e-e3de-b4607975ea59@intel.com> References: <20180522001835.9843-1-dg@adax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org To: Dan Gora Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1112D2C72 for ; Tue, 22 May 2018 12:25:56 +0200 (CEST) In-Reply-To: <20180522001835.9843-1-dg@adax.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 5/22/2018 1:18 AM, Dan Gora wrote: > Fix compilation errors on Centos 7.4 when CONFIG_RTE_KNI_KMOD_ETHTOOL > is set to 'y'. > > Centos 7.4 needs HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL: > > igb_main.c: In function ‘igb_ndo_bridge_getlink’: > igb_main.c:2289:2: error: too few arguments to function > ‘ndo_dflt_bridge_getlink’ > return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags); > ^ > > Centos 7.4 needs HAVE_VF_VLAN_PROTO and needs to redefine > ndo_set_vf_vlan to .extended.ndo_set_vf_vlan: > > igb_main.c:2318:2: error: unknown field ‘ndo_set_vf_vlan’ specified > in initializer > .ndo_set_vf_vlan = igb_ndo_set_vf_vlan, > ^ > > Signed-off-by: Dan Gora <...> > @@ -3920,6 +3921,11 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) > #if ((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)) || \ > (SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12, 3, 0))) > #define HAVE_VF_VLAN_PROTO > +#elif ( RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,4) ) > +/* In RHEL/Centos 7.4, the "new" version of ndo_set_vf_vlan > + * is in the net_device_ops_extended struct */ > +#define HAVE_VF_VLAN_PROTO > +#define ndo_set_vf_vlan extended.ndo_set_vf_vlan This works but it is not really an "else" condition logically, what do you think about something like: #if ((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)) || \ (SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12, 3, 0)) || \ ( RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,4) )) #define HAVE_VF_VLAN_PROTO #if ( RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,4) ) /* In RHEL/Centos 7.4, the "new" version of ndo_set_vf_vlan * is in the net_device_ops_extended struct */ #define ndo_set_vf_vlan extended.ndo_set_vf_vlan #endif /* RHEL >= 7.4 */ #endif /* >= 4.9.0, >= SLES12SP3 */ > #endif /* >= 4.9.0, >= SLES12SP3 */ > > #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) >