Commit caf48383 authored by David S. Miller's avatar David S. Miller

Merge branch 'ethtool-consolidate-irq-coalescing-other-drivers'

Jakub Kicinski says:

====================
ethtool: consolidate irq coalescing - other drivers

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/20200305051542.991898-1-kuba@kernel.org/
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents ae9e82cc fad99303
...@@ -1508,6 +1508,7 @@ static int vector_set_coalesce(struct net_device *netdev, ...@@ -1508,6 +1508,7 @@ static int vector_set_coalesce(struct net_device *netdev,
} }
static const struct ethtool_ops vector_net_ethtool_ops = { static const struct ethtool_ops vector_net_ethtool_ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_TX_USECS,
.get_drvinfo = vector_net_get_drvinfo, .get_drvinfo = vector_net_get_drvinfo,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_ts_info = ethtool_op_get_ts_info, .get_ts_info = ethtool_op_get_ts_info,
......
...@@ -213,6 +213,8 @@ static int ipoib_get_link_ksettings(struct net_device *netdev, ...@@ -213,6 +213,8 @@ static int ipoib_get_link_ksettings(struct net_device *netdev,
} }
static const struct ethtool_ops ipoib_ethtool_ops = { 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_link_ksettings = ipoib_get_link_ksettings,
.get_drvinfo = ipoib_get_drvinfo, .get_drvinfo = ipoib_get_drvinfo,
.get_coalesce = ipoib_get_coalesce, .get_coalesce = ipoib_get_coalesce,
......
...@@ -3546,6 +3546,7 @@ static int tun_set_coalesce(struct net_device *dev, ...@@ -3546,6 +3546,7 @@ static int tun_set_coalesce(struct net_device *dev,
} }
static const struct ethtool_ops tun_ethtool_ops = { static const struct ethtool_ops tun_ethtool_ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_RX_MAX_FRAMES,
.get_drvinfo = tun_get_drvinfo, .get_drvinfo = tun_get_drvinfo,
.get_msglevel = tun_get_msglevel, .get_msglevel = tun_get_msglevel,
.set_msglevel = tun_set_msglevel, .set_msglevel = tun_set_msglevel,
......
...@@ -6345,6 +6345,7 @@ static int rtl8152_set_ringparam(struct net_device *netdev, ...@@ -6345,6 +6345,7 @@ static int rtl8152_set_ringparam(struct net_device *netdev,
} }
static const struct ethtool_ops ops = { static const struct ethtool_ops ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
.get_drvinfo = rtl8152_get_drvinfo, .get_drvinfo = rtl8152_get_drvinfo,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.nway_reset = rtl8152_nway_reset, .nway_reset = rtl8152_nway_reset,
......
...@@ -780,27 +780,6 @@ vmxnet3_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec) ...@@ -780,27 +780,6 @@ vmxnet3_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec)
if (!VMXNET3_VERSION_GE_3(adapter)) if (!VMXNET3_VERSION_GE_3(adapter))
return -EOPNOTSUPP; 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) && if ((ec->rx_coalesce_usecs == 0) &&
(ec->use_adaptive_rx_coalesce == 0) && (ec->use_adaptive_rx_coalesce == 0) &&
(ec->tx_max_coalesced_frames == 0) && (ec->tx_max_coalesced_frames == 0) &&
...@@ -891,6 +870,9 @@ vmxnet3_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec) ...@@ -891,6 +870,9 @@ vmxnet3_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec)
} }
static const struct ethtool_ops vmxnet3_ethtool_ops = { 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_drvinfo = vmxnet3_get_drvinfo,
.get_regs_len = vmxnet3_get_regs_len, .get_regs_len = vmxnet3_get_regs_len,
.get_regs = vmxnet3_get_regs, .get_regs = vmxnet3_get_regs,
......
...@@ -95,6 +95,7 @@ static int wil_ethtoolops_set_coalesce(struct net_device *ndev, ...@@ -95,6 +95,7 @@ static int wil_ethtoolops_set_coalesce(struct net_device *ndev,
} }
static const struct ethtool_ops wil_ethtool_ops = { static const struct ethtool_ops wil_ethtool_ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
.get_drvinfo = cfg80211_get_drvinfo, .get_drvinfo = cfg80211_get_drvinfo,
.get_coalesce = wil_ethtoolops_get_coalesce, .get_coalesce = wil_ethtoolops_get_coalesce,
.set_coalesce = wil_ethtoolops_set_coalesce, .set_coalesce = wil_ethtoolops_set_coalesce,
......
...@@ -714,6 +714,8 @@ static void ql_set_msglevel(struct net_device *ndev, u32 value) ...@@ -714,6 +714,8 @@ static void ql_set_msglevel(struct net_device *ndev, u32 value)
} }
const struct ethtool_ops qlge_ethtool_ops = { const struct ethtool_ops qlge_ethtool_ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
ETHTOOL_COALESCE_MAX_FRAMES,
.get_drvinfo = ql_get_drvinfo, .get_drvinfo = ql_get_drvinfo,
.get_wol = ql_get_wol, .get_wol = ql_get_wol,
.set_wol = ql_set_wol, .set_wol = ql_set_wol,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment