netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: ll_temac: Fix missing tx_pending check in ethtools_set_ringparam()
@ 2025-07-10 18:06 Alok Tiwari
  2025-07-11 14:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Alok Tiwari @ 2025-07-10 18:06 UTC (permalink / raw)
  To: abin.joseph, radhey.shyam.pandey, michal.simek, andrew+netdev,
	davem, edumazet, kuba, pabeni, horms, netdev
  Cc: alok.a.tiwari, darren.kenny

The function ll_temac_ethtools_set_ringparam() incorrectly checked
rx_pending twice, once correctly for RX and once mistakenly in place
of tx_pending. This caused tx_pending to be left unchecked against
TX_BD_NUM_MAX.
As a result, invalid TX ring sizes may have been accepted or valid
ones wrongly rejected based on the RX limit, leading to potential
misconfiguration or unexpected results.

This patch corrects the condition to properly validate tx_pending.

Fixes: f7b261bfc35e ("net: ll_temac: Make RX/TX ring sizes configurable")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
 drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index edb36ff07a0c6..6f82203a414cd 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -1309,7 +1309,7 @@ ll_temac_ethtools_set_ringparam(struct net_device *ndev,
 	if (ering->rx_pending > RX_BD_NUM_MAX ||
 	    ering->rx_mini_pending ||
 	    ering->rx_jumbo_pending ||
-	    ering->rx_pending > TX_BD_NUM_MAX)
+	    ering->tx_pending > TX_BD_NUM_MAX)
 		return -EINVAL;
 
 	if (netif_running(ndev))
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: ll_temac: Fix missing tx_pending check in ethtools_set_ringparam()
  2025-07-10 18:06 [PATCH net] net: ll_temac: Fix missing tx_pending check in ethtools_set_ringparam() Alok Tiwari
@ 2025-07-11 14:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-11 14:40 UTC (permalink / raw)
  To: Alok Tiwari
  Cc: abin.joseph, radhey.shyam.pandey, michal.simek, andrew+netdev,
	davem, edumazet, kuba, pabeni, horms, netdev, darren.kenny

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 10 Jul 2025 11:06:17 -0700 you wrote:
> The function ll_temac_ethtools_set_ringparam() incorrectly checked
> rx_pending twice, once correctly for RX and once mistakenly in place
> of tx_pending. This caused tx_pending to be left unchecked against
> TX_BD_NUM_MAX.
> As a result, invalid TX ring sizes may have been accepted or valid
> ones wrongly rejected based on the RX limit, leading to potential
> misconfiguration or unexpected results.
> 
> [...]

Here is the summary with links:
  - [net] net: ll_temac: Fix missing tx_pending check in ethtools_set_ringparam()
    https://git.kernel.org/netdev/net/c/e81750b4e382

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-11 14:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-10 18:06 [PATCH net] net: ll_temac: Fix missing tx_pending check in ethtools_set_ringparam() Alok Tiwari
2025-07-11 14:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).