netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-net-drivers@solarflare.com,
	ecree@solarflare.com, mhabets@solarflare.com,
	jaswinder.singh@linaro.org, ilias.apalodimas@linaro.org,
	Jose.Abreu@synopsys.com, andy@greyhouse.net,
	grygorii.strashko@ti.com, andrew@lunn.ch,
	michal.simek@xilinx.com, radhey.shyam.pandey@xilinx.com,
	mkubecek@suse.cz, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 1/9] net: sfc: reject unsupported coalescing params
Date: Mon, 16 Mar 2020 13:47:04 -0700	[thread overview]
Message-ID: <20200316204712.3098382-2-kuba@kernel.org> (raw)
In-Reply-To: <20200316204712.3098382-1-kuba@kernel.org>

Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.

This driver did not previously reject unsupported parameters.
The check for use_adaptive_tx_coalesce will now be done by
the core.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/ethernet/sfc/ethtool.c        | 6 +++---
 drivers/net/ethernet/sfc/falcon/ethtool.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c
index 9a637cd67f43..04e88d05e8ff 100644
--- a/drivers/net/ethernet/sfc/ethtool.c
+++ b/drivers/net/ethernet/sfc/ethtool.c
@@ -232,9 +232,6 @@ static int efx_ethtool_set_coalesce(struct net_device *net_dev,
 	bool adaptive, rx_may_override_tx;
 	int rc;
 
-	if (coalesce->use_adaptive_tx_coalesce)
-		return -EINVAL;
-
 	efx_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &adaptive);
 
 	if (coalesce->rx_coalesce_usecs != rx_usecs)
@@ -1138,6 +1135,9 @@ static int efx_ethtool_set_fecparam(struct net_device *net_dev,
 }
 
 const struct ethtool_ops efx_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_USECS_IRQ |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
 	.get_drvinfo		= efx_ethtool_get_drvinfo,
 	.get_regs_len		= efx_ethtool_get_regs_len,
 	.get_regs		= efx_ethtool_get_regs,
diff --git a/drivers/net/ethernet/sfc/falcon/ethtool.c b/drivers/net/ethernet/sfc/falcon/ethtool.c
index 08bd6a321918..db90d94e24c9 100644
--- a/drivers/net/ethernet/sfc/falcon/ethtool.c
+++ b/drivers/net/ethernet/sfc/falcon/ethtool.c
@@ -603,9 +603,6 @@ static int ef4_ethtool_set_coalesce(struct net_device *net_dev,
 	bool adaptive, rx_may_override_tx;
 	int rc;
 
-	if (coalesce->use_adaptive_tx_coalesce)
-		return -EINVAL;
-
 	ef4_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &adaptive);
 
 	if (coalesce->rx_coalesce_usecs != rx_usecs)
@@ -1311,6 +1308,9 @@ static int ef4_ethtool_get_module_info(struct net_device *net_dev,
 }
 
 const struct ethtool_ops ef4_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_USECS_IRQ |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
 	.get_drvinfo		= ef4_ethtool_get_drvinfo,
 	.get_regs_len		= ef4_ethtool_get_regs_len,
 	.get_regs		= ef4_ethtool_get_regs,
-- 
2.24.1


  reply	other threads:[~2020-03-16 20:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 20:47 [PATCH net-next 0/9] ethtool: consolidate irq coalescing - last part Jakub Kicinski
2020-03-16 20:47 ` Jakub Kicinski [this message]
2020-03-17  1:29   ` [PATCH net-next 1/9] net: sfc: reject unsupported coalescing params Edward Cree
2020-03-16 20:47 ` [PATCH net-next 2/9] net: socionext: " Jakub Kicinski
2020-03-17  7:51   ` Ilias Apalodimas
2020-03-16 20:47 ` [PATCH net-next 3/9] net: dwc-xlgmac: let core reject the unsupported coalescing parameters Jakub Kicinski
2020-03-16 20:47 ` [PATCH net-next 4/9] net: tehuti: reject unsupported coalescing params Jakub Kicinski
2020-03-16 20:47 ` [PATCH net-next 5/9] net: cpsw: " Jakub Kicinski
2020-03-17  6:38   ` Grygorii Strashko
2020-03-16 20:47 ` [PATCH net-next 6/9] net: davinci_emac: " Jakub Kicinski
2020-03-16 20:47 ` [PATCH net-next 7/9] net: ll_temac: let core reject the unsupported coalescing parameters Jakub Kicinski
2020-03-16 20:47 ` [PATCH net-next 8/9] net: axienet: " Jakub Kicinski
2020-03-16 20:47 ` [PATCH net-next 9/9] net: ethtool: require drivers to set supported_coalesce_params Jakub Kicinski
2020-03-17  8:45   ` Michal Kubecek
2020-03-18  3:57 ` [PATCH net-next 0/9] ethtool: consolidate irq coalescing - last part David Miller

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=20200316204712.3098382-2-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=Jose.Abreu@synopsys.com \
    --cc=andrew@lunn.ch \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=ecree@solarflare.com \
    --cc=grygorii.strashko@ti.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jaswinder.singh@linaro.org \
    --cc=linux-net-drivers@solarflare.com \
    --cc=mhabets@solarflare.com \
    --cc=michal.simek@xilinx.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=radhey.shyam.pandey@xilinx.com \
    /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).