net: nixge: let core reject the unsupported coalescing parameters
authorJakub Kicinski <kuba@kernel.org>
Fri, 13 Mar 2020 04:07:57 +0000 (21:07 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 15 Mar 2020 04:13:54 +0000 (21:13 -0700)
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.

This driver correctly rejects all unsupported
parameters, no functional changes.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ni/nixge.c

index 49c7987c2abd23a1bc04966c3e42146f3e325751..2fdd0753b3afd495077675cefba364b5314f6b95 100644 (file)
@@ -1019,27 +1019,6 @@ static int nixge_ethtools_set_coalesce(struct net_device *ndev,
                return -EBUSY;
        }
 
-       if (ecoalesce->rx_coalesce_usecs ||
-           ecoalesce->rx_coalesce_usecs_irq ||
-           ecoalesce->rx_max_coalesced_frames_irq ||
-           ecoalesce->tx_coalesce_usecs ||
-           ecoalesce->tx_coalesce_usecs_irq ||
-           ecoalesce->tx_max_coalesced_frames_irq ||
-           ecoalesce->stats_block_coalesce_usecs ||
-           ecoalesce->use_adaptive_rx_coalesce ||
-           ecoalesce->use_adaptive_tx_coalesce ||
-           ecoalesce->pkt_rate_low ||
-           ecoalesce->rx_coalesce_usecs_low ||
-           ecoalesce->rx_max_coalesced_frames_low ||
-           ecoalesce->tx_coalesce_usecs_low ||
-           ecoalesce->tx_max_coalesced_frames_low ||
-           ecoalesce->pkt_rate_high ||
-           ecoalesce->rx_coalesce_usecs_high ||
-           ecoalesce->rx_max_coalesced_frames_high ||
-           ecoalesce->tx_coalesce_usecs_high ||
-           ecoalesce->tx_max_coalesced_frames_high ||
-           ecoalesce->rate_sample_interval)
-               return -EOPNOTSUPP;
        if (ecoalesce->rx_max_coalesced_frames)
                priv->coalesce_count_rx = ecoalesce->rx_max_coalesced_frames;
        if (ecoalesce->tx_max_coalesced_frames)
@@ -1083,6 +1062,7 @@ static int nixge_ethtools_set_phys_id(struct net_device *ndev,
 }
 
 static const struct ethtool_ops nixge_ethtool_ops = {
+       .supported_coalesce_params = ETHTOOL_COALESCE_MAX_FRAMES,
        .get_drvinfo    = nixge_ethtools_get_drvinfo,
        .get_coalesce   = nixge_ethtools_get_coalesce,
        .set_coalesce   = nixge_ethtools_set_coalesce,