From patchwork Tue May 22 00:18:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Gora X-Patchwork-Id: 40294 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 644081DB8; Tue, 22 May 2018 02:19:11 +0200 (CEST) Received: from mail-qt0-f195.google.com (mail-qt0-f195.google.com [209.85.216.195]) by dpdk.org (Postfix) with ESMTP id 21C011DA4 for ; Tue, 22 May 2018 02:19:10 +0200 (CEST) Received: by mail-qt0-f195.google.com with SMTP id g13-v6so21250977qth.8 for ; Mon, 21 May 2018 17:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ood4DkB1UnqzjMsfP1M8CaJuvalsxbjGonm6k6M4BFo=; b=O1TNQI01MhfPXP6nSmI+hu0Paol7xI+2wvBEaALjp6CjHV9X23hDE8YxQvonRK25wB at0UrtKEL7Frx7AzQZsG5Yn0/r5UqB7aL1QgY1dKXY0U2kf1UGWOoYY8ht5/gm599T01 jnrEHiOgtdo4nSSlUdgSfcHbc3OvyeWPGz6DYj9XDev7tSVUB292v9eLvkEqgGmbr4jO NYeXmMYiY3J7dre5qyMR2wI2p/N4AjaUaGWHxe7Yl+skIjHSq70hPvuDCDZbDuak0y58 f9bLxhxSAF2nrJ8vgkIbMb4KhOC/BCQBOYnwCFyDqpYU+8EtTLcPfYOC4HLDInYAHr6i sflQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=ood4DkB1UnqzjMsfP1M8CaJuvalsxbjGonm6k6M4BFo=; b=cx7vsknJdPYXM/4PO7A0yBHcA4YtGw+lBsS88IgUa7IjTUSfM8/pOcpqx8uzAMkeba 4i8/ei2toUFOjC9JJvEkAcEa9LhY5QFGed1zOiKrC10fwCMsAW8tXL+hZO+3yhUsRwpv uEfmE/6CENArjyBzNQydudFfc3m2uf06y69GKgaP+CwbKxoGxyLT3nl5wS+kRF+dHDrV w68BddRr6U87hPCyCGYJ51kzwV9BdbNNvf0UeOSFk2/pbNNWCiiUPk14/OFkgdr9axby EicbvBDKYoHf7dPZCDHjL1KoYwGzvB7sPxrNzqoq/C0qQeGK+1OX73IpT+akPprFHgpP aBCg== X-Gm-Message-State: ALKqPwcgrIoTMJuCJvkma2RAO1MdwdKo9SiTADEwqzE50MQFopmRCNd0 SH1cnGTr09jXWMGSNZWoPVI= X-Google-Smtp-Source: AB8JxZoccjjigQFGQoW05QYZGqDeQ8o/ZBgEqPgtR2iUVBmdl3n2ikoP9BQ5PODHE6GBTeDVKti+0Q== X-Received: by 2002:ac8:4a2:: with SMTP id s34-v6mr20513108qtg.129.1526948349314; Mon, 21 May 2018 17:19:09 -0700 (PDT) Received: from snappy.local.lan ([179.110.136.174]) by smtp.gmail.com with ESMTPSA id t128-v6sm10512912qkh.48.2018.05.21.17.19.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 May 2018 17:19:08 -0700 (PDT) From: Dan Gora To: Ferruh Yigit Cc: dev@dpdk.org, Dan Gora Date: Mon, 21 May 2018 21:18:35 -0300 Message-Id: <20180522001835.9843-1-dg@adax.com> X-Mailer: git-send-email 2.13.2.556.g5116f79 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] kni: fix build on Centos 7.4 when Ethtool enabled 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- kernel/linux/kni/ethtool/igb/kcompat.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h index fd3175b5d..3effbeeac 100644 --- a/kernel/linux/kni/ethtool/igb/kcompat.h +++ b/kernel/linux/kni/ethtool/igb/kcompat.h @@ -3900,7 +3900,8 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) #define HAVE_NDO_BRIDGE_GETLINK_NLFLAGS #endif /* >= 4.1.0 */ -#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) ) +#if (( LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) ) \ + || ( RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,4) )) /* ndo_bridge_getlink adds new filter_mask and vlan_fill parameters */ #define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL #endif /* >= 4.2.0 */ @@ -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 #endif /* >= 4.9.0, >= SLES12SP3 */ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)