Skip to content

Commit 96ee187

Browse files
committed
Merge branch 'ethtool-consolidate-irq-coalescing-part-3'
Jakub Kicinski says: ==================== ethtool: consolidate irq coalescing - part 3 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]/ ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 314a9cb + d13f116 commit 96ee187

File tree

16 files changed

+58
-18
lines changed

16 files changed

+58
-18
lines changed

drivers/net/ethernet/amazon/ena/ena_ethtool.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,8 @@ static int ena_set_tunable(struct net_device *netdev,
826826
}
827827

828828
static const struct ethtool_ops ena_ethtool_ops = {
829+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
830+
ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
829831
.get_link_ksettings = ena_get_link_ksettings,
830832
.get_drvinfo = ena_get_drvinfo,
831833
.get_msglevel = ena_get_msglevel,

drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -386,21 +386,10 @@ static int aq_ethtool_set_coalesce(struct net_device *ndev,
386386

387387
cfg = aq_nic_get_cfg(aq_nic);
388388

389-
/* This is not yet supported
390-
*/
391-
if (coal->use_adaptive_rx_coalesce || coal->use_adaptive_tx_coalesce)
392-
return -EOPNOTSUPP;
393-
394389
/* Atlantic only supports timing based coalescing
395390
*/
396391
if (coal->rx_max_coalesced_frames > 1 ||
397-
coal->rx_coalesce_usecs_irq ||
398-
coal->rx_max_coalesced_frames_irq)
399-
return -EOPNOTSUPP;
400-
401-
if (coal->tx_max_coalesced_frames > 1 ||
402-
coal->tx_coalesce_usecs_irq ||
403-
coal->tx_max_coalesced_frames_irq)
392+
coal->tx_max_coalesced_frames > 1)
404393
return -EOPNOTSUPP;
405394

406395
/* 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)
742731
}
743732

744733
const struct ethtool_ops aq_ethtool_ops = {
734+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
735+
ETHTOOL_COALESCE_MAX_FRAMES,
745736
.get_link = aq_ethtool_get_link,
746737
.get_regs_len = aq_ethtool_get_regs_len,
747738
.get_regs = aq_ethtool_get_regs,

drivers/net/ethernet/broadcom/bcmsysport.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,7 @@ static int bcm_sysport_set_coalesce(struct net_device *dev,
623623
return -EINVAL;
624624

625625
if ((ec->tx_coalesce_usecs == 0 && ec->tx_max_coalesced_frames == 0) ||
626-
(ec->rx_coalesce_usecs == 0 && ec->rx_max_coalesced_frames == 0) ||
627-
ec->use_adaptive_tx_coalesce)
626+
(ec->rx_coalesce_usecs == 0 && ec->rx_max_coalesced_frames == 0))
628627
return -EINVAL;
629628

630629
for (i = 0; i < dev->num_tx_queues; i++)
@@ -2209,6 +2208,9 @@ static int bcm_sysport_set_rxnfc(struct net_device *dev,
22092208
}
22102209

22112210
static const struct ethtool_ops bcm_sysport_ethtool_ops = {
2211+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
2212+
ETHTOOL_COALESCE_MAX_FRAMES |
2213+
ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
22122214
.get_drvinfo = bcm_sysport_get_drvinfo,
22132215
.get_msglevel = bcm_sysport_get_msglvl,
22142216
.set_msglevel = bcm_sysport_set_msglvl,

drivers/net/ethernet/broadcom/bnx2.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7812,6 +7812,11 @@ static int bnx2_set_channels(struct net_device *dev,
78127812
}
78137813

78147814
static const struct ethtool_ops bnx2_ethtool_ops = {
7815+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
7816+
ETHTOOL_COALESCE_MAX_FRAMES |
7817+
ETHTOOL_COALESCE_USECS_IRQ |
7818+
ETHTOOL_COALESCE_MAX_FRAMES_IRQ |
7819+
ETHTOOL_COALESCE_STATS_BLOCK_USECS,
78157820
.get_drvinfo = bnx2_get_drvinfo,
78167821
.get_regs_len = bnx2_get_regs_len,
78177822
.get_regs = bnx2_get_regs,

drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3656,6 +3656,7 @@ static int bnx2x_get_ts_info(struct net_device *dev,
36563656
}
36573657

36583658
static const struct ethtool_ops bnx2x_ethtool_ops = {
3659+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
36593660
.get_drvinfo = bnx2x_get_drvinfo,
36603661
.get_regs_len = bnx2x_get_regs_len,
36613662
.get_regs = bnx2x_get_regs,

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,10 +686,6 @@ static int bcmgenet_set_coalesce(struct net_device *dev,
686686
* always generate an interrupt either after MBDONE packets have been
687687
* transmitted, or when the ring is empty.
688688
*/
689-
if (ec->tx_coalesce_usecs || ec->tx_coalesce_usecs_high ||
690-
ec->tx_coalesce_usecs_irq || ec->tx_coalesce_usecs_low ||
691-
ec->use_adaptive_tx_coalesce)
692-
return -EOPNOTSUPP;
693689

694690
/* Program all TX queues with the same values, as there is no
695691
* 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)
11131109

11141110
/* standard ethtool support functions. */
11151111
static const struct ethtool_ops bcmgenet_ethtool_ops = {
1112+
.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
1113+
ETHTOOL_COALESCE_MAX_FRAMES |
1114+
ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
11161115
.begin = bcmgenet_begin,
11171116
.complete = bcmgenet_complete,
11181117
.get_strings = bcmgenet_get_strings,

drivers/net/ethernet/broadcom/tg3.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14153,6 +14153,11 @@ static int tg3_get_eee(struct net_device *dev, struct ethtool_eee *edata)
1415314153
}
1415414154

1415514155
static const struct ethtool_ops tg3_ethtool_ops = {
14156+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
14157+
ETHTOOL_COALESCE_MAX_FRAMES |
14158+
ETHTOOL_COALESCE_USECS_IRQ |
14159+
ETHTOOL_COALESCE_MAX_FRAMES_IRQ |
14160+
ETHTOOL_COALESCE_STATS_BLOCK_USECS,
1415614161
.get_drvinfo = tg3_get_drvinfo,
1415714162
.get_regs_len = tg3_get_regs_len,
1415814163
.get_regs = tg3_get_regs,

drivers/net/ethernet/brocade/bna/bnad_ethtool.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,9 @@ bnad_flash_device(struct net_device *netdev, struct ethtool_flash *eflash)
11151115
}
11161116

11171117
static const struct ethtool_ops bnad_ethtool_ops = {
1118+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
1119+
ETHTOOL_COALESCE_TX_MAX_FRAMES |
1120+
ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
11181121
.get_drvinfo = bnad_get_drvinfo,
11191122
.get_wol = bnad_get_wol,
11201123
.get_link = ethtool_op_get_link,

drivers/net/ethernet/cavium/liquidio/lio_ethtool.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3097,7 +3097,17 @@ static int lio_set_fecparam(struct net_device *netdev,
30973097
return 0;
30983098
}
30993099

3100+
#define LIO_ETHTOOL_COALESCE (ETHTOOL_COALESCE_RX_USECS | \
3101+
ETHTOOL_COALESCE_MAX_FRAMES | \
3102+
ETHTOOL_COALESCE_USE_ADAPTIVE | \
3103+
ETHTOOL_COALESCE_RX_MAX_FRAMES_LOW | \
3104+
ETHTOOL_COALESCE_TX_MAX_FRAMES_LOW | \
3105+
ETHTOOL_COALESCE_RX_MAX_FRAMES_HIGH | \
3106+
ETHTOOL_COALESCE_TX_MAX_FRAMES_HIGH | \
3107+
ETHTOOL_COALESCE_PKT_RATE_RX_USECS)
3108+
31003109
static const struct ethtool_ops lio_ethtool_ops = {
3110+
.supported_coalesce_params = LIO_ETHTOOL_COALESCE,
31013111
.get_link_ksettings = lio_get_link_ksettings,
31023112
.set_link_ksettings = lio_set_link_ksettings,
31033113
.get_fecparam = lio_get_fecparam,
@@ -3128,6 +3138,7 @@ static const struct ethtool_ops lio_ethtool_ops = {
31283138
};
31293139

31303140
static const struct ethtool_ops lio_vf_ethtool_ops = {
3141+
.supported_coalesce_params = LIO_ETHTOOL_COALESCE,
31313142
.get_link_ksettings = lio_get_link_ksettings,
31323143
.get_link = ethtool_op_get_link,
31333144
.get_drvinfo = lio_get_vf_drvinfo,

drivers/net/ethernet/chelsio/cxgb/cxgb2.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,9 @@ static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e,
793793
}
794794

795795
static const struct ethtool_ops t1_ethtool_ops = {
796+
.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
797+
ETHTOOL_COALESCE_USE_ADAPTIVE_RX |
798+
ETHTOOL_COALESCE_RATE_SAMPLE_INTERVAL,
796799
.get_drvinfo = get_drvinfo,
797800
.get_msglevel = get_msglevel,
798801
.set_msglevel = set_msglevel,

0 commit comments

Comments
 (0)