OSDN Git Service

net: aquantia: reject all unsupported coalescing params
authorJakub Kicinski <kuba@kernel.org>
Tue, 10 Mar 2020 02:14:59 +0000 (19:14 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 10 Mar 2020 23:28:52 +0000 (16:28 -0700)
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.

This driver only rejected some of the unsupported parameters.

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

index 0bdaa0d..6781256 100644 (file)
@@ -386,21 +386,10 @@ static int aq_ethtool_set_coalesce(struct net_device *ndev,
 
        cfg = aq_nic_get_cfg(aq_nic);
 
-       /* This is not yet supported
-        */
-       if (coal->use_adaptive_rx_coalesce || coal->use_adaptive_tx_coalesce)
-               return -EOPNOTSUPP;
-
        /* Atlantic only supports timing based coalescing
         */
        if (coal->rx_max_coalesced_frames > 1 ||
-           coal->rx_coalesce_usecs_irq ||
-           coal->rx_max_coalesced_frames_irq)
-               return -EOPNOTSUPP;
-
-       if (coal->tx_max_coalesced_frames > 1 ||
-           coal->tx_coalesce_usecs_irq ||
-           coal->tx_max_coalesced_frames_irq)
+           coal->tx_max_coalesced_frames > 1)
                return -EOPNOTSUPP;
 
        /* 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)
 }
 
 const struct ethtool_ops aq_ethtool_ops = {
+       .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+                                    ETHTOOL_COALESCE_MAX_FRAMES,
        .get_link            = aq_ethtool_get_link,
        .get_regs_len        = aq_ethtool_get_regs_len,
        .get_regs            = aq_ethtool_get_regs,