Skip to contentSkip to conversation

ethtool: consolidate irq coalescing - part 4

PATCH In review Jakub Kicinski 5 participants 20 messages Mar 11, 2020 – Mar 12, 2020

Subsystems (10)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

cover ethtool: consolidate irq coalescing - part 4

Hi!

Convert more drivers following the groundwork laid in a recent patch set [1] and continued in [2], [3]. The aim of the effort is to consolidate irq coalescing parameter validation in the core.

This set converts 15 drivers in drivers/net/ethernet - remaining Intel drivers, Freescale/NXP, and others.
2 more conversion sets to come.

[1] https://lore.kernel.org/netdev/[email protected]/
[2] https://lore.kernel.org/netdev/[email protected]/
[3] https://lore.kernel.org/netdev/[email protected]/

Jakub Kicinski (15):
net: be2net: reject unsupported coalescing params
net: dpaa: reject unsupported coalescing params
net: fec: reject unsupported coalescing params
net: gianfar: reject unsupported coalescing params
net: hns: reject unsupported coalescing params
net: hns3: reject unsupported coalescing params
net: e1000: reject unsupported coalescing params
net: fm10k: reject unsupported coalescing params
net: i40e: reject unsupported coalescing params
net: iavf: reject unsupported coalescing params
net: igb: let core reject the unsupported coalescing parameters
net: igbvf: reject unsupported coalescing params
net: igc: let core reject the unsupported coalescing parameters
net: ixgbe: reject unsupported coalescing params
net: ixgbevf: reject unsupported coalescing params

 .../net/ethernet/emulex/benet/be_ethtool.c    |  3 +++
 .../ethernet/freescale/dpaa/dpaa_ethtool.c    |  6 ++---
 drivers/net/ethernet/freescale/fec_main.c     |  2 ++
 .../net/ethernet/freescale/gianfar_ethtool.c  |  2 ++
 .../net/ethernet/hisilicon/hns/hns_ethtool.c  |  5 +++++
 .../ethernet/hisilicon/hns3/hns3_ethtool.c    |  7 ++++++
 .../net/ethernet/intel/e1000/e1000_ethtool.c  |  1 +
 .../net/ethernet/intel/fm10k/fm10k_ethtool.c  |  2 ++
 .../net/ethernet/intel/i40e/i40e_ethtool.c    |  5 +++++
 .../net/ethernet/intel/iavf/iavf_ethtool.c    |  4 ++++
 drivers/net/ethernet/intel/igb/igb_ethtool.c  | 22 +------------------
 drivers/net/ethernet/intel/igbvf/ethtool.c    |  1 +
 drivers/net/ethernet/intel/igc/igc_ethtool.c  | 22 +------------------
 .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  |  1 +
 drivers/net/ethernet/intel/ixgbevf/ethtool.c  |  1 +
 include/linux/ethtool.h                       |  8 +++++++
 16 files changed, 46 insertions(+), 46 deletions(-)
Signature · 1 line
2.24.1
author maintainer
#1 lore raw

PATCH 1/15 net: be2net: reject unsupported coalescing params

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

This driver did not previously reject unsupported parameters.

---
 drivers/net/ethernet/emulex/benet/be_ethtool.c | 3 +++
 include/linux/ethtool.h                        | 3 +++
 2 files changed, 6 insertions(+)
drivers/net/ethernet/emulex/benet/be_ethtool.c +3 -0
index 9d9f0545fbfe..d6ed1d943762 100644
@@ -1408,6 +1408,9 @@ static int be_set_priv_flags(struct net_device *netdev, u32 flags)
 }
 
 const struct ethtool_ops be_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE |
+				     ETHTOOL_COALESCE_USECS_LOW_HIGH,
 	.get_drvinfo = be_get_drvinfo,
 	.get_wol = be_get_wol,
 	.set_wol = be_set_wol,
include/linux/ethtool.h +3 -0
index 9efeebde3514..acfce915a02b 100644
@@ -211,6 +211,9 @@ bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32,
 	 ETHTOOL_COALESCE_TX_MAX_FRAMES_IRQ)
 #define ETHTOOL_COALESCE_USE_ADAPTIVE					\
 	(ETHTOOL_COALESCE_USE_ADAPTIVE_RX | ETHTOOL_COALESCE_USE_ADAPTIVE_TX)
+#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_PKT_RATE_RX_USECS				\
 	(ETHTOOL_COALESCE_USE_ADAPTIVE_RX |				\
 	 ETHTOOL_COALESCE_RX_USECS_LOW | ETHTOOL_COALESCE_RX_USECS_HIGH | \
Signature · 1 line
2.24.1
author maintainer
#2 lore raw

PATCH 2/15 net: dpaa: reject unsupported coalescing params

In reply to Jakub Kicinski

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

This driver did not previously reject unsupported parameters (other than adaptive rx, which will now be rejected by core).

---
 drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c +2 -4
index 6aa1fa22cd04..9db2a02fb531 100644
@@ -525,7 +525,6 @@ static int dpaa_get_coalesce(struct net_device *dev,
 
 	c->rx_coalesce_usecs = period;
 	c->rx_max_coalesced_frames = thresh;
-	c->use_adaptive_rx_coalesce = false;
 
 	return 0;
 }
@@ -540,9 +539,6 @@ static int dpaa_set_coalesce(struct net_device *dev,
 	u8 thresh, prev_thresh;
 	int cpu, res;
 
-	if (c->use_adaptive_rx_coalesce)
-		return -EINVAL;
-
 	period = c->rx_coalesce_usecs;
 	thresh = c->rx_max_coalesced_frames;
 
@@ -582,6 +578,8 @@ static int dpaa_set_coalesce(struct net_device *dev,
 }
 
 const struct ethtool_ops dpaa_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
+				     ETHTOOL_COALESCE_RX_MAX_FRAMES,
 	.get_drvinfo = dpaa_get_drvinfo,
 	.get_msglevel = dpaa_get_msglevel,
 	.set_msglevel = dpaa_set_msglevel,
Signature · 1 line
2.24.1
author maintainer
#6 lore raw

PATCH 4/15 net: gianfar: reject unsupported coalescing params

In reply to Jakub Kicinski

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

This driver did not previously reject unsupported parameters.

---
 drivers/net/ethernet/freescale/gianfar_ethtool.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/freescale/gianfar_ethtool.c +2 -0
index f82e0be4d309..cc7d4f93da54 100644
@@ -1474,6 +1474,8 @@ static int gfar_get_ts_info(struct net_device *dev,
 }
 
 const struct ethtool_ops gfar_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES,
 	.get_drvinfo = gfar_gdrvinfo,
 	.get_regs_len = gfar_reglen,
 	.get_regs = gfar_get_regs,
Signature · 1 line
2.24.1
author maintainer
#13 lore raw

PATCH 10/15 net: iavf: reject unsupported coalescing params

In reply to Jakub Kicinski

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

This driver did not previously reject unsupported parameters.

---
 drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/intel/iavf/iavf_ethtool.c +4 -0
index f807e2c7597f..2c39d46b6138 100644
@@ -996,6 +996,10 @@ static int iavf_set_rxfh(struct net_device *netdev, const u32 *indir,
 }
 
 static const struct ethtool_ops iavf_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES |
+				     ETHTOOL_COALESCE_MAX_FRAMES_IRQ |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE,
 	.get_drvinfo		= iavf_get_drvinfo,
 	.get_link		= ethtool_op_get_link,
 	.get_ringparam		= iavf_get_ringparam,
Signature · 1 line
2.24.1
author maintainer
#15 lore raw

PATCH 12/15 net: igbvf: reject unsupported coalescing params

In reply to Jakub Kicinski

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

This driver did not previously reject unsupported parameters.

---
 drivers/net/ethernet/intel/igbvf/ethtool.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/igbvf/ethtool.c +1 -0
index 3ae358b35227..9217d150e286 100644
@@ -424,6 +424,7 @@ static void igbvf_get_strings(struct net_device *netdev, u32 stringset,
 }
 
 static const struct ethtool_ops igbvf_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS,
 	.get_drvinfo		= igbvf_get_drvinfo,
 	.get_regs_len		= igbvf_get_regs_len,
 	.get_regs		= igbvf_get_regs,
Signature · 1 line
2.24.1
author maintainer
#16 lore raw

PATCH 13/15 net: igc: let core reject the unsupported coalescing parameters

In reply to Jakub Kicinski

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.

---
 drivers/net/ethernet/intel/igc/igc_ethtool.c | 22 +-------------------
 1 file changed, 1 insertion(+), 21 deletions(-)
drivers/net/ethernet/intel/igc/igc_ethtool.c +1 -21
index 69f50b8e2af3..f530fc29b074 100644
@@ -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,
Signature · 1 line
2.24.1
author maintainer
#17 lore raw

PATCH 14/15 net: ixgbe: reject unsupported coalescing params

In reply to Jakub Kicinski

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

This driver did not previously reject unsupported parameters.

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +1 -0
index 7c52ae8ac005..c6bf0a50ee63 100644
@@ -3444,6 +3444,7 @@ static int ixgbe_set_priv_flags(struct net_device *netdev, u32 priv_flags)
 }
 
 static const struct ethtool_ops ixgbe_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
 	.get_drvinfo            = ixgbe_get_drvinfo,
 	.get_regs_len           = ixgbe_get_regs_len,
 	.get_regs               = ixgbe_get_regs,
Signature · 1 line
2.24.1
author maintainer
#18 lore raw

PATCH 15/15 net: ixgbevf: reject unsupported coalescing params

In reply to Jakub Kicinski

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

This driver did not previously reject unsupported parameters.

---
 drivers/net/ethernet/intel/ixgbevf/ethtool.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/ixgbevf/ethtool.c +1 -0
index f7f309c96fa8..988fa49fa99a 100644
@@ -968,6 +968,7 @@ static int ixgbevf_set_priv_flags(struct net_device *netdev, u32 priv_flags)
 }
 
 static const struct ethtool_ops ixgbevf_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
 	.get_drvinfo		= ixgbevf_get_drvinfo,
 	.get_regs_len		= ixgbevf_get_regs_len,
 	.get_regs		= ixgbevf_get_regs,
Signature · 1 line
2.24.1
author maintainer
#12 lore raw

PATCH 9/15 net: i40e: reject unsupported coalescing params

In reply to Jakub Kicinski

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

This driver did not previously reject unsupported parameters.

---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +5 -0
index 317f3f1458db..aa8026b1eb81 100644
@@ -5249,6 +5249,11 @@ static const struct ethtool_ops i40e_ethtool_recovery_mode_ops = {
 };
 
 static const struct ethtool_ops i40e_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES_IRQ |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE |
+				     ETHTOOL_COALESCE_RX_USECS_HIGH |
+				     ETHTOOL_COALESCE_TX_USECS_HIGH,
 	.get_drvinfo		= i40e_get_drvinfo,
 	.get_regs_len		= i40e_get_regs_len,
 	.get_regs		= i40e_get_regs,
Signature · 1 line
2.24.1
author maintainer
#14 lore raw

PATCH 11/15 net: igb: let core reject the unsupported coalescing parameters

In reply to Jakub Kicinski

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.

---
 drivers/net/ethernet/intel/igb/igb_ethtool.c | 22 +-------------------
 1 file changed, 1 insertion(+), 21 deletions(-)
drivers/net/ethernet/intel/igb/igb_ethtool.c +1 -21
index f96ffa83efbe..39d3b76a6f5d 100644
@@ -2183,27 +2183,6 @@ static int igb_set_coalesce(struct net_device *netdev,
 	struct igb_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 > IGB_MAX_ITR_USECS) ||
 	    ((ec->rx_coalesce_usecs > 3) &&
 	     (ec->rx_coalesce_usecs < IGB_MIN_ITR_USECS)) ||
@@ -3477,6 +3456,7 @@ static int igb_set_priv_flags(struct net_device *netdev, u32 priv_flags)
 }
 
 static const struct ethtool_ops igb_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
 	.get_drvinfo		= igb_get_drvinfo,
 	.get_regs_len		= igb_get_regs_len,
 	.get_regs		= igb_get_regs,
Signature · 1 line
2.24.1
author maintainer
#10 lore raw

PATCH 8/15 net: fm10k: reject unsupported coalescing params

In reply to Jakub Kicinski

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

This driver did not previously reject unsupported parameters.

---
 drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c +2 -0
index 68edf55ac906..37fbc646deb9 100644
@@ -1151,6 +1151,8 @@ static int fm10k_set_channels(struct net_device *dev,
 }
 
 static const struct ethtool_ops fm10k_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE,
 	.get_strings		= fm10k_get_strings,
 	.get_sset_count		= fm10k_get_sset_count,
 	.get_ethtool_stats      = fm10k_get_ethtool_stats,
Signature · 1 line
2.24.1
author maintainer
#7 lore raw

PATCH 5/15 net: hns: reject unsupported coalescing params

In reply to Jakub Kicinski

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

This driver did not previously reject unsupported parameters.

---
 drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 5 +++++
 include/linux/ethtool.h                          | 5 +++++
 2 files changed, 10 insertions(+)
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +5 -0
index 717fccc2efba..49624acf2473 100644
@@ -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,
include/linux/ethtool.h +5 -0
index acfce915a02b..be355f37337d 100644
@@ -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 | \
Signature · 1 line
2.24.1
author maintainer
#9 lore raw

PATCH 7/15 net: e1000: reject unsupported coalescing params

In reply to Jakub Kicinski

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

This driver did not previously reject unsupported parameters.

---
 drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/e1000/e1000_ethtool.c +1 -0
index be56e631d693..6f45df5690d4 100644
@@ -1852,6 +1852,7 @@ static void e1000_get_strings(struct net_device *netdev, u32 stringset,
 }
 
 static const struct ethtool_ops e1000_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS,
 	.get_drvinfo		= e1000_get_drvinfo,
 	.get_regs_len		= e1000_get_regs_len,
 	.get_regs		= e1000_get_regs,
Signature · 1 line
2.24.1
author maintainer
#8 lore raw

PATCH 6/15 net: hns3: reject unsupported coalescing params

In reply to Jakub Kicinski

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

This driver did not previously reject unsupported parameters.

---
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +7 -0
index 3f59a1924390..28b81f24afa1 100644
@@ -1390,7 +1390,13 @@ static int hns3_set_fecparam(struct net_device *netdev,
 	return ops->set_fec(handle, fec_mode);
 }
 
+#define HNS3_ETHTOOL_COALESCE	(ETHTOOL_COALESCE_USECS |		\
+				 ETHTOOL_COALESCE_USE_ADAPTIVE |	\
+				 ETHTOOL_COALESCE_RX_USECS_HIGH |	\
+				 ETHTOOL_COALESCE_TX_USECS_HIGH)
+
 static const struct ethtool_ops hns3vf_ethtool_ops = {
+	.supported_coalesce_params = HNS3_ETHTOOL_COALESCE,
 	.get_drvinfo = hns3_get_drvinfo,
 	.get_ringparam = hns3_get_ringparam,
 	.set_ringparam = hns3_set_ringparam,
@@ -1416,6 +1422,7 @@ static const struct ethtool_ops hns3vf_ethtool_ops = {
 };
 
 static const struct ethtool_ops hns3_ethtool_ops = {
+	.supported_coalesce_params = HNS3_ETHTOOL_COALESCE,
 	.self_test = hns3_self_test,
 	.get_drvinfo = hns3_get_drvinfo,
 	.get_link = hns3_get_link,
Signature · 1 line
2.24.1
author maintainer
#4 lore raw

PATCH 3/15 net: fec: reject unsupported coalescing params

In reply to Jakub Kicinski

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

This driver did not previously reject unsupported parameters.

---
 drivers/net/ethernet/freescale/fec_main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/freescale/fec_main.c +2 -0
index af7653e341f2..ce154695f67c 100644
@@ -2641,6 +2641,8 @@ fec_enet_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
 }
 
 static const struct ethtool_ops fec_enet_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES,
 	.get_drvinfo		= fec_enet_get_drvinfo,
 	.get_regs_len		= fec_enet_get_regs_len,
 	.get_regs		= fec_enet_get_regs,
Signature · 1 line
2.24.1
Acked-by on v1 8/15
#11 lore raw

Re: [PATCH net-next 08/15] net: fm10k: reject unsupported coalescing params

In reply to Jakub Kicinski
Quoted 6 lines · Jakub Kicinski

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

This driver did not previously reject unsupported parameters.

Quoted 18 lines
---
 drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c +2 -0
index 68edf55ac906..37fbc646deb9 100644
@@ -1151,6 +1151,8 @@ static int fm10k_set_channels(struct net_device *dev,
 }
 
 static const struct ethtool_ops fm10k_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE,
 	.get_strings		= fm10k_get_strings,
 	.get_sset_count		= fm10k_get_sset_count,
 	.get_ethtool_stats      = fm10k_get_ethtool_stats,
Acked-by on v1 3/15
#5 lore raw

RE: [EXT] [PATCH net-next 03/15] net: fec: reject unsupported coalescing params

In reply to Jakub Kicinski

From: Jakub Kicinski <[email protected]> Sent: Thursday, March 12, 2020 6:33 AM

Quoted 6 lines

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

This driver did not previously reject unsupported parameters.

Quoted 21 lines
---
 drivers/net/ethernet/freescale/fec_main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/freescale/fec_main.c +2 -0
index af7653e341f2..ce154695f67c 100644
@@ -2641,6 +2641,8 @@ fec_enet_set_wol(struct net_device *ndev, struct
 ethtool_wolinfo *wol)  }
 
 static const struct ethtool_ops fec_enet_ethtool_ops = {
+       .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+
 ETHTOOL_COALESCE_MAX_FRAMES,
        .get_drvinfo            = fec_enet_get_drvinfo,
        .get_regs_len           = fec_enet_get_regs_len,

.get_regs = fec_enet_get_regs,
--
2.24.1

Acked-by on v1 2/15
#3 lore raw

RE: [PATCH net-next 02/15] net: dpaa: reject unsupported coalescing params

In reply to Jakub Kicinski
Quoted 7 lines

-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Thursday, March 12, 2020 12:33 AM
To: [email protected]
Subject: [PATCH net-next 02/15] net: dpaa: reject unsupported coalescing params

Quoted 7 lines

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

This driver did not previously reject unsupported parameters (other than adaptive rx, which will now be rejected by core).

Quoted 38 lines
---
 drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c +2 -5
index 6aa1fa22cd04..9db2a02fb531 100644
@@ -525,7 +525,6 @@ static int dpaa_get_coalesce(struct net_device *dev,
 
 	c->rx_coalesce_usecs = period;
 	c->rx_max_coalesced_frames = thresh;
-	c->use_adaptive_rx_coalesce = false;
 
 	return 0;
 }
@@ -540,9 +539,6 @@ static int dpaa_set_coalesce(struct net_device *dev,
 	u8 thresh, prev_thresh;
 	int cpu, res;
 
-	if (c->use_adaptive_rx_coalesce)
-		return -EINVAL;
-
 	period = c->rx_coalesce_usecs;
 	thresh = c->rx_max_coalesced_frames;
 
@@ -582,6 +578,8 @@ static int dpaa_set_coalesce(struct net_device *dev,
 }
 
 const struct ethtool_ops dpaa_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
+				     ETHTOOL_COALESCE_RX_MAX_FRAMES,
 	.get_drvinfo = dpaa_get_drvinfo,
 	.get_msglevel = dpaa_get_msglevel,
 	.set_msglevel = dpaa_set_msglevel,
--

2.24.1

maintainer
#19 lore raw
In reply to Jakub Kicinski

From: Jakub Kicinski <[email protected]>
Date: Wed, 11 Mar 2020 15:32:47 -0700

Quoted 11 lines

Convert more drivers following the groundwork laid in a recent patch set [1] and continued in [2], [3]. The aim of the effort is to consolidate irq coalescing parameter validation in the core.

This set converts 15 drivers in drivers/net/ethernet - remaining Intel drivers, Freescale/NXP, and others.
2 more conversion sets to come.

[1] https://lore.kernel.org/netdev/[email protected]/
[2] https://lore.kernel.org/netdev/[email protected]/
[3] https://lore.kernel.org/netdev/[email protected]/

Series applied, thanks Jakub.