DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, stephen@networkplumber.org
Subject: [dpdk-dev] [PATCH] kni: fix build for Linux kernel 4.19
Date: Wed, 24 Oct 2018 11:54:42 +0100	[thread overview]
Message-ID: <20181024105443.57063-1-ferruh.yigit@intel.com> (raw)

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 <ferruh.yigit@intel.com>
---
 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

             reply	other threads:[~2018-10-24  9:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-24 10:54 Ferruh Yigit [this message]
2018-10-24 11:10 ` [dpdk-dev] [PATCH v2] " Ferruh Yigit
2018-10-26 13:29   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181024105443.57063-1-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).