From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 6DE065F0F for ; Wed, 24 Oct 2018 11:55:00 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 02:54:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,420,1534834800"; d="scan'208";a="90823588" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.212]) by FMSMGA003.fm.intel.com with ESMTP; 24 Oct 2018 02:54:58 -0700 From: Ferruh Yigit To: Ferruh Yigit Cc: dev@dpdk.org, stephen@networkplumber.org Date: Wed, 24 Oct 2018 11:54:42 +0100 Message-Id: <20181024105443.57063-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] kni: fix build for Linux kernel 4.19 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: Wed, 24 Oct 2018 09:55:00 -0000 The build error observed with Linux kernel 4.19 when KNI ethtool support enabled (CONFIG_RTE_KNI_KMOD_ETHTOOL=y) .../build/build/kernel/linux/kni/kni_ethtool.c:193:3: error: ‘struct ethtool_ops’ has no member named ‘get_settings’; .get_settings = kni_get_settings, ^~~~~~~~~~~~ .../build/build/kernel/linux/kni/kni_ethtool.c:194:3: error: ‘struct ethtool_ops’ has no member named ‘set_settings’; .set_settings = kni_set_settings, ^~~~~~~~~~~~ With kernel 4.19 ethtool_ops `get_settings` & `set_settings` are replaced with `get_link_ksettings` & `set_link_ksettings` Commit 9b3004953503 ("ethtool: drop get_settings and set_settings callbacks") This fix practically removes `get_settings` & `set_settings` support for the kernel versions that have the new ethtool_ops without implementing the new ones. Signed-off-by: Ferruh Yigit --- kernel/linux/kni/kni_ethtool.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel/linux/kni/kni_ethtool.c b/kernel/linux/kni/kni_ethtool.c index a44e7d949..b6b6be23f 100644 --- a/kernel/linux/kni/kni_ethtool.c +++ b/kernel/linux/kni/kni_ethtool.c @@ -27,6 +27,8 @@ kni_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) priv->lad_dev->ethtool_ops->get_drvinfo(priv->lad_dev, info); } +/* ETHTOOL_GLINKSETTINGS replaces ETHTOOL_GSET */ +#ifndef ETHTOOL_GLINKSETTINGS static int kni_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) { @@ -34,7 +36,10 @@ kni_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) return priv->lad_dev->ethtool_ops->get_settings(priv->lad_dev, ecmd); } +#endif +/* ETHTOOL_SLINKSETTINGS replaces ETHTOOL_SSET */ +#ifdef ETHTOOL_SLINKSETTINGS static int kni_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) { @@ -42,6 +47,7 @@ kni_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) return priv->lad_dev->ethtool_ops->set_settings(priv->lad_dev, ecmd); } +#endif static void kni_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) @@ -190,8 +196,12 @@ kni_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, struct ethtool_ops kni_ethtool_ops = { .begin = kni_check_if_running, .get_drvinfo = kni_get_drvinfo, +#ifndef ETHTOOL_GLINKSETTINGS .get_settings = kni_get_settings, +#endif +#ifdef ETHTOOL_SLINKSETTINGS .set_settings = kni_set_settings, +#endif .get_regs_len = kni_get_regs_len, .get_regs = kni_get_regs, .get_wol = kni_get_wol, -- 2.17.2