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, 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 05/15] net: hns: reject unsupported coalescing params
Date: Wed, 11 Mar 2020 15:32:52 -0700	[thread overview]
Message-ID: <20200311223302.2171564-6-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 did not previously reject unsupported parameters.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 5 +++++
 include/linux/ethtool.h                          | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
index 717fccc2efba..49624acf2473 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
@@ -1264,6 +1264,11 @@ static int hns_get_rxnfc(struct net_device *netdev,
 }
 
 static const struct ethtool_ops hns_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE |
+				     ETHTOOL_COALESCE_USECS_LOW_HIGH |
+				     ETHTOOL_COALESCE_MAX_FRAMES_LOW_HIGH,
 	.get_drvinfo = hns_nic_get_drvinfo,
 	.get_link  = hns_nic_get_link,
 	.get_ringparam = hns_get_ringparam,
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index acfce915a02b..be355f37337d 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -214,6 +214,11 @@ bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32,
 #define ETHTOOL_COALESCE_USECS_LOW_HIGH					\
 	(ETHTOOL_COALESCE_RX_USECS_LOW | ETHTOOL_COALESCE_TX_USECS_LOW | \
 	 ETHTOOL_COALESCE_RX_USECS_HIGH | ETHTOOL_COALESCE_TX_USECS_HIGH)
+#define ETHTOOL_COALESCE_MAX_FRAMES_LOW_HIGH	\
+	(ETHTOOL_COALESCE_RX_MAX_FRAMES_LOW |	\
+	 ETHTOOL_COALESCE_TX_MAX_FRAMES_LOW |	\
+	 ETHTOOL_COALESCE_RX_MAX_FRAMES_HIGH |	\
+	 ETHTOOL_COALESCE_TX_MAX_FRAMES_HIGH)
 #define ETHTOOL_COALESCE_PKT_RATE_RX_USECS				\
 	(ETHTOOL_COALESCE_USE_ADAPTIVE_RX |				\
 	 ETHTOOL_COALESCE_RX_USECS_LOW | ETHTOOL_COALESCE_RX_USECS_HIGH | \
-- 
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 ` Jakub Kicinski [this message]
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 ` [PATCH net-next 13/15] net: igc: let core reject the unsupported coalescing parameters Jakub Kicinski
2020-03-11 22:33 ` [PATCH net-next 14/15] net: ixgbe: reject unsupported coalescing params 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-6-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 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.