Netdev List
 help / color / mirror / Atom feed
From: "Kadosh, MoriyaX" <moriyax.kadosh@intel.com>
To: "Loktionov, Aleksandr" <aleksandr.loktionov@intel.com>,
	Benoit DE RANCOURT <b2rancourt@gmail.com>,
	"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
	"Kitszel, Przemyslaw" <przemyslaw.kitszel@intel.com>,
	"intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"Gomes, Vinicius" <vinicius.gomes@intel.com>,
	"Sasha Neftin" <sasha.neftin@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH iwl-net 2/2] igc: Flush pending Tx descriptors before returning NETDEV_TX_BUSY
Date: Thu, 3 Dec 2026 00:04:20 +0200	[thread overview]
Message-ID: <fd377830-d5e5-4f2d-b555-946877426b3b@intel.com> (raw)
In-Reply-To: <IA3PR11MB89869C7A76B0187265292A44E5962@IA3PR11MB8986.namprd11.prod.outlook.com>



On 05/10/2026 13:22, Loktionov, Aleksandr wrote:
> 
> 
>> -----Original Message-----
>> From: Benoit DE RANCOURT <b2rancourt@gmail.com>
>> Sent: Sunday, October 4, 2026 5:29 PM
>> To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel,
>> Przemyslaw <przemyslaw.kitszel@intel.com>; intel-wired-
>> lan@lists.osuosl.org
>> Cc: netdev@vger.kernel.org; Andrew Lunn <andrew+netdev@lunn.ch>; David
>> S. Miller <davem@davemloft.net>; Eric Dumazet <edumazet@kernel.org>;
>> Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>;
>> Gomes, Vinicius <vinicius.gomes@intel.com>; Sasha Neftin
>> <sasha.neftin@intel.com>; linux-kernel@vger.kernel.org; Benoit DE
>> RANCOURT <b2rancourt@gmail.com>
>> Subject: [PATCH iwl-net 2/2] igc: Flush pending Tx descriptors before
>> returning NETDEV_TX_BUSY
>>
>> When the stack sends a burst with xmit_more set, igc_tx_map() defers
>> the tail register write until the last skb of the burst or until the
>> queue is stopped. If igc_xmit_frame_ring() then refuses an skb with
>> NETDEV_TX_BUSY, it returns without flushing any pending tail write.
>> Descriptors of packets already accepted in the burst can therefore
>> remain unexposed to the hardware.
>>
>> The queue is stopped at that point and igc_clean_tx_irq() only wakes
>> it once TX_WAKE_THRESHOLD descriptors are free. The hardware can only
>> complete what the tail exposes, so if the unsignalled descriptors keep
>> the free count below the threshold, the queue is never woken and the
>> Tx watchdog resets the adapter.
>>
>> On an I226-V running 7.2.8, in all 25 Tx timeout episodes of the test
>> described in the previous patch, the stalled queue had pending
>> descriptors after a NETDEV_TX_BUSY return: the probes inferred at
>> least 214 of the 256 ring descriptors beyond the last tail write. For
>> that queue, the register dump showed TDH = TDT = the next_to_clean
>> value recorded by the probe: the hardware had completed everything it
>> had been given. For example, with queue 2 stopped, next_to_clean = 190
>> and next_to_use = 167:
>>
>>    igc 0000:08:00.0 terra: NETDEV WATCHDOG: CPU: 1: transmit queue 2
>> timed out 5353 ms
>>    igc 0000:08:00.0 terra: TDH[0-3]        00000099 00000091 000000be
>> 000000f5
>>    igc 0000:08:00.0 terra: TDT[0-3]        00000099 00000091 000000be
>> 000000f5
>>
>> Write the tail before returning NETDEV_TX_BUSY. The refused skb is
>> left untouched; only descriptors of already accepted packets are
>> exposed to the hardware. Those packets have already been accounted to
>> BQL, so flushing their descriptors lets completion processing
>> progress; the refused skb is neither mapped nor accounted here.
>>
>> The previous patch makes this path rare again for common skbs, but it
>> remains reachable, for instance when the linear part or a fragment of
>> an skb exceeds IGC_MAX_DATA_PER_TXD.
>>
>> With this change alone (without the previous patch), three runs of the
>> same test on 7.2.8 still produced 10751 NETDEV_TX_BUSY returns, but no
>> Tx timeout, against 25 on the unpatched kernel.
>>
>> Fixes: 0507ef8a0372 ("igc: Add transmit and receive fastpath and
>> interrupt handlers")
>> Cc: stable@vger.kernel.org
>> Assisted-by: LLM bpftrace
>> Signed-off-by: Benoit DE RANCOURT <b2rancourt@gmail.com>
>> ---
>>   drivers/net/ethernet/intel/igc/igc_main.c | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c
>> b/drivers/net/ethernet/intel/igc/igc_main.c
>> index b94a08791102..16f2ca32f5f1 100644
>> --- a/drivers/net/ethernet/intel/igc/igc_main.c
>> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
>> @@ -1621,7 +1621,11 @@ static netdev_tx_t igc_xmit_frame_ring(struct
>> sk_buff *skb,
>>   						&skb_shinfo(skb)->frags[f]));
>>
>>   	if (igc_maybe_stop_tx(tx_ring, count + 5)) {
>> -		/* this is a hard error */
>> +		/* This is a hard error. Write the tail for packets
>> deferred
>> +		 * by xmit_more before returning busy, otherwise the
>> stopped
>> +		 * queue may never get enough completions to be woken.
>> +		 */
>> +		igc_flush_tx_descriptors(tx_ring);
>>   		return NETDEV_TX_BUSY;
>>   	}
>>
>> --
>> 2.55.0
> 
> 
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Moriya Kadosh <moriyax.kadosh@intel.com>

  reply	other threads:[~2026-12-02 22:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-04 15:28 [PATCH iwl-net 0/2] igc: Fix Tx hangs after NETDEV_TX_BUSY with TSO Benoit DE RANCOURT
2026-10-04 15:28 ` [PATCH iwl-net 1/2] igc: Fix Tx stop threshold to cover empty frame descriptors Benoit DE RANCOURT
2026-10-05 10:22   ` Loktionov, Aleksandr
2026-10-26 11:06     ` Ruinskiy, Dima
2026-11-28 21:01     ` Kadosh, MoriyaX
2026-10-26 11:46   ` Avigail Dahan
2026-10-04 15:28 ` [PATCH iwl-net 2/2] igc: Flush pending Tx descriptors before returning NETDEV_TX_BUSY Benoit DE RANCOURT
2026-10-05 10:22   ` Loktionov, Aleksandr
2026-12-02 22:04     ` Kadosh, MoriyaX [this message]
2026-10-26  9:03 ` [PATCH iwl-net 0/2] igc: Fix Tx hangs after NETDEV_TX_BUSY with TSO Ruinskiy, Dima
2026-10-26 10:14   ` Benoit 2r

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=fd377830-d5e5-4f2d-b555-946877426b3b@intel.com \
    --to=moriyax.kadosh@intel.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=b2rancourt@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=sasha.neftin@intel.com \
    --cc=vinicius.gomes@intel.com \
    /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