[PATCH net 1/2] ionic: reject Tx ring sizes below the minimum
From: Nikhil P. Rao
Date: Fri Nov 06 2026 - 19:24:16 EST
ionic_tx_cq_service() wakes a stopped Tx queue only once
IONIC_TSO_DESCS_NEEDED (44) descriptors are free. The threshold is
sized for a 64 KB TSO skb at a 1500 byte MSS and assumes the ring can
have that many free; a Tx ring of 32 or fewer descriptors cannot, so a
stopped queue is never woken and the netdev watchdog fires.
ionic_set_ringparam() only checks that the size is a power of 2, and
the ethtool core only checks the maximum, so such sizes are accepted.
Reject Tx ring sizes below IONIC_MIN_TXRX_DESC.
Fixes: 061b9bedbef1 ("ionic: Rework Tx start/stop flow")
Signed-off-by: Nikhil P. Rao <nikhil.rao@xxxxxxx>
Reviewed-by: Brett Creeley <brett.creeley@xxxxxxx>
---
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
index 119ac720c078..3518fbf5882d 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
@@ -708,6 +708,13 @@ static int ionic_set_ringparam(struct net_device *netdev,
return -EINVAL;
}
+ if (ring->tx_pending < IONIC_MIN_TXRX_DESC) {
+ NL_SET_ERR_MSG_FMT_MOD(extack,
+ "Tx descriptor count must be at least %d",
+ IONIC_MIN_TXRX_DESC);
+ return -EINVAL;
+ }
+
/* if nothing to do return success */
if (ring->tx_pending == lif->ntxq_descs &&
ring->rx_pending == lif->nrxq_descs &&
--
2.43.0