net: dpaa: reject unsupported coalescing params
authorJakub Kicinski <kuba@kernel.org>
Wed, 11 Mar 2020 22:32:49 +0000 (15:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Mar 2020 18:32:35 +0000 (11:32 -0700)
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.

This driver did not previously reject unsupported parameters
(other than adaptive rx, which will now be rejected by core).

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c

index 6aa1fa22cd0455ca11a800b2441be20e9ffe06ad..9db2a02fb53178049f045f872343257d671c233e 100644 (file)
@@ -525,7 +525,6 @@ static int dpaa_get_coalesce(struct net_device *dev,
 
        c->rx_coalesce_usecs = period;
        c->rx_max_coalesced_frames = thresh;
-       c->use_adaptive_rx_coalesce = false;
 
        return 0;
 }
@@ -540,9 +539,6 @@ static int dpaa_set_coalesce(struct net_device *dev,
        u8 thresh, prev_thresh;
        int cpu, res;
 
-       if (c->use_adaptive_rx_coalesce)
-               return -EINVAL;
-
        period = c->rx_coalesce_usecs;
        thresh = c->rx_max_coalesced_frames;
 
@@ -582,6 +578,8 @@ revert_values:
 }
 
 const struct ethtool_ops dpaa_ethtool_ops = {
+       .supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
+                                    ETHTOOL_COALESCE_RX_MAX_FRAMES,
        .get_drvinfo = dpaa_get_drvinfo,
        .get_msglevel = dpaa_get_msglevel,
        .set_msglevel = dpaa_set_msglevel,