From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by dpdk.org (Postfix) with ESMTP id B5A3C5A3E for ; Thu, 9 Jul 2015 19:43:19 +0200 (CEST) Received: by pactm7 with SMTP id tm7so153995862pac.2 for ; Thu, 09 Jul 2015 10:43:19 -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; bh=5RIACsqEow5zq6Ol2fR8LC5ffjBTAPsg75sOdzvpzNc=; b=Hd+8LXLjf9HutrYbDYZES8ogTgHUioTdJjyTeCTqonhLSSdv+5Wektp5ueaUTmzXec rYYUS02HQKKE+WxilffwaAa8244F3DJ/T/pVQ9IaRZ59At9QOI1GVtxEBw7jnRJw/P4Y YuLuezqXZygsvmb++0Lw//jw8OvggLmY/PHZ41E9Gx7RE23stkeC3xr/D7SZUTiR7509 ftfhRJdAvSn4vCBwbhF/+VgBwLM+gR26ZNyslY5GzziyhAOkFxf+m+j1lL8IJdYPz/jd 4Fz9xienhFLDoLwMl3tiz2BzGhbxn1CZ0MlSCeEh0dQF0NPlqqdJ+jxGkbSBYCq0gDow dF6Q== X-Gm-Message-State: ALoCoQm6d9ALCavRJkWT2hFCmXIQld6WZYpN0ywT8EtB36YVzP3m3t71WREN/keyLdnQw4P752l0 X-Received: by 10.70.45.168 with SMTP id o8mr33406797pdm.152.1436463798979; Thu, 09 Jul 2015 10:43:18 -0700 (PDT) Received: from urahara.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id sn7sm6667910pac.5.2015.07.09.10.43.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jul 2015 10:43:18 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Date: Thu, 9 Jul 2015 10:43:26 -0700 Message-Id: <1436463806-2729-1-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 Cc: Stephen Hemminger Subject: [dpdk-dev] [PATCH] kni: fix build with Linux kernel 4.1 or later 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: Thu, 09 Jul 2015 17:43:20 -0000 From: Stephen Hemminger The internal API for some functions used by KNI changes in current kernel. KNI really needs to be submitted upstream (by Intel) to keep it maintainable. Signed-off-by: Stephen Hemminger --- lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 12 +++++++++++- lib/librte_eal/linuxapp/kni/kni_net.c | 6 ++++-- 2 files changed, 15 insertions(+), 3 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 fa24d16..62fb53b 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c @@ -2250,10 +2250,16 @@ static int igb_ndo_bridge_setlink(struct net_device *dev, } #ifdef HAVE_BRIDGE_FILTER +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev, u32 filter_mask) #else static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, + struct net_device *dev, + u32 filter_mask, int nlflags) +#endif +#else +static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev) #endif { @@ -2269,7 +2275,11 @@ static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, mode = BRIDGE_MODE_VEPA; #ifdef HAVE_NDO_FDB_ADD_VID - return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0); +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) + return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, nl_flags); +#else + return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, 0); +#endif #else return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode); #endif /* HAVE_NDO_FDB_ADD_VID */ diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c index e34a0fd..e29caeb 100644 --- a/lib/librte_eal/linuxapp/kni/kni_net.c +++ b/lib/librte_eal/linuxapp/kni/kni_net.c @@ -601,7 +601,7 @@ kni_net_header(struct sk_buff *skb, struct net_device *dev, return dev->hard_header_len; } - +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) /* * Re-fill the eth header */ @@ -616,6 +616,7 @@ kni_net_rebuild_header(struct sk_buff *skb) return 0; } +#endif /** * kni_net_set_mac - Change the Ethernet Address of the KNI NIC @@ -646,8 +647,9 @@ static int kni_net_change_carrier(struct net_device *dev, bool new_carrier) static const struct header_ops kni_net_header_ops = { .create = kni_net_header, +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) .rebuild = kni_net_rebuild_header, - .cache = NULL, /* disable caching */ +#endif }; static const struct net_device_ops kni_net_netdev_ops = { -- 2.1.4