netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: jdike@addtoit.com, richard@nod.at,
	anton.ivanov@cambridgegreys.com, linux-um@lists.infradead.org,
	dledford@redhat.com, jgg@ziepe.ca, leon@kernel.org,
	linux-rdma@vger.kernel.org, edumazet@google.com,
	jasowang@redhat.com, mkubecek@suse.cz, hayeswang@realtek.com,
	doshir@vmware.com, pv-drivers@vmware.com, manishc@marvell.com,
	GR-Linux-NIC-Dev@marvell.com, gregkh@linuxfoundation.org,
	merez@codeaurora.org, kvalo@codeaurora.org,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 5/7] vmxnet3: let core reject the unsupported coalescing parameters
Date: Thu,  5 Mar 2020 17:06:00 -0800	[thread overview]
Message-ID: <20200306010602.1620354-6-kuba@kernel.org> (raw)
In-Reply-To: <20200306010602.1620354-1-kuba@kernel.org>

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

This driver correctly rejects all unsupported parameters.
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>
---
 drivers/net/vmxnet3/vmxnet3_ethtool.c | 24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c
index 1e4b9ba70983..6528940ce5f3 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
@@ -780,27 +780,6 @@ vmxnet3_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec)
 	if (!VMXNET3_VERSION_GE_3(adapter))
 		return -EOPNOTSUPP;
 
-	if (ec->rx_coalesce_usecs_irq ||
-	    ec->rx_max_coalesced_frames_irq ||
-	    ec->tx_coalesce_usecs ||
-	    ec->tx_coalesce_usecs_irq ||
-	    ec->tx_max_coalesced_frames_irq ||
-	    ec->stats_block_coalesce_usecs ||
-	    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 -EINVAL;
-	}
-
 	if ((ec->rx_coalesce_usecs == 0) &&
 	    (ec->use_adaptive_rx_coalesce == 0) &&
 	    (ec->tx_max_coalesced_frames == 0) &&
@@ -891,6 +870,9 @@ vmxnet3_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec)
 }
 
 static const struct ethtool_ops vmxnet3_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
 	.get_drvinfo       = vmxnet3_get_drvinfo,
 	.get_regs_len      = vmxnet3_get_regs_len,
 	.get_regs          = vmxnet3_get_regs,
-- 
2.24.1


  parent reply	other threads:[~2020-03-06  1:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06  1:05 [PATCH net-next 0/7] ethtool: consolidate irq coalescing - other drivers Jakub Kicinski
2020-03-06  1:05 ` [PATCH net-next 1/7] um: reject unsupported coalescing params Jakub Kicinski
2020-03-06  6:58   ` Anton Ivanov
2020-03-06  1:05 ` [PATCH net-next 2/7] RDMA/ipoib: " Jakub Kicinski
2020-03-06 12:09   ` Leon Romanovsky
2020-03-06  1:05 ` [PATCH net-next 3/7] tun: " Jakub Kicinski
2020-03-06  9:33   ` Jason Wang
2020-03-06  1:05 ` [PATCH net-next 4/7] r8152: " Jakub Kicinski
2020-03-06  2:19   ` Hayes Wang
2020-03-06  1:06 ` Jakub Kicinski [this message]
2020-03-06  1:06 ` [PATCH net-next 6/7] staging: qlge: " Jakub Kicinski
2020-03-06  1:06 ` [PATCH net-next 7/7] wil6210: " Jakub Kicinski
2020-03-06  6:33   ` Kalle Valo
2020-03-07  6:46 ` [PATCH net-next 0/7] ethtool: consolidate irq coalescing - other drivers 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=20200306010602.1620354-6-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=GR-Linux-NIC-Dev@marvell.com \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=davem@davemloft.net \
    --cc=dledford@redhat.com \
    --cc=doshir@vmware.com \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hayeswang@realtek.com \
    --cc=jasowang@redhat.com \
    --cc=jdike@addtoit.com \
    --cc=jgg@ziepe.ca \
    --cc=kvalo@codeaurora.org \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=manishc@marvell.com \
    --cc=merez@codeaurora.org \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=pv-drivers@vmware.com \
    --cc=richard@nod.at \
    /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).