Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dwc-xlgmac: let core reject the unsupported coalescing parameters

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

This driver already correctly rejected all unsupported
parameters.

While at it remove unnecessary zeroing on get.

No functional changes.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jakub Kicinski and committed by
David S. Miller
a5a8758f cbb78cb0

+2 -15
+2 -15
drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c
··· 151 151 { 152 152 struct xlgmac_pdata *pdata = netdev_priv(netdev); 153 153 154 - memset(ec, 0, sizeof(struct ethtool_coalesce)); 155 154 ec->rx_coalesce_usecs = pdata->rx_usecs; 156 155 ec->rx_max_coalesced_frames = pdata->rx_frames; 157 156 ec->tx_max_coalesced_frames = pdata->tx_frames; ··· 165 166 struct xlgmac_hw_ops *hw_ops = &pdata->hw_ops; 166 167 unsigned int rx_frames, rx_riwt, rx_usecs; 167 168 unsigned int tx_frames; 168 - 169 - /* Check for not supported parameters */ 170 - if ((ec->rx_coalesce_usecs_irq) || (ec->rx_max_coalesced_frames_irq) || 171 - (ec->tx_coalesce_usecs) || (ec->tx_coalesce_usecs_high) || 172 - (ec->tx_max_coalesced_frames_irq) || (ec->tx_coalesce_usecs_irq) || 173 - (ec->stats_block_coalesce_usecs) || (ec->pkt_rate_low) || 174 - (ec->use_adaptive_rx_coalesce) || (ec->use_adaptive_tx_coalesce) || 175 - (ec->rx_max_coalesced_frames_low) || (ec->rx_coalesce_usecs_low) || 176 - (ec->tx_coalesce_usecs_low) || (ec->tx_max_coalesced_frames_low) || 177 - (ec->pkt_rate_high) || (ec->rx_coalesce_usecs_high) || 178 - (ec->rx_max_coalesced_frames_high) || 179 - (ec->tx_max_coalesced_frames_high) || 180 - (ec->rate_sample_interval)) 181 - return -EOPNOTSUPP; 182 169 183 170 rx_usecs = ec->rx_coalesce_usecs; 184 171 rx_riwt = hw_ops->usec_to_riwt(pdata, rx_usecs); ··· 242 257 } 243 258 244 259 static const struct ethtool_ops xlgmac_ethtool_ops = { 260 + .supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS | 261 + ETHTOOL_COALESCE_MAX_FRAMES, 245 262 .get_drvinfo = xlgmac_ethtool_get_drvinfo, 246 263 .get_link = ethtool_op_get_link, 247 264 .get_msglevel = xlgmac_ethtool_get_msglevel,