From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by dpdk.org (Postfix) with ESMTP id 425E31E34 for ; Tue, 22 May 2018 20:12:42 +0200 (CEST) Received: by mail-qk0-f195.google.com with SMTP id d125-v6so15331918qkb.8 for ; Tue, 22 May 2018 11:12:42 -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=EGw7P38J84Y2NXXGO52Q4hKrYD6+2tRJZeix3Gl2vGE=; b=Z/OytFcl164gWQqRK+uffza3j/JbP6TQbvjnDfbOFDzj4mczLGId7MZYjCz4Mqx3BV nEsg6hJR9YNiPtZ84sXOUf5LouJabFISZDS/ZfBg3wPJmITXZyzXgtF99ingVH+inFNH qOXjAbK9Fon1R/TGm1ror5VmqvKzjW4t4u85sxAq50k4Ya6hc9f2HNwWDjpZwXRBUJXu O6JUEPEvObtWvDEZiYRw7bNO5j6pZhKCb8WGE8j8pqyDfSYuIL8D7dwDSdNlyzcg096+ 61HRoLWsuOy0ggDuju1pXnXE0jqQuPfE261HGxTodceZWiFkR+or8jjGfq/nCaq05kGU JGtw== 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=EGw7P38J84Y2NXXGO52Q4hKrYD6+2tRJZeix3Gl2vGE=; b=Ia2D09p0L8cop240+b+vGckIMEPuBmzC33Iv4vPgb2BSGpizEFvkbD7iBW7la8l4m7 3fCd6nhTftBDvYFNuZn+VsqGCR7kATSMTROdYPbXfWdWlgdZvZ70uKJNe47L/fvNRIHW V3oVrod4jcK+wbBFBx+EXScPaT+XY05QKlIOoyAgaV7fujRE4xWAavrw7fwc6yOgvDMV T0PH4rX4YLIpV/XLkx3UXUWLuwCS7xuRqOeUnr+cE1zEaYzbvZyuT0azGGbuFd/9+LyM xh2qp1PxQSg6+B3j9Pd4tc8vYDCxMBzrU0ipcyWuWUNlpNm1dSWKJ6fi45rX/n0z85+t aIWw== X-Gm-Message-State: ALKqPwchobjHxpyW6Z5M5MADmKoyZChC7duaAtjBtjakgIPOMQyY+36e XmBTPu5p2j0Za3+FfPpIdLA= X-Google-Smtp-Source: AB8JxZo2LRDtBUCTq1RqK1qMEI9YDUZ+O8B9aYgkZ+aWXGTA/wB0oH7Dy+3LP3YOrfd4sog+UBP5rA== X-Received: by 2002:a37:9ec3:: with SMTP id h186-v6mr7255001qke.223.1527012761078; Tue, 22 May 2018 11:12:41 -0700 (PDT) Received: from snappy.local.lan ([179.110.136.174]) by smtp.gmail.com with ESMTPSA id m127-v6sm11567460qkc.68.2018.05.22.11.12.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 May 2018 11:12:40 -0700 (PDT) Sender: Dan Gora From: Dan Gora To: Ferruh Yigit Cc: dev@dpdk.org, Dan Gora Date: Tue, 22 May 2018 15:10:08 -0300 Message-Id: <20180522181008.6327-1-dg@adax.com> X-Mailer: git-send-email 2.13.2.556.g5116f79 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] 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: , X-List-Received-Date: Tue, 22 May 2018 18:12:42 -0000 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 v2: Reformatted according to recommendations from ferruh.yigit@intel.com --- kernel/linux/kni/ethtool/igb/kcompat.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h index fd3175b5d..40a8d99ce 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 */ @@ -3918,9 +3919,15 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) #endif #if ((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)) || \ - (SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12, 3, 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 -#endif /* >= 4.9.0, >= SLES12SP3 */ +#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 struct net_device_ops_extended */ +#define ndo_set_vf_vlan extended.ndo_set_vf_vlan +#endif +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) #define HAVE_PCI_ENABLE_MSIX -- 2.13.2.556.g5116f79