]> git.itanic.dy.fi Git - linux-stable/commit
qca_debug: Fix ethtool -G iface tx behavior
authorStefan Wahren <wahrenst@gmx.net>
Wed, 6 Dec 2023 14:12:21 +0000 (15:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2023 14:17:34 +0000 (15:17 +0100)
commit4ec0e0e65bb6e8a9014d01dd584e55eba363caaf
tree0fa3e894f5f3e97bb1251a3d035127f00547e16d
parent173fc3212c3111240f6d4cb15c69d25a9d08d9c9
qca_debug: Fix ethtool -G iface tx behavior

[ Upstream commit 96a7e861d9e04d07febd3011c30cd84cd141d81f ]

After calling ethtool -g it was not possible to adjust the TX ring
size again:

  # ethtool -g eth1
  Ring parameters for eth1:
  Pre-set maximums:
  RX: 4
  RX Mini: n/a
  RX Jumbo: n/a
  TX: 10
  Current hardware settings:
  RX: 4
  RX Mini: n/a
  RX Jumbo: n/a
  TX: 10
  # ethtool -G eth1 tx 8
  netlink error: Invalid argument

The reason for this is that the readonly setting rx_pending get
initialized and after that the range check in qcaspi_set_ringparam()
fails regardless of the provided parameter. So fix this by accepting
the exposed RX defaults. Instead of adding another magic number
better use a new define here.

Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000")
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Link: https://lore.kernel.org/r/20231206141222.52029-3-wahrenst@gmx.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/qualcomm/qca_debug.c