public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	stable@dpdk.org, Long Li <longli@microsoft.com>,
	Wei Hu <weh@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>
Subject: [RFT] net/netvsc: fix txd leak on chimney buffer alloc failure
Date: Wed, 18 Feb 2026 17:44:44 -0800	[thread overview]
Message-ID: <20260219014444.175203-1-stephen@networkplumber.org> (raw)

Audit of tx_pkt_burst() code path in drivers found this related bug.

When hn_try_txagg() fails because hn_chim_alloc() cannot allocate a
chimney buffer slot, it returns NULL without freeing the txd descriptor
that was obtained earlier from the txd pool. The caller then breaks
out of the transmit loop without returning the txd either.

Each occurrence leaks one txd descriptor. Under sustained chimney
buffer pressure this eventually exhausts the txd pool and blocks
all transmit on the queue.

Add hn_txd_put() before the break to return the txd to the pool.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/netvsc/hn_rxtx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
index 72dab26ede..3fc54e76b9 100644
--- a/drivers/net/netvsc/hn_rxtx.c
+++ b/drivers/net/netvsc/hn_rxtx.c
@@ -1595,8 +1595,10 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 
 			pkt = hn_try_txagg(hv, txq, txd, pkt_size);
-			if (unlikely(!pkt))
+			if (unlikely(!pkt)) {
+				hn_txd_put(txq, txd);
 				break;
+			}
 
 			hn_encap(pkt, queue_id, m);
 			hn_append_to_chim(txq, pkt, m);
-- 
2.51.0


             reply	other threads:[~2026-02-19  1:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19  1:44 Stephen Hemminger [this message]
2026-02-19 21:22 ` [EXTERNAL] [RFT] net/netvsc: fix txd leak on chimney buffer alloc failure Long Li

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=20260219014444.175203-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=haiyangz@microsoft.com \
    --cc=longli@microsoft.com \
    --cc=stable@dpdk.org \
    --cc=weh@microsoft.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