Skip to contentSkip to conversation

ethtool: consolidate irq coalescing - part 3

PATCH In review Jakub Kicinski 7 participants 31 messages Mar 10, 2020 – Mar 11, 2020

Subsystems (18)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

cover ethtool: consolidate irq coalescing - part 3

Hi!

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

This set converts 15 drivers in drivers/net/ethernet. 3 more conversion sets to come.

None of the drivers here checked all unsupported parameters.

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

Jakub Kicinski (15):
net: ena: reject unsupported coalescing params
net: aquantia: reject all unsupported coalescing params
net: systemport: reject unsupported coalescing params
net: bnx2: reject unsupported coalescing params
net: bnx2x: reject unsupported coalescing params
net: bcmgenet: reject unsupported coalescing params
net: tg3: reject unsupported coalescing params
net: bna: reject unsupported coalescing params
net: liquidio: reject unsupported coalescing params
net: mlx4: reject unsupported coalescing params
net: cxgb2: reject unsupported coalescing params
net: cxgb3: reject unsupported coalescing params
net: cxgb4: reject unsupported coalescing params
net: cxgb4vf: reject unsupported coalescing params
net: gemini: reject unsupported coalescing params

 drivers/net/ethernet/amazon/ena/ena_ethtool.c     |  2 ++
 .../net/ethernet/aquantia/atlantic/aq_ethtool.c   | 15 +++------------
 drivers/net/ethernet/broadcom/bcmsysport.c        |  6 ++++--
 drivers/net/ethernet/broadcom/bnx2.c              |  5 +++++
 .../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c   |  1 +
 drivers/net/ethernet/broadcom/genet/bcmgenet.c    |  7 +++----
 drivers/net/ethernet/broadcom/tg3.c               |  5 +++++
 drivers/net/ethernet/brocade/bna/bnad_ethtool.c   |  3 +++
 .../net/ethernet/cavium/liquidio/lio_ethtool.c    | 11 +++++++++++
 drivers/net/ethernet/chelsio/cxgb/cxgb2.c         |  3 +++
 drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c   |  1 +
 .../net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c    |  4 ++++
 .../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c   |  2 ++
 drivers/net/ethernet/cortina/gemini.c             |  2 ++
 drivers/net/ethernet/mellanox/mlx4/en_ethtool.c   |  4 ++++
 include/linux/ethtool.h                           |  5 +++++
 16 files changed, 58 insertions(+), 18 deletions(-)
Signature · 1 line
2.24.1
author maintainer
#1 lore raw

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

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

---
 drivers/net/ethernet/amazon/ena/ena_ethtool.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/amazon/ena/ena_ethtool.c +2 -0
index 868265a2ec00..552d4cbf6dbd 100644
@@ -826,6 +826,8 @@ static int ena_set_tunable(struct net_device *netdev,
 }
 
 static const struct ethtool_ops ena_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
 	.get_link_ksettings	= ena_get_link_ksettings,
 	.get_drvinfo		= ena_get_drvinfo,
 	.get_msglevel		= ena_get_msglevel,
Signature · 1 line
2.24.1
maintainer Acked-by Sameeh Jubran on v1 1/15
#2 lore raw

RE: [PATCH net-next 01/15] net: ena: reject unsupported coalescing params

Quoted 45 lines

-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Tuesday, March 10, 2020 4:15 AM
To: [email protected]
Cc: [email protected]; Kiyanovski, Arthur <[email protected]>; Belgazal, Netanel <[email protected]>; Tzalik, Guy <[email protected]>; [email protected]; [email protected]; bcm-kernel-feedback- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jakub Kicinski <[email protected]>
Subject: [EXTERNAL][PATCH net-next 01/15] net: ena: reject unsupported coalescing params

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.

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

---
 drivers/net/ethernet/amazon/ena/ena_ethtool.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/amazon/ena/ena_ethtool.c +2 -1
index 868265a2ec00..552d4cbf6dbd 100644
@@ -826,6 +826,8 @@ static int ena_set_tunable(struct net_device *netdev,  }
 
 static const struct ethtool_ops ena_ethtool_ops = {
+       .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+                                    ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
        .get_link_ksettings     = ena_get_link_ksettings,
        .get_drvinfo            = ena_get_drvinfo,
        .get_msglevel           = ena_get_msglevel,
--
Quoted 1 line

2.24.1

#3 lore raw

Re: [PATCH net-next 01/15] net: ena: reject unsupported coalescing params

Quoted 38 lines · Arthur
Quoted 38 lines

-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Tuesday, March 10, 2020 4:15 AM
To: [email protected]
Cc: [email protected]; Kiyanovski, Arthur <[email protected]>; Belgazal, Netanel <[email protected]>; Tzalik, Guy <[email protected]>; [email protected]; [email protected]; bcm-kernel-feedback- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jakub Kicinski <[email protected]>
Subject: [EXTERNAL][PATCH net-next 01/15] net: ena: reject unsupported coalescing params

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.

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

---
 drivers/net/ethernet/amazon/ena/ena_ethtool.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/amazon/ena/ena_ethtool.c +0 -0
index 868265a2ec00..552d4cbf6dbd 100644
@@ -826,6 +826,8 @@ static int ena_set_tunable(struct net_device *netdev,  }
 
Quoted 11 lines
Quoted 8 lines
drivers/net/ethernet/amazon/ena/ena_ethtool.c +2 -1
 static const struct ethtool_ops ena_ethtool_ops = {
+       .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+                                    ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
        .get_link_ksettings     = ena_get_link_ksettings,
        .get_drvinfo            = ena_get_drvinfo,
        .get_msglevel           = ena_get_msglevel,
--

2.24.1

FROM author of this reply and Acked-by doesn't look the same. Which one is correct?

Thanks

maintainer Acked-by Sameeh Jubran
#4 lore raw

RE: [PATCH net-next 01/15] net: ena: reject unsupported coalescing params

Quoted 80 lines

-----Original Message-----
From: Leon Romanovsky <[email protected]>
Sent: Tuesday, March 10, 2020 8:32 PM
To: Kiyanovski, Arthur <[email protected]>
Cc: Jakub Kicinski <[email protected]>; [email protected]; [email protected]; Belgazal, Netanel <[email protected]>; Tzalik, Guy <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; GR-Linux-NIC- [email protected]; [email protected]; [email protected]; GR-everest- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: RE: [EXTERNAL][PATCH net-next 01/15] net: ena: reject unsupported coalescing params

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.

Quoted 11 lines · Arthur
Quoted 11 lines

-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Tuesday, March 10, 2020 4:15 AM
To: [email protected]
Cc: [email protected]; Kiyanovski, Arthur <[email protected]>; Belgazal, Netanel <[email protected]>; Tzalik, Guy <[email protected]>; [email protected]; [email protected]; bcm-kernel-feedback- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected];

[email protected];

Quoted 29 lines
Quoted 29 lines

[email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jakub Kicinski <[email protected]>
Subject: [EXTERNAL][PATCH net-next 01/15] net: ena: reject unsupported coalescing params

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.

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

---
 drivers/net/ethernet/amazon/ena/ena_ethtool.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/amazon/ena/ena_ethtool.c +0 -0
index 868265a2ec00..552d4cbf6dbd 100644
@@ -826,6 +826,8 @@ static int ena_set_tunable(struct net_device
 *netdev,  }
 
Quoted 12 lines
Quoted 9 lines
drivers/net/ethernet/amazon/ena/ena_ethtool.c +3 -1
 static const struct ethtool_ops ena_ethtool_ops = {
+       .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+
+ ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
        .get_link_ksettings     = ena_get_link_ksettings,
        .get_drvinfo            = ena_get_drvinfo,
        .get_msglevel           = ena_get_msglevel,
--

2.24.1

Quoted 4 lines

FROM author of this reply and Acked-by doesn't look the same. Which one is correct?

Thanks

Sameeh did the check, I sent the email.
So the correct one is the one written in the email:

Sorry for the confusion.

#5 lore raw

Re: [PATCH net-next 01/15] net: ena: reject unsupported coalescing params

Quoted 83 lines · Arthur
Quoted 83 lines

-----Original Message-----
From: Leon Romanovsky <[email protected]>
Sent: Tuesday, March 10, 2020 8:32 PM
To: Kiyanovski, Arthur <[email protected]>
Cc: Jakub Kicinski <[email protected]>; [email protected]; [email protected]; Belgazal, Netanel <[email protected]>; Tzalik, Guy <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; GR-Linux-NIC- [email protected]; [email protected]; [email protected]; GR-everest- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: RE: [EXTERNAL][PATCH net-next 01/15] net: ena: reject unsupported coalescing params

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.

Quoted 11 lines · Arthur
Quoted 11 lines

-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Tuesday, March 10, 2020 4:15 AM
To: [email protected]
Cc: [email protected]; Kiyanovski, Arthur <[email protected]>; Belgazal, Netanel <[email protected]>; Tzalik, Guy <[email protected]>; [email protected]; [email protected]; bcm-kernel-feedback- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected];

[email protected];

Quoted 29 lines
Quoted 29 lines

[email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jakub Kicinski <[email protected]>
Subject: [EXTERNAL][PATCH net-next 01/15] net: ena: reject unsupported coalescing params

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.

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

---
 drivers/net/ethernet/amazon/ena/ena_ethtool.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/amazon/ena/ena_ethtool.c +0 -0
index 868265a2ec00..552d4cbf6dbd 100644
@@ -826,6 +826,8 @@ static int ena_set_tunable(struct net_device
 *netdev,  }
 
Quoted 12 lines
Quoted 9 lines
drivers/net/ethernet/amazon/ena/ena_ethtool.c +3 -1
 static const struct ethtool_ops ena_ethtool_ops = {
+       .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+
+ ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
        .get_link_ksettings     = ena_get_link_ksettings,
        .get_drvinfo            = ena_get_drvinfo,
        .get_msglevel           = ena_get_msglevel,
--

2.24.1

FROM author of this reply and Acked-by doesn't look the same. Which one is correct?

Quoted 7 lines
Quoted 1 line

Thanks

Sameeh did the check, I sent the email.
So the correct one is the one written in the email:

Sorry for the confusion.

It is important that the one who adds "-by" writes the email and uses same name, because get-lore-mbox.py (the new tool that used by many maintainers to grab patches) performs strict check between From and tags to be on the safe side.

Thanks

#6 lore raw

RE: [PATCH net-next 01/15] net: ena: reject unsupported coalescing params

Quoted 118 lines

-----Original Message-----
From: Leon Romanovsky <[email protected]>
Sent: Wednesday, March 11, 2020 8:56 AM
To: Kiyanovski, Arthur <[email protected]>
Cc: Jakub Kicinski <[email protected]>; [email protected]; [email protected]; Belgazal, Netanel <[email protected]>; Tzalik, Guy <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; GR-Linux-NIC- [email protected]; [email protected]; [email protected]; GR-everest- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: RE: [EXTERNAL][PATCH net-next 01/15] net: ena: reject unsupported coalescing params

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.

Quoted 14 lines · Arthur
Quoted 14 lines

-----Original Message-----
From: Leon Romanovsky <[email protected]>
Sent: Tuesday, March 10, 2020 8:32 PM
To: Kiyanovski, Arthur <[email protected]>
Cc: Jakub Kicinski <[email protected]>; [email protected]; [email protected]; Belgazal, Netanel <[email protected]>; Tzalik, Guy <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; GR-Linux-NIC- [email protected]; [email protected]; [email protected]; GR-everest- [email protected]; [email protected]; [email protected]; [email protected]; [email protected];

[email protected];

Quoted 77 lines
Quoted 68 lines

[email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: RE: [EXTERNAL][PATCH net-next 01/15] net: ena: reject unsupported coalescing params

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.

Quoted 4 lines · Arthur
Quoted 4 lines

-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Tuesday, March 10, 2020 4:15 AM
To: [email protected]

Quoted 8 lines
Quoted 8 lines

Cc: [email protected]; Kiyanovski, Arthur <[email protected]>; Belgazal, Netanel <[email protected]>; Tzalik, Guy <[email protected]>; [email protected]; [email protected];
bcm-kernel-feedback- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected];

[email protected];

Quoted 29 lines
Quoted 29 lines

[email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jakub Kicinski <[email protected]>
Subject: [EXTERNAL][PATCH net-next 01/15] net: ena: reject unsupported coalescing params

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.

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

---
 drivers/net/ethernet/amazon/ena/ena_ethtool.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/amazon/ena/ena_ethtool.c +0 -0
index 868265a2ec00..552d4cbf6dbd 100644
@@ -826,6 +826,8 @@ static int ena_set_tunable(struct net_device
 *netdev,  }
 
Quoted 12 lines
Quoted 9 lines
drivers/net/ethernet/amazon/ena/ena_ethtool.c +3 -1
 static const struct ethtool_ops ena_ethtool_ops = {
+       .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+
+ ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
        .get_link_ksettings     = ena_get_link_ksettings,
        .get_drvinfo            = ena_get_drvinfo,
        .get_msglevel           = ena_get_msglevel,
--

2.24.1

Quoted 4 lines

FROM author of this reply and Acked-by doesn't look the same. Which one is correct?

Thanks

Sameeh did the check, I sent the email.
So the correct one is the one written in the email:

Quoted 8 lines
Quoted 1 line

Sorry for the confusion.

It is important that the one who adds "-by" writes the email and uses same name, because get-lore-mbox.py (the new tool that used by many maintainers to grab patches) performs strict check between From and tags to be on the safe side.

Thanks

Got it, thanks!

author maintainer
#7 lore raw

PATCH 2/15 net: aquantia: reject all unsupported coalescing params

In reply to Jakub Kicinski

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

This driver only rejected some of the unsupported parameters.

---
 .../net/ethernet/aquantia/atlantic/aq_ethtool.c   | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c +3 -12
index 0bdaa0d785b7..6781256a318a 100644
@@ -386,21 +386,10 @@ static int aq_ethtool_set_coalesce(struct net_device *ndev,
 
 	cfg = aq_nic_get_cfg(aq_nic);
 
-	/* This is not yet supported
-	 */
-	if (coal->use_adaptive_rx_coalesce || coal->use_adaptive_tx_coalesce)
-		return -EOPNOTSUPP;
-
 	/* Atlantic only supports timing based coalescing
 	 */
 	if (coal->rx_max_coalesced_frames > 1 ||
-	    coal->rx_coalesce_usecs_irq ||
-	    coal->rx_max_coalesced_frames_irq)
-		return -EOPNOTSUPP;
-
-	if (coal->tx_max_coalesced_frames > 1 ||
-	    coal->tx_coalesce_usecs_irq ||
-	    coal->tx_max_coalesced_frames_irq)
+	    coal->tx_max_coalesced_frames > 1)
 		return -EOPNOTSUPP;
 
 	/* We do not support frame counting. Check this
@@ -742,6 +731,8 @@ static int aq_ethtool_set_priv_flags(struct net_device *ndev, u32 flags)
 }
 
 const struct ethtool_ops aq_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES,
 	.get_link            = aq_ethtool_get_link,
 	.get_regs_len        = aq_ethtool_get_regs_len,
 	.get_regs            = aq_ethtool_get_regs,
Signature · 1 line
2.24.1
author maintainer
#8 lore raw

PATCH 3/15 net: systemport: 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 most of unsupported parameters.

---
 drivers/net/ethernet/broadcom/bcmsysport.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bcmsysport.c +4 -2
index a2cf2ed8d278..bea2dbc0e469 100644
@@ -623,8 +623,7 @@ static int bcm_sysport_set_coalesce(struct net_device *dev,
 		return -EINVAL;
 
 	if ((ec->tx_coalesce_usecs == 0 && ec->tx_max_coalesced_frames == 0) ||
-	    (ec->rx_coalesce_usecs == 0 && ec->rx_max_coalesced_frames == 0) ||
-	    ec->use_adaptive_tx_coalesce)
+	    (ec->rx_coalesce_usecs == 0 && ec->rx_max_coalesced_frames == 0))
 		return -EINVAL;
 
 	for (i = 0; i < dev->num_tx_queues; i++)
@@ -2209,6 +2208,9 @@ static int bcm_sysport_set_rxnfc(struct net_device *dev,
 }
 
 static const struct ethtool_ops bcm_sysport_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
 	.get_drvinfo		= bcm_sysport_get_drvinfo,
 	.get_msglevel		= bcm_sysport_get_msglvl,
 	.set_msglevel		= bcm_sysport_set_msglvl,
Signature · 1 line
2.24.1
Acked-by on v1 3/15
#10 lore raw

Re: [PATCH net-next 03/15] net: systemport: reject unsupported coalescing params

In reply to Jakub Kicinski
Quoted 7 lines · Jakub Kicinski

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

This driver did not previously reject most of unsupported parameters.

Signature · 1 line
Florian
author maintainer
#11 lore raw

PATCH 4/15 net: bnx2: 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/broadcom/bnx2.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/broadcom/bnx2.c +5 -0
index 62e44f52580d..e1c236cab2a7 100644
@@ -7812,6 +7812,11 @@ static int bnx2_set_channels(struct net_device *dev,
 }
 
 static const struct ethtool_ops bnx2_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES |
+				     ETHTOOL_COALESCE_USECS_IRQ |
+				     ETHTOOL_COALESCE_MAX_FRAMES_IRQ |
+				     ETHTOOL_COALESCE_STATS_BLOCK_USECS,
 	.get_drvinfo		= bnx2_get_drvinfo,
 	.get_regs_len		= bnx2_get_regs_len,
 	.get_regs		= bnx2_get_regs,
Signature · 1 line
2.24.1
maintainer Reviewed-by on v1 4/15
#12 lore raw

Re: [PATCH net-next 04/15] net: bnx2: reject unsupported coalescing params

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

Thanks.

author maintainer
#13 lore raw

PATCH 5/15 net: bnx2x: 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/broadcom/bnx2x/bnx2x_ethtool.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +1 -0
index 5ccab7bb9686..7cea33803f7f 100644
@@ -3656,6 +3656,7 @@ static int bnx2x_get_ts_info(struct net_device *dev,
 }
 
 static const struct ethtool_ops bnx2x_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
 	.get_drvinfo		= bnx2x_get_drvinfo,
 	.get_regs_len		= bnx2x_get_regs_len,
 	.get_regs		= bnx2x_get_regs,
Signature · 1 line
2.24.1
author maintainer
#14 lore raw

PATCH 6/15 net: bcmgenet: 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 all unsupported parameters.

---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +3 -4
index c2fda12cf773..c476f13d0eaf 100644
@@ -686,10 +686,6 @@ static int bcmgenet_set_coalesce(struct net_device *dev,
 	 * always generate an interrupt either after MBDONE packets have been
 	 * transmitted, or when the ring is empty.
 	 */
-	if (ec->tx_coalesce_usecs || ec->tx_coalesce_usecs_high ||
-	    ec->tx_coalesce_usecs_irq || ec->tx_coalesce_usecs_low ||
-	    ec->use_adaptive_tx_coalesce)
-		return -EOPNOTSUPP;
 
 	/* Program all TX queues with the same values, as there is no
 	 * ethtool knob to do coalescing on a per-queue basis
@@ -1113,6 +1109,9 @@ static int bcmgenet_set_eee(struct net_device *dev, struct ethtool_eee *e)
 
 /* standard ethtool support functions. */
 static const struct ethtool_ops bcmgenet_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
 	.begin			= bcmgenet_begin,
 	.complete		= bcmgenet_complete,
 	.get_strings		= bcmgenet_get_strings,
Signature · 1 line
2.24.1
author maintainer
#16 lore raw

PATCH 7/15 net: tg3: 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/broadcom/tg3.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/broadcom/tg3.c +5 -0
index 16c1c9f150f1..ff98a82b7bc4 100644
@@ -14153,6 +14153,11 @@ static int tg3_get_eee(struct net_device *dev, struct ethtool_eee *edata)
 }
 
 static const struct ethtool_ops tg3_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES |
+				     ETHTOOL_COALESCE_USECS_IRQ |
+				     ETHTOOL_COALESCE_MAX_FRAMES_IRQ |
+				     ETHTOOL_COALESCE_STATS_BLOCK_USECS,
 	.get_drvinfo		= tg3_get_drvinfo,
 	.get_regs_len		= tg3_get_regs_len,
 	.get_regs		= tg3_get_regs,
Signature · 1 line
2.24.1
maintainer Reviewed-by on v1 7/15
#17 lore raw

Re: [PATCH net-next 07/15] net: tg3: reject unsupported coalescing params

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

Thanks.

author maintainer
#18 lore raw

PATCH 8/15 net: bna: 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/brocade/bna/bnad_ethtool.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/brocade/bna/bnad_ethtool.c +3 -0
index 505e9c6d74a6..588c4804d10a 100644
@@ -1115,6 +1115,9 @@ bnad_flash_device(struct net_device *netdev, struct ethtool_flash *eflash)
 }
 
 static const struct ethtool_ops bnad_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_TX_MAX_FRAMES |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
 	.get_drvinfo = bnad_get_drvinfo,
 	.get_wol = bnad_get_wol,
 	.get_link = ethtool_op_get_link,
Signature · 1 line
2.24.1
author maintainer
#19 lore raw

PATCH 9/15 net: liquidio: 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/cavium/liquidio/lio_ethtool.c | 11 +++++++++++
 include/linux/ethtool.h                            |  5 +++++
 2 files changed, 16 insertions(+)
drivers/net/ethernet/cavium/liquidio/lio_ethtool.c +11 -0
index 2b27e3aad9db..16eebfc52109 100644
@@ -3097,7 +3097,17 @@ static int lio_set_fecparam(struct net_device *netdev,
 	return 0;
 }
 
+#define LIO_ETHTOOL_COALESCE	(ETHTOOL_COALESCE_RX_USECS |		\
+				 ETHTOOL_COALESCE_MAX_FRAMES |		\
+				 ETHTOOL_COALESCE_USE_ADAPTIVE |	\
+				 ETHTOOL_COALESCE_RX_MAX_FRAMES_LOW |	\
+				 ETHTOOL_COALESCE_TX_MAX_FRAMES_LOW |	\
+				 ETHTOOL_COALESCE_RX_MAX_FRAMES_HIGH |	\
+				 ETHTOOL_COALESCE_TX_MAX_FRAMES_HIGH |	\
+				 ETHTOOL_COALESCE_PKT_RATE_RX_USECS)
+
 static const struct ethtool_ops lio_ethtool_ops = {
+	.supported_coalesce_params = LIO_ETHTOOL_COALESCE,
 	.get_link_ksettings	= lio_get_link_ksettings,
 	.set_link_ksettings	= lio_set_link_ksettings,
 	.get_fecparam		= lio_get_fecparam,
@@ -3128,6 +3138,7 @@ static const struct ethtool_ops lio_ethtool_ops = {
 };
 
 static const struct ethtool_ops lio_vf_ethtool_ops = {
+	.supported_coalesce_params = LIO_ETHTOOL_COALESCE,
 	.get_link_ksettings	= lio_get_link_ksettings,
 	.get_link		= ethtool_op_get_link,
 	.get_drvinfo		= lio_get_vf_drvinfo,
include/linux/ethtool.h +5 -0
index e464c946bca4..9efeebde3514 100644
@@ -211,6 +211,11 @@ 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_PKT_RATE_RX_USECS				\
+	(ETHTOOL_COALESCE_USE_ADAPTIVE_RX |				\
+	 ETHTOOL_COALESCE_RX_USECS_LOW | ETHTOOL_COALESCE_RX_USECS_HIGH | \
+	 ETHTOOL_COALESCE_PKT_RATE_LOW | ETHTOOL_COALESCE_PKT_RATE_HIGH | \
+	 ETHTOOL_COALESCE_RATE_SAMPLE_INTERVAL)
 
 /**
  * struct ethtool_ops - optional netdev operations
Signature · 1 line
2.24.1
author maintainer
#20 lore raw

PATCH 10/15 net: mlx4: 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/mellanox/mlx4/en_ethtool.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +4 -0
index 8bf1f08fdee2..8a5ea2543670 100644
@@ -2121,6 +2121,10 @@ static int mlx4_en_set_phys_id(struct net_device *dev,
 }
 
 const struct ethtool_ops mlx4_en_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES |
+				     ETHTOOL_COALESCE_TX_MAX_FRAMES_IRQ |
+				     ETHTOOL_COALESCE_PKT_RATE_RX_USECS,
 	.get_drvinfo = mlx4_en_get_drvinfo,
 	.get_link_ksettings = mlx4_en_get_link_ksettings,
 	.set_link_ksettings = mlx4_en_set_link_ksettings,
Signature · 1 line
2.24.1
#21 lore raw

Re: [PATCH net-next 10/15] net: mlx4: 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/ethernet/mellanox/mlx4/en_ethtool.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +0 -0
index 8bf1f08fdee2..8a5ea2543670 100644

drivers/net/ethernet/mellanox/mlx4/en_ethtool.c static int mlx4_en_set_phys_id(struct net_device *dev, · line 2127

Quoted 7 lines
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +4 -0
@@ -2121,6 +2121,10 @@ static int mlx4_en_set_phys_id(struct net_device *dev,
  }
 
  const struct ethtool_ops mlx4_en_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES |
+				     ETHTOOL_COALESCE_TX_MAX_FRAMES_IRQ |
+				     ETHTOOL_COALESCE_PKT_RATE_RX_USECS,

Hi Jakub,

We support several more params:

ETHTOOL_COALESCE_RX_USECS_LOW
ETHTOOL_COALESCE_RX_USECS_HIGH
ETHTOOL_COALESCE_RATE_SAMPLE_INTERVAL
ETHTOOL_COALESCE_PKT_RATE_LOW
ETHTOOL_COALESCE_PKT_RATE_HIGH
ETHTOOL_COALESCE_USE_ADAPTIVE_RX
ETHTOOL_COALESCE_TX_MAX_FRAMES_LOW
ETHTOOL_COALESCE_TX_USECS

Quoted 4 lines
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +0 -0
  	.get_drvinfo = mlx4_en_get_drvinfo,
  	.get_link_ksettings = mlx4_en_get_link_ksettings,
  	.set_link_ksettings = mlx4_en_set_link_ksettings,
author maintainer
#22 lore raw

Re: [PATCH net-next 10/15] net: mlx4: reject unsupported coalescing params

Quoted 27 lines · On Tue, 10 Mar 2020 16:11:16 +0200 Tariq Toukan wrote:
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/ethernet/mellanox/mlx4/en_ethtool.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +0 -0
index 8bf1f08fdee2..8a5ea2543670 100644

drivers/net/ethernet/mellanox/mlx4/en_ethtool.c static int mlx4_en_set_phys_id(struct net_device *dev, · line 2127

Quoted 7 lines
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +4 -0
@@ -2121,6 +2121,10 @@ static int mlx4_en_set_phys_id(struct net_device *dev,
  }
 
  const struct ethtool_ops mlx4_en_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES |
+				     ETHTOOL_COALESCE_TX_MAX_FRAMES_IRQ |
+				     ETHTOOL_COALESCE_PKT_RATE_RX_USECS,  

Hi Jakub,

We support several more params:

Quoted 8 lines

ETHTOOL_COALESCE_RX_USECS_LOW
ETHTOOL_COALESCE_RX_USECS_HIGH
ETHTOOL_COALESCE_RATE_SAMPLE_INTERVAL
ETHTOOL_COALESCE_PKT_RATE_LOW
ETHTOOL_COALESCE_PKT_RATE_HIGH
ETHTOOL_COALESCE_USE_ADAPTIVE_RX
ETHTOOL_COALESCE_TX_MAX_FRAMES_LOW
ETHTOOL_COALESCE_TX_USECS

Most of these defines are groups, actually. Here's what they should cover:

ETHTOOL_COALESCE_USECS
rx_coalesce_usecs
tx_coalesce_usecs

ETHTOOL_COALESCE_MAX_FRAMES
rx_max_coalesced_frames
tx_max_coalesced_frames

ETHTOOL_COALESCE_TX_MAX_FRAMES_IRQ
tx_max_coalesced_frames_irq

ETHTOOL_COALESCE_PKT_RATE_RX_USECS
use_adaptive_rx_coalesce
rx_coalesce_usecs_low
rx_coalesce_usecs_high
pkt_rate_low
pkt_rate_high
rate_sample_interval

So AFAICS all is covered.

I was wondering if I should name the groups somewhat differently to make it clear?

Quoted 4 lines
Quoted 4 lines
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +0 -0
  	.get_drvinfo = mlx4_en_get_drvinfo,
  	.get_link_ksettings = mlx4_en_get_link_ksettings,
  	.set_link_ksettings = mlx4_en_set_link_ksettings,
author maintainer
#23 lore raw

PATCH 11/15 net: cxgb2: 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/chelsio/cxgb/cxgb2.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/chelsio/cxgb/cxgb2.c +3 -0
index 4b8461103dda..99736796e1a0 100644
@@ -793,6 +793,9 @@ static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e,
 }
 
 static const struct ethtool_ops t1_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE_RX |
+				     ETHTOOL_COALESCE_RATE_SAMPLE_INTERVAL,
 	.get_drvinfo       = get_drvinfo,
 	.get_msglevel      = get_msglevel,
 	.set_msglevel      = set_msglevel,
Signature · 1 line
2.24.1
author maintainer
#24 lore raw

PATCH 12/15 net: cxgb3: 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/chelsio/cxgb3/cxgb3_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +1 -0
index ba3631f8cfe8..42c6e9379882 100644
@@ -2104,6 +2104,7 @@ static void get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 }
 
 static const struct ethtool_ops cxgb_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS,
 	.get_drvinfo = get_drvinfo,
 	.get_msglevel = get_msglevel,
 	.set_msglevel = set_msglevel,
Signature · 1 line
2.24.1
author maintainer
#25 lore raw

PATCH 13/15 net: cxgb4: 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/chelsio/cxgb4/cxgb4_ethtool.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c +4 -0
index 2cf35696b1c4..398ade42476c 100644
@@ -1576,6 +1576,10 @@ static int cxgb4_set_priv_flags(struct net_device *netdev, u32 flags)
 }
 
 static const struct ethtool_ops cxgb_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+				     ETHTOOL_COALESCE_RX_MAX_FRAMES |
+				     ETHTOOL_COALESCE_TX_USECS_IRQ |
+				     ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
 	.get_link_ksettings = get_link_ksettings,
 	.set_link_ksettings = set_link_ksettings,
 	.get_fecparam      = get_fecparam,
Signature · 1 line
2.24.1
author maintainer
#26 lore raw

PATCH 14/15 net: cxgb4vf: 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/chelsio/cxgb4vf/cxgb4vf_main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +2 -0
index f4558be0ff05..9cc3541a7e1c 100644
@@ -1919,6 +1919,8 @@ static void cxgb4vf_get_wol(struct net_device *dev,
 		   NETIF_F_GRO | NETIF_F_IPV6_CSUM | NETIF_F_HIGHDMA)
 
 static const struct ethtool_ops cxgb4vf_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
+				     ETHTOOL_COALESCE_RX_MAX_FRAMES,
 	.get_link_ksettings	= cxgb4vf_get_link_ksettings,
 	.get_fecparam		= cxgb4vf_get_fecparam,
 	.get_drvinfo		= cxgb4vf_get_drvinfo,
Signature · 1 line
2.24.1
author maintainer
#27 lore raw

PATCH 15/15 net: gemini: 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/cortina/gemini.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/cortina/gemini.c +2 -0
index dc2a4adab793..5bff5c2be88b 100644
@@ -2222,6 +2222,8 @@ static const struct net_device_ops gmac_351x_ops = {
 };
 
 static const struct ethtool_ops gmac_351x_ethtool_ops = {
+	.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
+				     ETHTOOL_COALESCE_MAX_FRAMES,
 	.get_sset_count	= gmac_get_sset_count,
 	.get_strings	= gmac_get_strings,
 	.get_ethtool_stats = gmac_get_ethtool_stats,
Signature · 1 line
2.24.1
maintainer
#28 lore raw
In reply to Jakub Kicinski

From: Jakub Kicinski <[email protected]>
Date: Mon, 9 Mar 2020 19:14:57 -0700

Quoted 11 lines

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

This set converts 15 drivers in drivers/net/ethernet. 3 more conversion sets to come.

None of the drivers here checked all unsupported parameters.

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

I'll let this sit for a day for review(s).

author maintainer
#29 lore raw
Quoted 10 lines · On Mon, 09 Mar 2020 19:43:13 -0700 (PDT) David Miller wrote:

From: Jakub Kicinski <[email protected]>
Date: Mon, 9 Mar 2020 19:14:57 -0700

Quoted 7 lines

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

This set converts 15 drivers in drivers/net/ethernet. 3 more conversion sets to come.

Quoted 6 lines
Quoted 4 lines

None of the drivers here checked all unsupported parameters.

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

I'll let this sit for a day for review(s).

Makes sense, this is partially manual work, good to have it double checked by folks.

maintainer
#30 lore raw
In reply to Jakub Kicinski

From: Jakub Kicinski <[email protected]>
Date: Mon, 9 Mar 2020 19:14:57 -0700

Quoted 11 lines

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

This set converts 15 drivers in drivers/net/ethernet. 3 more conversion sets to come.

None of the drivers here checked all unsupported parameters.

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

Series applied, thank you.