From: Ciara Loftus <ciara.loftus@intel.com>
To: dev@dpdk.org
Cc: Ciara Loftus <ciara.loftus@intel.com>,
stable@dpdk.org, Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH v3 1/4] net/iavf: fix crash in Tx drain on PF reset
Date: Thu, 5 Nov 2026 12:32:25 +0000 [thread overview]
Message-ID: <20261105123237.12279-2-ciara.loftus@intel.com> (raw)
In-Reply-To: <20261105123237.12279-1-ciara.loftus@intel.com>
The Tx cleanup helpers check the DD bit of the descriptor at the next
RS boundary and assume software has already posted it. The burst path
guarantees this by only cleaning up when nb_tx_free drops below
tx_free_thresh, but iavf_dev_tx_drain() called the helpers on any
non-empty queue.
With fewer than tx_rs_thresh descriptors outstanding, that descriptor
still held the DESC_DONE value set by reset_tx_queue(), so the helpers
treated the block as complete and freed NULL (or already freed) mbufs,
crashing on PF reset.
Only clean up a queue once a full RS block is outstanding.
Fixes: 30e1aab01bae ("net/iavf: drain in-flight Tx before reset")
Cc: stable@dpdk.org
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/net/intel/iavf/iavf_rxtx.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/intel/iavf/iavf_rxtx.c b/drivers/net/intel/iavf/iavf_rxtx.c
index 84b931e78a..8c84991b86 100644
--- a/drivers/net/intel/iavf/iavf_rxtx.c
+++ b/drivers/net/intel/iavf/iavf_rxtx.c
@@ -4098,11 +4098,9 @@ iavf_dev_tx_drain(struct rte_eth_dev *dev)
RTE_ETH_QUEUE_STATE_STARTED)
continue;
- /*
- * nb_tx_free == nb_tx_desc - 1 means the ring is
- * empty (one descriptor is always reserved).
- */
- if (txq->nb_tx_free >= txq->nb_tx_desc - 1)
+ /* Only clean up once a full RS block is outstanding. */
+ if ((uint16_t)(txq->nb_tx_desc - 1 - txq->nb_tx_free) <
+ txq->tx_rs_thresh)
continue;
any_pending = true;
--
2.43.0
next prev parent reply other threads:[~2026-11-05 12:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 9:55 [PATCH v2 0/3] iavf reset path fixes Ciara Loftus
2026-11-04 9:55 ` [PATCH v2 1/3] net/iavf: fix crash in Tx drain on PF reset Ciara Loftus
2026-11-04 17:51 ` Bruce Richardson
2026-11-04 9:55 ` [PATCH v2 2/3] net/iavf: fix event handler leak on init failure Ciara Loftus
2026-11-04 17:52 ` Bruce Richardson
2026-11-04 9:55 ` [PATCH v2 3/3] net/iavf: fix watchdog clearing reset state during recovery Ciara Loftus
2026-11-04 18:00 ` Bruce Richardson
2026-11-05 12:32 ` [PATCH v3 0/4] iavf reset path fixes Ciara Loftus
2026-11-05 12:32 ` Ciara Loftus [this message]
2026-11-05 12:32 ` [PATCH v3 2/4] net/iavf: fix event handler leak on init failure Ciara Loftus
2026-11-05 12:32 ` [PATCH v3 3/4] net/iavf: fix watchdog clearing reset state during recovery Ciara Loftus
2026-11-05 12:32 ` [PATCH v3 4/4] net/iavf: fix watchdog enable racing disable Ciara Loftus
2026-11-06 9:40 ` [PATCH v4 0/4] iavf reset path fixes Ciara Loftus
2026-11-06 9:40 ` [PATCH v4 1/4] net/iavf: fix crash in Tx drain on PF reset Ciara Loftus
2026-11-06 9:40 ` [PATCH v4 2/4] net/iavf: fix event handler leak on init failure Ciara Loftus
2026-11-06 9:40 ` [PATCH v4 3/4] net/iavf: fix watchdog clearing reset state during recovery Ciara Loftus
2026-11-10 10:47 ` Bruce Richardson
2026-11-06 9:40 ` [PATCH v4 4/4] net/iavf: fix watchdog enable racing disable Ciara Loftus
2026-11-10 10:48 ` Bruce Richardson
2026-11-10 10:51 ` [PATCH v4 0/4] iavf reset path fixes Bruce Richardson
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=20261105123237.12279-2-ciara.loftus@intel.com \
--to=ciara.loftus@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.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