Commit c885bff6 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

enic: let core reject the unsupported coalescing parameters

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

This driver correctly rejects all unsupported parameters.
The error code changes from EINVAL to EOPNOTSUPP.

v3: adjust commit message for new error code and member name
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4a1ce010
...@@ -323,25 +323,6 @@ static int enic_coalesce_valid(struct enic *enic, ...@@ -323,25 +323,6 @@ static int enic_coalesce_valid(struct enic *enic,
u32 rx_coalesce_usecs_low = min_t(u32, coalesce_usecs_max, u32 rx_coalesce_usecs_low = min_t(u32, coalesce_usecs_max,
ec->rx_coalesce_usecs_low); ec->rx_coalesce_usecs_low);
if (ec->rx_max_coalesced_frames ||
ec->rx_coalesce_usecs_irq ||
ec->rx_max_coalesced_frames_irq ||
ec->tx_max_coalesced_frames ||
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_max_coalesced_frames_low ||
ec->tx_coalesce_usecs_low ||
ec->tx_max_coalesced_frames_low ||
ec->pkt_rate_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 ((vnic_dev_get_intr_mode(enic->vdev) != VNIC_DEV_INTR_MODE_MSIX) && if ((vnic_dev_get_intr_mode(enic->vdev) != VNIC_DEV_INTR_MODE_MSIX) &&
ec->tx_coalesce_usecs) ec->tx_coalesce_usecs)
return -EINVAL; return -EINVAL;
...@@ -635,6 +616,10 @@ static int enic_get_ts_info(struct net_device *netdev, ...@@ -635,6 +616,10 @@ static int enic_get_ts_info(struct net_device *netdev,
} }
static const struct ethtool_ops enic_ethtool_ops = { static const struct ethtool_ops enic_ethtool_ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
ETHTOOL_COALESCE_USE_ADAPTIVE_RX |
ETHTOOL_COALESCE_RX_USECS_LOW |
ETHTOOL_COALESCE_RX_USECS_HIGH,
.get_drvinfo = enic_get_drvinfo, .get_drvinfo = enic_get_drvinfo,
.get_msglevel = enic_get_msglevel, .get_msglevel = enic_get_msglevel,
.set_msglevel = enic_set_msglevel, .set_msglevel = enic_set_msglevel,
......
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