All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, kernel-team@fb.com,
	cooldavid@cooldavid.org, sebastian.hesselbarth@gmail.com,
	thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com,
	rmk+kernel@armlinux.org.uk, mcroce@redhat.com,
	sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com,
	hkelam@marvell.com, mlindner@marvell.com,
	stephen@networkplumber.org, christopher.lee@cspi.com,
	manishc@marvell.com, rahulv@marvell.com,
	GR-Linux-NIC-Dev@marvell.com, aelior@marvell.com,
	GR-everest-linux-l2@marvell.com, shshaikh@marvell.com,
	nic_swsd@realtek.com, hkallweit1@gmail.com, bh74.an@samsung.com,
	romieu@fr.zoreil.com
Subject: [PATCH net-next 12/15] net: qlnic: let core reject the unsupported coalescing parameters
Date: Thu, 12 Mar 2020 21:08:00 -0700	[thread overview]
Message-ID: <20200313040803.2367590-13-kuba@kernel.org> (raw)
In-Reply-To: <20200313040803.2367590-1-kuba@kernel.org>

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

This driver already correctly rejected almost all
unsupported parameters (missing sample_rate_interval).

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

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 .../ethernet/qlogic/qlcnic/qlcnic_ethtool.c   | 23 ++++---------------
 1 file changed, 5 insertions(+), 18 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index 75d83c3cbf27..5c2a3acf1e89 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -1542,24 +1542,7 @@ static int qlcnic_set_intr_coalesce(struct net_device *netdev,
 	if (ethcoal->rx_coalesce_usecs > 0xffff ||
 	    ethcoal->rx_max_coalesced_frames > 0xffff ||
 	    ethcoal->tx_coalesce_usecs > 0xffff ||
-	    ethcoal->tx_max_coalesced_frames > 0xffff ||
-	    ethcoal->rx_coalesce_usecs_irq ||
-	    ethcoal->rx_max_coalesced_frames_irq ||
-	    ethcoal->tx_coalesce_usecs_irq ||
-	    ethcoal->tx_max_coalesced_frames_irq ||
-	    ethcoal->stats_block_coalesce_usecs ||
-	    ethcoal->use_adaptive_rx_coalesce ||
-	    ethcoal->use_adaptive_tx_coalesce ||
-	    ethcoal->pkt_rate_low ||
-	    ethcoal->rx_coalesce_usecs_low ||
-	    ethcoal->rx_max_coalesced_frames_low ||
-	    ethcoal->tx_coalesce_usecs_low ||
-	    ethcoal->tx_max_coalesced_frames_low ||
-	    ethcoal->pkt_rate_high ||
-	    ethcoal->rx_coalesce_usecs_high ||
-	    ethcoal->rx_max_coalesced_frames_high ||
-	    ethcoal->tx_coalesce_usecs_high ||
-	    ethcoal->tx_max_coalesced_frames_high)
+	    ethcoal->tx_max_coalesced_frames > 0xffff)
 		return -EINVAL;
 
 	err = qlcnic_config_intr_coalesce(adapter, ethcoal);
@@ -1834,6 +1817,8 @@ qlcnic_set_dump(struct net_device *netdev, struct ethtool_dump *val)
 }
 
 const struct ethtool_ops qlcnic_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES,
 	.get_drvinfo = qlcnic_get_drvinfo,
 	.get_regs_len = qlcnic_get_regs_len,
 	.get_regs = qlcnic_get_regs,
@@ -1865,6 +1850,8 @@ const struct ethtool_ops qlcnic_ethtool_ops = {
 };
 
 const struct ethtool_ops qlcnic_sriov_vf_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES,
 	.get_drvinfo		= qlcnic_get_drvinfo,
 	.get_regs_len		= qlcnic_get_regs_len,
 	.get_regs		= qlcnic_get_regs,
-- 
2.24.1


  parent reply	other threads:[~2020-03-13  4:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13  4:07 [PATCH net-next 00/15] ethtool: consolidate irq coalescing - part 5 Jakub Kicinski
2020-03-13  4:07 ` [PATCH net-next 01/15] net: jme: reject unsupported coalescing params Jakub Kicinski
2020-03-13  4:07 ` [PATCH net-next 02/15] net: mv643xx_eth: " Jakub Kicinski
2020-03-13  4:07 ` [PATCH net-next 03/15] net: mvneta: " Jakub Kicinski
2020-03-13  4:07 ` [PATCH net-next 04/15] net: mvpp2: " Jakub Kicinski
2020-03-13 11:05   ` Matteo Croce
2020-03-13  4:07 ` [PATCH net-next 05/15] net: octeontx2-pf: let core reject the unsupported coalescing parameters Jakub Kicinski
2020-03-13  4:07 ` [PATCH net-next 06/15] net: skge: reject unsupported coalescing params Jakub Kicinski
2020-03-13  4:07 ` [PATCH net-next 07/15] net: sky2: " Jakub Kicinski
2020-03-13  4:07 ` [PATCH net-next 08/15] net: myri10ge: " Jakub Kicinski
2020-03-13  4:07 ` [PATCH net-next 09/15] net: nixge: let core reject the unsupported coalescing parameters Jakub Kicinski
2020-03-13  4:07 ` [PATCH net-next 10/15] net: netxen: " Jakub Kicinski
2020-03-13  4:07 ` [PATCH net-next 11/15] net: qede: reject unsupported coalescing params Jakub Kicinski
2020-03-13  4:08 ` Jakub Kicinski [this message]
2020-03-13  4:08 ` [PATCH net-next 13/15] net: r8169: " Jakub Kicinski
2020-03-13  6:13   ` Heiner Kallweit
2020-03-13  4:08 ` [PATCH net-next 14/15] net: sxgbe: " Jakub Kicinski
2020-03-13  4:08 ` [PATCH net-next 15/15] net: via: " Jakub Kicinski
2020-03-15  4:14 ` [PATCH net-next 00/15] ethtool: consolidate irq coalescing - part 5 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=20200313040803.2367590-13-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=GR-Linux-NIC-Dev@marvell.com \
    --cc=GR-everest-linux-l2@marvell.com \
    --cc=aelior@marvell.com \
    --cc=bh74.an@samsung.com \
    --cc=christopher.lee@cspi.com \
    --cc=cooldavid@cooldavid.org \
    --cc=davem@davemloft.net \
    --cc=gakula@marvell.com \
    --cc=hkallweit1@gmail.com \
    --cc=hkelam@marvell.com \
    --cc=kernel-team@fb.com \
    --cc=manishc@marvell.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcroce@redhat.com \
    --cc=mlindner@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=rahulv@marvell.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=romieu@fr.zoreil.com \
    --cc=sbhatta@marvell.com \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=sgoutham@marvell.com \
    --cc=shshaikh@marvell.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.