net: systemport: reject unsupported coalescing params
authorJakub Kicinski <kuba@kernel.org>
Tue, 10 Mar 2020 02:15:00 +0000 (19:15 -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 did not previously reject most of unsupported
parameters.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcmsysport.c

index a2cf2ed..bea2dbc 100644 (file)
@@ -623,8 +623,7 @@ static int bcm_sysport_set_coalesce(struct net_device *dev,
                return -EINVAL;
 
        if ((ec->tx_coalesce_usecs == 0 && ec->tx_max_coalesced_frames == 0) ||
-           (ec->rx_coalesce_usecs == 0 && ec->rx_max_coalesced_frames == 0) ||
-           ec->use_adaptive_tx_coalesce)
+           (ec->rx_coalesce_usecs == 0 && ec->rx_max_coalesced_frames == 0))
                return -EINVAL;
 
        for (i = 0; i < dev->num_tx_queues; i++)
@@ -2209,6 +2208,9 @@ static int bcm_sysport_set_rxnfc(struct net_device *dev,
 }
 
 static const struct ethtool_ops bcm_sysport_ethtool_ops = {
+       .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
+                                    ETHTOOL_COALESCE_MAX_FRAMES |
+                                    ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
        .get_drvinfo            = bcm_sysport_get_drvinfo,
        .get_msglevel           = bcm_sysport_get_msglvl,
        .set_msglevel           = bcm_sysport_set_msglvl,