From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53])
 by dpdk.org (Postfix) with ESMTP id 46DFA5A35
 for <dev@dpdk.org>; Fri, 20 Mar 2015 22:23:49 +0100 (CET)
Received: by wgdm6 with SMTP id m6so99454263wgd.2
 for <dev@dpdk.org>; Fri, 20 Mar 2015 14:23:49 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:organization
 :user-agent:in-reply-to:references:mime-version
 :content-transfer-encoding:content-type;
 bh=EIWXapRt31T7zCIC9sDycsOuk/ofCQNSSStWku2mhjo=;
 b=idVj4mZXR9+hKwwheTQFs9w0tbilM1Tzzy1fj4uZ03tJi2SRXyBF9/SD4f0q7KDduU
 dzD/EiC38xjYm+i5XgYfz9vif25oKZqtZnISmfecb6bEWTVM7qIiEF3txCHzKPSbeNo/
 1gi21MTreoxo8vk9Kz9A27oU6Oovibr91OYKYQNMbcT+fYSCKLUo6esVyJKVUBMuNVJU
 cPlsr1eXKVai7W9O2RYRcU3FS60omngKH+ZRbuQde4KMx7L/fC/6ah2PsvRUUwmxoHsh
 gitNM7HqV3yrIUgeMpUYEGp7M7bf9LE1X7Lt9wYxCOJKvRNkHCGAxkumznTWj5G4Kjgj
 649Q==
X-Gm-Message-State: ALoCoQldRULUxrb+xLZmozeTVXv9vxrc7CdS2mO8sl+vaeCjgpRH+7tCCI5QBBsWFa+fZoqv4u6h
X-Received: by 10.180.38.15 with SMTP id c15mr27956093wik.74.1426886628951;
 Fri, 20 Mar 2015 14:23:48 -0700 (PDT)
Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136])
 by mx.google.com with ESMTPSA id nd15sm582453wic.8.2015.03.20.14.23.47
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 20 Mar 2015 14:23:48 -0700 (PDT)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Fri, 20 Mar 2015 22:23:07 +0100
Message-ID: <1426891155.RSIx7FYEKj@xps13>
Organization: 6WIND
User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; )
In-Reply-To: <1426181069-31469-1-git-send-email-pablo.de.lara.guarch@intel.com>
References: <1426181069-31469-1-git-send-email-pablo.de.lara.guarch@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 20 Mar 2015 21:23:49 -0000

Hi Pablo,

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.

Please provide the Linux commit id for this change.

> This patch solves the problem, by checking the kernel version
> and adding the necessary new parameters
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
>  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

You should explain in commit message why the change is not needed in #else
(!USE_CONST_DEV_UC_CHAR for version < 3.7).

>  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 = 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 /* >= 3.16.0 */
>  
> +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) )
> +#define HAVE_NDO_FDB_ADD_VID
> +#endif /* >= 3.19.0 */
>  #endif /* _KCOMPAT_H_ */

A blank line is missing here.
Are you sure there is no macro defined in the Linux changes which could be
checked instead of version number? I dislike version checks because of
backport problems.