Skip to contentSkip to conversation

ethtool: consolidate irq coalescing - other drivers

PATCH In review Jakub Kicinski 7 participants 14 messages Mar 6, 2020 – Mar 7, 2020

Subsystems (9)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

cover ethtool: consolidate irq coalescing - other drivers

Hi!

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

This set converts all the drivers outside of drivers/net/ethernet.

Only vmxnet3 them was checking unsupported parameters.

The aim is to merge this via the net-next tree so we can convert all drivers and make the checking mandatory.

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

Jakub Kicinski (7):
um: reject unsupported coalescing params
RDMA/ipoib: reject unsupported coalescing params
tun: reject unsupported coalescing params
r8152: reject unsupported coalescing params
vmxnet3: let core reject the unsupported coalescing parameters
staging: qlge: reject unsupported coalescing params
wil6210: reject unsupported coalescing params

 arch/um/drivers/vector_kern.c                |  1 +
 drivers/infiniband/ulp/ipoib/ipoib_ethtool.c |  2 ++
 drivers/net/tun.c                            |  1 +
 drivers/net/usb/r8152.c                      |  1 +
 drivers/net/vmxnet3/vmxnet3_ethtool.c        | 24 +++-----------------
 drivers/net/wireless/ath/wil6210/ethtool.c   |  1 +
 drivers/staging/qlge/qlge_ethtool.c          |  2 ++
 7 files changed, 11 insertions(+), 21 deletions(-)
Signature · 1 line
2.24.1
author maintainer
#1 lore raw

PATCH 1/7 um: 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.

---
 arch/um/drivers/vector_kern.c | 1 +
 1 file changed, 1 insertion(+)
arch/um/drivers/vector_kern.c +1 -0
index 0ff86391f77d..e98304d0219e 100644
@@ -1508,6 +1508,7 @@ static int vector_set_coalesce(struct net_device *netdev,
 }
 
 static const struct ethtool_ops vector_net_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_TX_USECS,
 	.get_drvinfo	= vector_net_get_drvinfo,
 	.get_link	= ethtool_op_get_link,
 	.get_ts_info	= ethtool_op_get_ts_info,
Signature · 7 lines
2.24.1


_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
maintainer Acked-by on v1 1/7
#2 lore raw

Re: [PATCH net-next 1/7] um: reject unsupported coalescing params

Quoted 16 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.

---
  arch/um/drivers/vector_kern.c | 1 +
  1 file changed, 1 insertion(+)
arch/um/drivers/vector_kern.c +0 -0
index 0ff86391f77d..e98304d0219e 100644

arch/um/drivers/vector_kern.c static int vector_set_coalesce(struct net_device *netdev, · line 1514

Quoted 7 lines
arch/um/drivers/vector_kern.c +1 -0
@@ -1508,6 +1508,7 @@ static int vector_set_coalesce(struct net_device *netdev,
  }
 
  static const struct ethtool_ops vector_net_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_TX_USECS,
  	.get_drvinfo	= vector_net_get_drvinfo,
  	.get_link	= ethtool_op_get_link,
  	.get_ts_info	= ethtool_op_get_ts_info,
Signature · 3 lines
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/
author maintainer
#3 lore raw

PATCH 2/7 RDMA/ipoib: 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/infiniband/ulp/ipoib/ipoib_ethtool.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/infiniband/ulp/ipoib/ipoib_ethtool.c +2 -0
index 63e4f9d15fd9..a10a0c2ca2da 100644
@@ -213,6 +213,8 @@ static int ipoib_get_link_ksettings(struct net_device *netdev,
 }
 
 static const struct ethtool_ops ipoib_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
+				     ETHTOOL_COALESCE_RX_MAX_FRAMES,
 	.get_link_ksettings	= ipoib_get_link_ksettings,
 	.get_drvinfo		= ipoib_get_drvinfo,
 	.get_coalesce		= ipoib_get_coalesce,
Signature · 7 lines
2.24.1


_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Reviewed-by on v1 2/7
#4 lore raw

Re: [PATCH net-next 2/7] RDMA/ipoib: reject unsupported coalescing params

Quoted 10 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.

---
 drivers/infiniband/ulp/ipoib/ipoib_ethtool.c | 2 ++
 1 file changed, 2 insertions(+)

Thanks,

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um

author maintainer
#5 lore raw

PATCH 3/7 tun: 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/tun.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/tun.c +1 -0
index 79f248cb282d..9e8f23519e82 100644
@@ -3597,6 +3597,7 @@ static int tun_set_coalesce(struct net_device *dev,
 }
 
 static const struct ethtool_ops tun_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_RX_MAX_FRAMES,
 	.get_drvinfo	= tun_get_drvinfo,
 	.get_msglevel	= tun_get_msglevel,
 	.set_msglevel	= tun_set_msglevel,
Signature · 7 lines
2.24.1


_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Acked-by on v1 3/7
#6 lore raw

Re: [PATCH net-next 3/7] tun: reject unsupported coalescing params

Quoted 15 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.

---
  drivers/net/tun.c | 1 +
  1 file changed, 1 insertion(+)
drivers/net/tun.c +0 -0
index 79f248cb282d..9e8f23519e82 100644

drivers/net/tun.c static int tun_set_coalesce(struct net_device *dev, · line 3603

Quoted 7 lines
drivers/net/tun.c +1 -0
@@ -3597,6 +3597,7 @@ static int tun_set_coalesce(struct net_device *dev,
  }
 
  static const struct ethtool_ops tun_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_RX_MAX_FRAMES,
  	.get_drvinfo	= tun_get_drvinfo,
  	.get_msglevel	= tun_get_msglevel,
  	.set_msglevel	= tun_set_msglevel,
author maintainer
#7 lore raw

PATCH 4/7 r8152: 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/usb/r8152.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/usb/r8152.c +1 -0
index b8d2722a1b33..f27fdd6ab86f 100644
@@ -6345,6 +6345,7 @@ static int rtl8152_set_ringparam(struct net_device *netdev,
 }
 
 static const struct ethtool_ops ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
 	.get_drvinfo = rtl8152_get_drvinfo,
 	.get_link = ethtool_op_get_link,
 	.nway_reset = rtl8152_nway_reset,
Signature · 7 lines
2.24.1


_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Acked-by on v1 4/7
#8 lore raw

RE: [PATCH net-next 4/7] r8152: reject unsupported coalescing params

Jakub Kicinski [mailto:[email protected]]

Quoted 1 line

Sent: Friday, March 06, 2020 9:06 AM

[...]

Quoted 9 lines

Subject: [PATCH net-next 4/7] r8152: 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.

---

Best Regards,
Hayes

author maintainer
#9 lore raw

PATCH 5/7 vmxnet3: 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 correctly rejects all unsupported parameters. As a side effect of these changes the error code for unsupported params changes from EINVAL to EOPNOTSUPP.

---
 drivers/net/vmxnet3/vmxnet3_ethtool.c | 24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethtool.c +3 -21
index 1e4b9ba70983..6528940ce5f3 100644
@@ -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,
Signature · 7 lines
2.24.1


_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
author maintainer
#10 lore raw

PATCH 6/7 staging: qlge: 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/staging/qlge/qlge_ethtool.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/staging/qlge/qlge_ethtool.c +2 -0
index 790997aff995..050c0da23c6f 100644
@@ -714,6 +714,8 @@ static void ql_set_msglevel(struct net_device *ndev, u32 value)
 }
 
 const struct ethtool_ops qlge_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES,
 	.get_drvinfo = ql_get_drvinfo,
 	.get_wol = ql_get_wol,
 	.set_wol = ql_set_wol,
Signature · 7 lines
2.24.1


_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
author maintainer
#11 lore raw

PATCH 7/7 wil6210: 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/wireless/ath/wil6210/ethtool.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/wil6210/ethtool.c +1 -0
index fef10886ca4a..e481674485c2 100644
@@ -95,6 +95,7 @@ static int wil_ethtoolops_set_coalesce(struct net_device *ndev,
 }
 
 static const struct ethtool_ops wil_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
 	.get_drvinfo	= cfg80211_get_drvinfo,
 	.get_coalesce	= wil_ethtoolops_get_coalesce,
 	.set_coalesce	= wil_ethtoolops_set_coalesce,
Signature · 7 lines
2.24.1


_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Acked-by on v1 7/7
#12 lore raw

Re: [PATCH net-next 7/7] wil6210: reject unsupported coalescing params

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.

As this goes to net-next:

Signature · 6 lines
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
maintainer
#13 lore raw
In reply to Jakub Kicinski

From: Jakub Kicinski <[email protected]>
Date: Thu, 5 Mar 2020 17:05:55 -0800

Quoted 4 lines

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

Quoted 8 lines

This set converts all the drivers outside of drivers/net/ethernet.

Only vmxnet3 them was checking unsupported parameters.

The aim is to merge this via the net-next tree so we can convert all drivers and make the checking mandatory.

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

Series applied, thanks Jakub.