From: netdev-bot+sashiko@kernel.org
To: nikhil.rao@amd.com
Cc: brett.creeley@amd.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, leitao@debian.org,
eric.joyner@amd.com, abhijit.gangurde@amd.com,
stable@vger.kernel.org
Subject: Re: [PATCH net v2 2/2] ionic: limit TSO segments to the minimum Tx ring size
Date: Sat, 21 Nov 2026 19:32:06 +0000 [thread overview]
Message-ID: <179528952688.3135.14288832479047375578@kernel.org> (raw)
In-Reply-To: <20261117-b4-ionic-tso-max-segs-v2-2-f9792566c5d5@amd.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] The fix only works when skb_shinfo(skb)->gso_segs is already
correct at the moment the core checks the device limit.
- [Medium] tso_max_segs is now IONIC_MIN_TX_DESC - 1 = 127, so on a
128-entry Tx ring a 127-segment TSO skb can only be posted when the…
--
ionic: limit TSO segments to the minimum Tx ring size
The patch raises the minimum Tx ring size to 128 descriptors, and uses
that size for the hwstamp and kdump Tx rings too. It then sets
tso_max_segs to IONIC_MIN_TX_DESC - 1 so the stack never hands the
driver a TSO skb with more segments than a Tx ring can hold. The Rx
minimum is kept at 64 and renamed to IONIC_MIN_RX_DESC.
Link: https://lore.kernel.org/all/20261112082753.6ee90fc8@kernel.org/
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> index 7f0da2b0defdf..1f24c00334bd0 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
[ ... ]
> @@ -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);
> +
[Severity: High]
Is this limit enforced on every path that reaches ionic_start_xmit()?
The core applies it in gso_within_dev_limits():
if (skb_shinfo(skb)->gso_segs > READ_ONCE(dev->gso_max_segs))
This check only works if gso_segs is already accurate. For SKB_GSO_DODGY
skbs, gso_segs is recomputed early by qdisc_pkt_len_segs_init(), and
only __dev_queue_xmit() calls that.
AF_PACKET with PACKET_QDISC_BYPASS and PACKET_VNET_HDR goes around it:
packet_snd()
virtio_net_hdr_to_skb() /* SKB_GSO_DODGY, gso_segs = 0 */
packet_xmit()
dev_direct_xmit()
__dev_direct_xmit()
validate_xmit_skb_list()
validate_xmit_skb()
netif_skb_features()
gso_features_check()
gso_within_dev_limits() /* 0 <= 127, passes */
__skb_gso_segment()
tcp_gso_segment()
ionic does not set NETIF_F_GSO_ROBUST, so netif_needs_gso() is true. But
tcp_gso_segment() then takes this branch:
if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) {
skb_shinfo(skb)->gso_segs = DIV_ROUND_UP(skb->len, mss);
segs = NULL;
goto out;
}
So the original skb reaches the driver with its real gso_segs.
virtio_net_hdr_to_skb() only clamps gso_size to TCP_MIN_GSO_SIZE, so a
64KB frame can carry thousands of segments.
A tc/tcx egress BPF program that calls bpf_skb_adjust_room() or
bpf_skb_net_grow() does the same thing. These run in sch_handle_egress()
after qdisc_pkt_len_segs_init(), reset gso_segs to 0 and shrink gso_size.
In the driver, ionic_tx_descs_needed() returns gso_segs and never
compares it with q->num_descs - 1:
if (skb_is_gso(skb)) {
ndescs = skb_shinfo(skb)->gso_segs;
ionic_start_xmit() then does:
if (!netif_txq_maybe_stop(q_to_ndq(netdev, q),
ionic_q_space_avail(q),
ndescs, ndescs))
return NETDEV_TX_BUSY;
On the qdisc path the skb is requeued and retried forever. On the direct
path, if the ring was idle, no completion arrives to wake the queue. It
stays stopped until dev_watchdog() -> ionic_tx_timeout() resets the
queues.
Isn't that the same stall the commit message says is fixed? The commit
message says:
so that every Tx ring can hold the largest TSO skb. Larger GSO
skbs are segmented in software.
Should ionic_start_xmit() also drop or software-segment skbs where
ndescs > q->num_descs - 1, or does this need a fix in the core?
[Severity: Medium]
With tso_max_segs at 127, a 128-entry Tx ring can only accept a
127-segment TSO skb when it is completely empty. 128 is the new minimum
and the kdump default. Can a deferred doorbell keep the ring from ever
draining?
The core produces 127-segment skbs on purpose when it splits oversized
guest GSO skbs, since skb_gso_output_max_segs() caps at gso_max_segs.
TCP also produces them at an MSS of about 516 or less.
Consider a bulk dequeue on the same txq:
1. ionic_tx() posts a non-TSO skb A with ionic_txq_post(q, false). If
netdev_xmit_more() is true and the queue is not stopped,
__netdev_tx_sent_queue() returns false and the doorbell is deferred:
ring_dbell = __netdev_tx_sent_queue(ndq, skb->len,
netdev_xmit_more());
2. The next skb B is a 127-segment TSO skb. ionic_start_xmit() sees
avail < gso_segs, stops the queue and returns NETDEV_TX_BUSY. The
doorbell for A is never rung.
3. The descriptors that were doorbelled complete, and
ionic_tx_cq_service() wakes the queue. B is retried alone with
xmit_more false. It fails the space check again before anything is
posted, so the doorbell is still not rung.
4. The NIC never fetches A's descriptor, so it never completes. avail
stays below 127 and the queue stays stopped.
The periodic doorbell poke in ionic_queue_doorbell_check() would recover
this, but it starts with:
if (!ionic->lif->doorbell_wa)
return;
ionic_doorbell_wa() only sets doorbell_wa for asic_type 0 or ELBA. On
other ASICs the queue stays stalled until the watchdog resets the
queues.
The NETDEV_TX_BUSY path already skipped the doorbell flush before this
patch. But with no slack on the minimum ring, a single deferred
descriptor is now enough to trigger the stall.
Would it make sense to ring the doorbell before returning
NETDEV_TX_BUSY? Or to leave some headroom between tso_max_segs and the
minimum Tx ring size?
> netdev->priv_flags |= IFF_UNICAST_FLT |
> IFF_LIVE_ADDR_CHANGE;
>
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117-b4-ionic-tso-max-segs-v2-0-f9792566c5d5%40amd.com
prev parent reply other threads:[~2026-11-21 19:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 19:18 [PATCH net v2 0/2] ionic: fix Tx stalls on TSO skbs larger than the Tx ring Nikhil P. Rao
2026-11-17 19:18 ` [PATCH net v2 1/2] ionic: reject Tx ring sizes below the minimum Nikhil P. Rao
2026-11-17 19:18 ` [PATCH net v2 2/2] ionic: limit TSO segments to the minimum Tx ring size Nikhil P. Rao
2026-11-20 19:58 ` Rao, Nikhil
2026-11-21 19:32 ` netdev-bot+sashiko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179528952688.3135.14288832479047375578@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=abhijit.gangurde@amd.com \
--cc=andrew+netdev@lunn.ch \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=eric.joyner@amd.com \
--cc=kuba@kernel.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikhil.rao@amd.com \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®