[PATCH 1/2] net/xsc: fix jumbo buffer on IOVA conversion failure

Renyong Wan wanry at yunsilicon.com
Fri Nov 13 04:10:25 CET 2026


>From c13caa60c5c285d775697e5564d9465b4a22b136 Mon Sep 17 00:00:00 2001
From: Renyong Wan <wanry at yunsilicon.com>
Date: Fri, 13 Nov 2026 10:44:50 +0800
Subject: [PATCH 1/2] net/xsc: fix jumbo buffer on IOVA conversion failure

When rte_malloc_virt2iova() fails, the buffer is leaked and the local
jumbo_buffer_va keeps RTE_BAD_IOVA. The next iterations skip the
allocation, as it is no longer NULL, and use that value as the address
of the second data segment.

Free the buffer and reset both variables.

Fixes: 0ff4b93c318f ("net/xsc: support device start")
Cc: stable at dpdk.org
Reported-by: Stephen Hemminger <stephen at networkplumber.org>
Signed-off-by: Renyong Wan <wanry at yunsilicon.com>
---
 drivers/net/xsc/xsc_rx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/xsc/xsc_rx.c b/drivers/net/xsc/xsc_rx.c
index 13b2e269..3324b849 100644
--- a/drivers/net/xsc/xsc_rx.c
+++ b/drivers/net/xsc/xsc_rx.c
@@ -238,8 +238,11 @@ xsc_rxq_initialize(struct xsc_dev *xdev, struct xsc_rxq_data *rxq_data)
 					jumbo_buffer_va =
 						(void *)rte_malloc_virt2iova(jumbo_buffer_pa);
 					if ((rte_iova_t)jumbo_buffer_va == RTE_BAD_IOVA) {
+						rte_free(jumbo_buffer_pa);
+						jumbo_buffer_pa = NULL;
+						jumbo_buffer_va = NULL;
 						seg->seg_len = XSC_MAX_RECV_LEN;
-						PMD_DRV_LOG(ERR, "Failed to turn jumbo_buffer");
+						PMD_DRV_LOG(ERR, "Failed to get IOVA of jumbo_buffer");
 						continue;
 					}
 				}


More information about the dev mailing list