]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: enetc: fix the output issue of 'ethtool --show-ring'
authorWei Fang <wei.fang@nxp.com>
Fri, 20 Mar 2026 09:42:22 +0000 (17:42 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 24 Mar 2026 01:48:19 +0000 (18:48 -0700)
Currently, enetc_get_ringparam() only provides rx_pending and tx_pending,
but 'ethtool --show-ring' no longer displays these fields. Because the
ringparam retrieval path has moved to the new netlink interface, where
rings_fill_reply() emits the *x_pending only if the *x_max_pending values
are non-zero. So rx_max_pending and tx_max_pending to are added to
enetc_get_ringparam() to fix the issue.

Note that the maximum tx/rx ring size of hardware is 64K, but we haven't
added set_ringparam() to make the ring size configurable. To avoid users
mistakenly believing that the ring size can be increased, so set
the *x_max_pending to priv->*x_bd_count.

Fixes: e4a1717b677c ("ethtool: provide ring sizes with RINGS_GET request")
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Link: https://patch.msgid.link/20260320094222.706339-1-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c

index fed89d4f1e1dc46215f4ebd502250080645e35ed..2fe140ddebb23b0f7fe1c011105a91ef464fbd48 100644 (file)
@@ -813,6 +813,8 @@ static void enetc_get_ringparam(struct net_device *ndev,
 {
        struct enetc_ndev_priv *priv = netdev_priv(ndev);
 
+       ring->rx_max_pending = priv->rx_bd_count;
+       ring->tx_max_pending = priv->tx_bd_count;
        ring->rx_pending = priv->rx_bd_count;
        ring->tx_pending = priv->tx_bd_count;