Skip to content

Commit b8323de

Browse files
committed
Merge branch 'ethtool-consolidate-irq-coalescing-part-5'
Jakub Kicinski says: ==================== ethtool: consolidate irq coalescing - part 5 Convert more drivers following the groundwork laid in a recent patch set [1] and continued in [2], [3], [4]. The aim of the effort is to consolidate irq coalescing parameter validation in the core. This set converts further 15 drivers in drivers/net/ethernet. One 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]/ [4] https://lore.kernel.org/netdev/[email protected]/ ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 0c90775 + 5b71256 commit b8323de

File tree

15 files changed

+32
-68
lines changed

15 files changed

+32
-68
lines changed

drivers/net/ethernet/jme.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2839,6 +2839,9 @@ jme_set_eeprom(struct net_device *netdev,
28392839
}
28402840

28412841
static const struct ethtool_ops jme_ethtool_ops = {
2842+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
2843+
ETHTOOL_COALESCE_MAX_FRAMES |
2844+
ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
28422845
.get_drvinfo = jme_get_drvinfo,
28432846
.get_regs_len = jme_get_regs_len,
28442847
.get_regs = jme_get_regs,

drivers/net/ethernet/marvell/mv643xx_eth.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,7 @@ static int mv643xx_eth_get_sset_count(struct net_device *dev, int sset)
17371737
}
17381738

17391739
static const struct ethtool_ops mv643xx_eth_ethtool_ops = {
1740+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
17401741
.get_drvinfo = mv643xx_eth_get_drvinfo,
17411742
.nway_reset = phy_ethtool_nway_reset,
17421743
.get_link = ethtool_op_get_link,

drivers/net/ethernet/marvell/mvneta.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4838,6 +4838,8 @@ static const struct net_device_ops mvneta_netdev_ops = {
48384838
};
48394839

48404840
static const struct ethtool_ops mvneta_eth_tool_ops = {
4841+
.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
4842+
ETHTOOL_COALESCE_MAX_FRAMES,
48414843
.nway_reset = mvneta_ethtool_nway_reset,
48424844
.get_link = ethtool_op_get_link,
48434845
.set_coalesce = mvneta_ethtool_set_coalesce,

drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4384,6 +4384,8 @@ static const struct net_device_ops mvpp2_netdev_ops = {
43844384
};
43854385

43864386
static const struct ethtool_ops mvpp2_eth_tool_ops = {
4387+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
4388+
ETHTOOL_COALESCE_MAX_FRAMES,
43874389
.nway_reset = mvpp2_ethtool_nway_reset,
43884390
.get_link = ethtool_op_get_link,
43894391
.set_coalesce = mvpp2_ethtool_set_coalesce,

drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -368,17 +368,6 @@ static int otx2_set_coalesce(struct net_device *netdev,
368368
struct otx2_hw *hw = &pfvf->hw;
369369
int qidx;
370370

371-
if (ec->use_adaptive_rx_coalesce || ec->use_adaptive_tx_coalesce ||
372-
ec->rx_coalesce_usecs_irq || ec->rx_max_coalesced_frames_irq ||
373-
ec->tx_coalesce_usecs_irq || ec->tx_max_coalesced_frames_irq ||
374-
ec->stats_block_coalesce_usecs || ec->pkt_rate_low ||
375-
ec->rx_coalesce_usecs_low || ec->rx_max_coalesced_frames_low ||
376-
ec->tx_coalesce_usecs_low || ec->tx_max_coalesced_frames_low ||
377-
ec->pkt_rate_high || ec->rx_coalesce_usecs_high ||
378-
ec->rx_max_coalesced_frames_high || ec->tx_coalesce_usecs_high ||
379-
ec->tx_max_coalesced_frames_high || ec->rate_sample_interval)
380-
return -EOPNOTSUPP;
381-
382371
if (!ec->rx_max_coalesced_frames || !ec->tx_max_coalesced_frames)
383372
return 0;
384373

@@ -674,6 +663,8 @@ static u32 otx2_get_link(struct net_device *netdev)
674663
}
675664

676665
static const struct ethtool_ops otx2_ethtool_ops = {
666+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
667+
ETHTOOL_COALESCE_MAX_FRAMES,
677668
.get_link = otx2_get_link,
678669
.get_drvinfo = otx2_get_drvinfo,
679670
.get_strings = otx2_get_strings,

drivers/net/ethernet/marvell/skge.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,7 @@ static int skge_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom
876876
}
877877

878878
static const struct ethtool_ops skge_ethtool_ops = {
879+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
879880
.get_drvinfo = skge_get_drvinfo,
880881
.get_regs_len = skge_get_regs_len,
881882
.get_regs = skge_get_regs,

drivers/net/ethernet/marvell/sky2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4400,6 +4400,10 @@ static int sky2_set_features(struct net_device *dev, netdev_features_t features)
44004400
}
44014401

44024402
static const struct ethtool_ops sky2_ethtool_ops = {
4403+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
4404+
ETHTOOL_COALESCE_MAX_FRAMES |
4405+
ETHTOOL_COALESCE_RX_USECS_IRQ |
4406+
ETHTOOL_COALESCE_RX_MAX_FRAMES_IRQ,
44034407
.get_drvinfo = sky2_get_drvinfo,
44044408
.get_wol = sky2_get_wol,
44054409
.set_wol = sky2_set_wol,

drivers/net/ethernet/myricom/myri10ge/myri10ge.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,7 @@ myri10ge_phys_id(struct net_device *netdev, enum ethtool_phys_id_state state)
19201920
}
19211921

19221922
static const struct ethtool_ops myri10ge_ethtool_ops = {
1923+
.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS,
19231924
.get_drvinfo = myri10ge_get_drvinfo,
19241925
.get_coalesce = myri10ge_get_coalesce,
19251926
.set_coalesce = myri10ge_set_coalesce,

drivers/net/ethernet/ni/nixge.c

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,27 +1019,6 @@ static int nixge_ethtools_set_coalesce(struct net_device *ndev,
10191019
return -EBUSY;
10201020
}
10211021

1022-
if (ecoalesce->rx_coalesce_usecs ||
1023-
ecoalesce->rx_coalesce_usecs_irq ||
1024-
ecoalesce->rx_max_coalesced_frames_irq ||
1025-
ecoalesce->tx_coalesce_usecs ||
1026-
ecoalesce->tx_coalesce_usecs_irq ||
1027-
ecoalesce->tx_max_coalesced_frames_irq ||
1028-
ecoalesce->stats_block_coalesce_usecs ||
1029-
ecoalesce->use_adaptive_rx_coalesce ||
1030-
ecoalesce->use_adaptive_tx_coalesce ||
1031-
ecoalesce->pkt_rate_low ||
1032-
ecoalesce->rx_coalesce_usecs_low ||
1033-
ecoalesce->rx_max_coalesced_frames_low ||
1034-
ecoalesce->tx_coalesce_usecs_low ||
1035-
ecoalesce->tx_max_coalesced_frames_low ||
1036-
ecoalesce->pkt_rate_high ||
1037-
ecoalesce->rx_coalesce_usecs_high ||
1038-
ecoalesce->rx_max_coalesced_frames_high ||
1039-
ecoalesce->tx_coalesce_usecs_high ||
1040-
ecoalesce->tx_max_coalesced_frames_high ||
1041-
ecoalesce->rate_sample_interval)
1042-
return -EOPNOTSUPP;
10431022
if (ecoalesce->rx_max_coalesced_frames)
10441023
priv->coalesce_count_rx = ecoalesce->rx_max_coalesced_frames;
10451024
if (ecoalesce->tx_max_coalesced_frames)
@@ -1083,6 +1062,7 @@ static int nixge_ethtools_set_phys_id(struct net_device *ndev,
10831062
}
10841063

10851064
static const struct ethtool_ops nixge_ethtool_ops = {
1065+
.supported_coalesce_params = ETHTOOL_COALESCE_MAX_FRAMES,
10861066
.get_drvinfo = nixge_ethtools_get_drvinfo,
10871067
.get_coalesce = nixge_ethtools_get_coalesce,
10881068
.set_coalesce = nixge_ethtools_set_coalesce,

drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -748,24 +748,7 @@ static int netxen_set_intr_coalesce(struct net_device *netdev,
748748
if (ethcoal->rx_coalesce_usecs > 0xffff ||
749749
ethcoal->rx_max_coalesced_frames > 0xffff ||
750750
ethcoal->tx_coalesce_usecs > 0xffff ||
751-
ethcoal->tx_max_coalesced_frames > 0xffff ||
752-
ethcoal->rx_coalesce_usecs_irq ||
753-
ethcoal->rx_max_coalesced_frames_irq ||
754-
ethcoal->tx_coalesce_usecs_irq ||
755-
ethcoal->tx_max_coalesced_frames_irq ||
756-
ethcoal->stats_block_coalesce_usecs ||
757-
ethcoal->use_adaptive_rx_coalesce ||
758-
ethcoal->use_adaptive_tx_coalesce ||
759-
ethcoal->pkt_rate_low ||
760-
ethcoal->rx_coalesce_usecs_low ||
761-
ethcoal->rx_max_coalesced_frames_low ||
762-
ethcoal->tx_coalesce_usecs_low ||
763-
ethcoal->tx_max_coalesced_frames_low ||
764-
ethcoal->pkt_rate_high ||
765-
ethcoal->rx_coalesce_usecs_high ||
766-
ethcoal->rx_max_coalesced_frames_high ||
767-
ethcoal->tx_coalesce_usecs_high ||
768-
ethcoal->tx_max_coalesced_frames_high)
751+
ethcoal->tx_max_coalesced_frames > 0xffff)
769752
return -EINVAL;
770753

771754
if (!ethcoal->rx_coalesce_usecs ||
@@ -923,6 +906,8 @@ netxen_get_dump_data(struct net_device *netdev, struct ethtool_dump *dump,
923906
}
924907

925908
const struct ethtool_ops netxen_nic_ethtool_ops = {
909+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
910+
ETHTOOL_COALESCE_MAX_FRAMES,
926911
.get_drvinfo = netxen_nic_get_drvinfo,
927912
.get_regs_len = netxen_nic_get_regs_len,
928913
.get_regs = netxen_nic_get_regs,

0 commit comments

Comments
 (0)