From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id E0787A0AC5
	for <public@inbox.dpdk.org>; Mon, 27 May 2019 06:06:37 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id B0B5D2C30;
	Mon, 27 May 2019 06:06:37 +0200 (CEST)
Received: from mga09.intel.com (mga09.intel.com [134.134.136.24])
 by dpdk.org (Postfix) with ESMTP id C7DD6A3;
 Mon, 27 May 2019 06:06:33 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga005.jf.intel.com ([10.7.209.41])
 by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 26 May 2019 21:06:32 -0700
X-ExtLoop1: 1
Received: from nfvihost.sh.intel.com ([10.239.182.124])
 by orsmga005.jf.intel.com with ESMTP; 26 May 2019 21:06:32 -0700
From: michael.luo@intel.com
To: dev@dpdk.org
Cc: stable@dpdk.org
Date: Mon, 27 May 2019 12:02:07 +0800
Message-Id: <1558929727-56647-1-git-send-email-michael.luo@intel.com>
X-Mailer: git-send-email 2.7.4
Subject: [dpdk-stable] [PATCH] kni: fix build on RHEL8
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org
Sender: "stable" <stable-bounces@dpdk.org>

From: Luo Gaoliang <michael.luo@intel.com>

Build error was seen on RHEL8 when CONFIG_RTE_KNI_KMOD_ETHTOOL is enabled.

Build error log:
/root/kni/dpdk-19.05/kernel/linux/kni/ethtool/igb/kcompat.h:3928:25:
error: 'const struct net_device_ops' has no member named 'extended'
 #define ndo_set_vf_vlan extended.ndo_set_vf_vlan
                         ^~~~~~~~

RHEL8 defined ndo_set_vf_vlan in net_device_ops as well as the mainline kernel.

Signed-off-by: Luo Gaoliang <michael.luo@intel.com>
---
 kernel/linux/kni/ethtool/igb/kcompat.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h
index 649a69c..f041a3e 100644
--- a/kernel/linux/kni/ethtool/igb/kcompat.h
+++ b/kernel/linux/kni/ethtool/igb/kcompat.h
@@ -3922,7 +3922,8 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
      (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))
+#if ((RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 4)) && \
+	(RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(8, 0)))
 /* 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
-- 
2.7.4