[PATCH net v2 2/2] ionic: limit TSO segments to the minimum Tx ring size

From: Nikhil P. Rao

Date: Tue Nov 17 2026 - 14:20:23 EST


ionic uses one Tx descriptor per TSO segment, and a Tx ring holds at
most num_descs - 1 of them. The driver does not set tso_max_segs, so
the stack can hand it GSO skbs with more segments than the Tx ring
can hold. ionic_tx() then stops the queue waiting for descriptors
that can never become free, and the netdev watchdog fires repeatedly.

This was hit in production: guest TCP traffic with an MSS below 64
produced 64 KB GSO skbs on the default 1024-entry ring.

Raise the minimum Tx ring size to IONIC_MIN_TX_DESC (128), for the
hwstamp and kdump Tx rings as well, and set tso_max_segs to
IONIC_MIN_TX_DESC - 1 so that every Tx ring can hold the largest TSO
skb. Larger GSO skbs are segmented in software. 127 segments still
covers a 64 KB skb at the 536 byte default MSS.

IONIC_MIN_TXRX_DESC now only applies to Rx, so rename it to
IONIC_MIN_RX_DESC.

Tested on an AMD Pensando NIC with GSO frames of about 1500 segments,
injected through a tap with a virtio-net header and redirected to the
ionic netdev with tc mirred: without this patch the Tx queue stalls and
the watchdog fires, and with it they are sent.

Fixes: 0f3154e6bcb3 ("ionic: Add Tx and Rx handling")
Cc: stable@xxxxxxxxxxxxxxx
Suggested-by: Jakub Kicinski <kuba@xxxxxxxxxx>
Link: https://lore.kernel.org/all/20261112082753.6ee90fc8@xxxxxxxxxx/
Signed-off-by: Nikhil P. Rao <nikhil.rao@xxxxxxx>
Reviewed-by: Brett Creeley <brett.creeley@xxxxxxx>
---
drivers/net/ethernet/pensando/ionic/ionic_dev.h | 3 ++-
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 4 ++--
drivers/net/ethernet/pensando/ionic/ionic_lif.c | 10 ++++++----
3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h
index db90e39a1442..4b3e244e6bbb 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h
+++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h
@@ -16,7 +16,8 @@

#define IONIC_MAX_TX_DESC 8192
#define IONIC_MAX_RX_DESC 16384
-#define IONIC_MIN_TXRX_DESC 64
+#define IONIC_MIN_RX_DESC 64
+#define IONIC_MIN_TX_DESC 128
#define IONIC_DEF_TXRX_DESC 1024
#define IONIC_RX_FILL_THRESHOLD 16
#define IONIC_RX_FILL_DIV 8
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
index 3518fbf5882d..24fd34b4cfcc 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
@@ -708,10 +708,10 @@ static int ionic_set_ringparam(struct net_device *netdev,
return -EINVAL;
}

- if (ring->tx_pending < IONIC_MIN_TXRX_DESC) {
+ if (ring->tx_pending < IONIC_MIN_TX_DESC) {
NL_SET_ERR_MSG_FMT_MOD(extack,
"Tx descriptor count must be at least %d",
- IONIC_MIN_TXRX_DESC);
+ IONIC_MIN_TX_DESC);
return -EINVAL;
}

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
index 7f0da2b0defd..1f24c00334bd 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
@@ -997,7 +997,7 @@ int ionic_lif_create_hwstamp_txq(struct ionic_lif *lif)

features = IONIC_Q_F_2X_CQ_DESC | IONIC_TXQ_F_HWSTAMP;

- num_desc = IONIC_MIN_TXRX_DESC;
+ num_desc = IONIC_MIN_TX_DESC;
desc_sz = sizeof(struct ionic_txq_desc);
comp_sz = 2 * sizeof(struct ionic_txq_comp);

@@ -1062,7 +1062,7 @@ int ionic_lif_create_hwstamp_rxq(struct ionic_lif *lif)

features = IONIC_Q_F_2X_CQ_DESC | IONIC_RXQ_F_HWSTAMP;

- num_desc = IONIC_MIN_TXRX_DESC;
+ num_desc = IONIC_MIN_RX_DESC;
desc_sz = sizeof(struct ionic_rxq_desc);
comp_sz = 2 * sizeof(struct ionic_rxq_comp);
sg_desc_sz = sizeof(struct ionic_rxq_sg_desc);
@@ -1642,6 +1642,8 @@ static int ionic_init_nic_features(struct ionic_lif *lif)
netdev->features |= netdev->hw_features;
netdev->vlan_features |= netdev->features & ~NETIF_F_VLAN_FEATURES;

+ netif_set_tso_max_segs(netdev, IONIC_MIN_TX_DESC - 1);
+
netdev->priv_flags |= IFF_UNICAST_FLT |
IFF_LIVE_ADDR_CHANGE;

@@ -3284,8 +3286,8 @@ int ionic_lif_alloc(struct ionic *ionic)
lif->index = 0;

if (is_kdump_kernel()) {
- lif->ntxq_descs = IONIC_MIN_TXRX_DESC;
- lif->nrxq_descs = IONIC_MIN_TXRX_DESC;
+ lif->ntxq_descs = IONIC_MIN_TX_DESC;
+ lif->nrxq_descs = IONIC_MIN_RX_DESC;
} else {
lif->ntxq_descs = IONIC_DEF_TXRX_DESC;
lif->nrxq_descs = IONIC_DEF_TXRX_DESC;

--
2.43.0