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, mkubecek@suse.cz,
	sathya.perla@broadcom.com, ajit.khaparde@broadcom.com,
	sriharsha.basavapatna@broadcom.com, somnath.kotur@broadcom.com,
	madalin.bucur@nxp.com, fugang.duan@nxp.com,
	claudiu.manoil@nxp.com, yisen.zhuang@huawei.com,
	salil.mehta@huawei.com, jeffrey.t.kirsher@intel.com,
	jacob.e.keller@intel.com, alexander.h.duyck@linux.intel.com,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 13/15] net: igc: let core reject the unsupported coalescing parameters
Date: Wed, 11 Mar 2020 15:33:00 -0700	[thread overview]
Message-ID: <20200311223302.2171564-14-kuba@kernel.org> (raw)
In-Reply-To: <20200311223302.2171564-1-kuba@kernel.org>

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

This driver was rejecting almost all unsupported
parameters already, it was only missing a check
for tx_max_coalesced_frames_irq.

As a side effect of these changes the error code for
unsupported params changes from ENOTSUPP to EOPNOTSUPP.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/ethernet/intel/igc/igc_ethtool.c | 22 +-------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index 69f50b8e2af3..f530fc29b074 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -861,27 +861,6 @@ static int igc_set_coalesce(struct net_device *netdev,
 	struct igc_adapter *adapter = netdev_priv(netdev);
 	int i;
 
-	if (ec->rx_max_coalesced_frames ||
-	    ec->rx_coalesce_usecs_irq ||
-	    ec->rx_max_coalesced_frames_irq ||
-	    ec->tx_max_coalesced_frames ||
-	    ec->tx_coalesce_usecs_irq ||
-	    ec->stats_block_coalesce_usecs ||
-	    ec->use_adaptive_rx_coalesce ||
-	    ec->use_adaptive_tx_coalesce ||
-	    ec->pkt_rate_low ||
-	    ec->rx_coalesce_usecs_low ||
-	    ec->rx_max_coalesced_frames_low ||
-	    ec->tx_coalesce_usecs_low ||
-	    ec->tx_max_coalesced_frames_low ||
-	    ec->pkt_rate_high ||
-	    ec->rx_coalesce_usecs_high ||
-	    ec->rx_max_coalesced_frames_high ||
-	    ec->tx_coalesce_usecs_high ||
-	    ec->tx_max_coalesced_frames_high ||
-	    ec->rate_sample_interval)
-		return -ENOTSUPP;
-
 	if (ec->rx_coalesce_usecs > IGC_MAX_ITR_USECS ||
 	    (ec->rx_coalesce_usecs > 3 &&
 	     ec->rx_coalesce_usecs < IGC_MIN_ITR_USECS) ||
@@ -1915,6 +1894,7 @@ static int igc_set_link_ksettings(struct net_device *netdev,
 }
 
 static const struct ethtool_ops igc_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
 	.get_drvinfo		= igc_get_drvinfo,
 	.get_regs_len		= igc_get_regs_len,
 	.get_regs		= igc_get_regs,
-- 
2.24.1


  parent reply	other threads:[~2020-03-11 22:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 22:32 [PATCH net-next 00/15] ethtool: consolidate irq coalescing - part 4 Jakub Kicinski
2020-03-11 22:32 ` [PATCH net-next 01/15] net: be2net: reject unsupported coalescing params Jakub Kicinski
2020-03-11 22:32 ` [PATCH net-next 02/15] net: dpaa: " Jakub Kicinski
2020-03-12  7:35   ` Madalin Bucur (OSS)
2020-03-11 22:32 ` [PATCH net-next 03/15] net: fec: " Jakub Kicinski
2020-03-12  1:24   ` [EXT] " Andy Duan
2020-03-11 22:32 ` [PATCH net-next 04/15] net: gianfar: " Jakub Kicinski
2020-03-11 22:32 ` [PATCH net-next 05/15] net: hns: " Jakub Kicinski
2020-03-11 22:32 ` [PATCH net-next 06/15] net: hns3: " Jakub Kicinski
2020-03-11 22:32 ` [PATCH net-next 07/15] net: e1000: " Jakub Kicinski
2020-03-11 22:32 ` [PATCH net-next 08/15] net: fm10k: " Jakub Kicinski
2020-03-11 22:41   ` Jacob Keller
2020-03-11 22:32 ` [PATCH net-next 09/15] net: i40e: " Jakub Kicinski
2020-03-11 22:32 ` [PATCH net-next 10/15] net: iavf: " Jakub Kicinski
2020-03-11 22:32 ` [PATCH net-next 11/15] net: igb: let core reject the unsupported coalescing parameters Jakub Kicinski
2020-03-11 22:32 ` [PATCH net-next 12/15] net: igbvf: reject unsupported coalescing params Jakub Kicinski
2020-03-11 22:33 ` Jakub Kicinski [this message]
2020-03-11 22:33 ` [PATCH net-next 14/15] net: ixgbe: " Jakub Kicinski
2020-03-11 22:33 ` [PATCH net-next 15/15] net: ixgbevf: " Jakub Kicinski
2020-03-12 18:33 ` [PATCH net-next 00/15] ethtool: consolidate irq coalescing - part 4 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=20200311223302.2171564-14-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=ajit.khaparde@broadcom.com \
    --cc=alexander.h.duyck@linux.intel.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=fugang.duan@nxp.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=madalin.bucur@nxp.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=sathya.perla@broadcom.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=sriharsha.basavapatna@broadcom.com \
    --cc=yisen.zhuang@huawei.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).