<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Verdana, Geneva, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi Kevin!</div>
<div style="font-family: Verdana, Geneva, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Verdana, Geneva, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
Thank you for the notification about backporting. </div>
<div style="font-family: Verdana, Geneva, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
Please merge this patch into the stable release. </div>
<div style="font-family: Verdana, Geneva, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Verdana, Geneva, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
If it is possible, it will be nice to add to the stable release this commit too <a href="https://git.dpdk.org/dpdk/commit/?id=f7dabff91738e97d81f6844cb6c00b503de3d9ea">
https://git.dpdk.org/dpdk/commit/?id=f7dabff91738e97d81f6844cb6c00b503de3d9ea</a></div>
<div style="font-family: Verdana, Geneva, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Verdana, Geneva, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
Thanks.</div>
<div style="font-family: Verdana, Geneva, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
Serhii</div>
<div id="appendonsend"></div>
<div style="font-family: Verdana, Geneva, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div id="divRplyFwdMsg">
<div style="direction: ltr; font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<b>From:</b> Kevin Traynor <ktraynor@redhat.com><br>
<b>Sent:</b> 18 July 2025 22:31<br>
<b>To:</b> Oleksandr Kolomeiets <okl-plv@napatech.com><br>
<b>Cc:</b> dpdk stable <stable@dpdk.org><br>
<b>Subject:</b> patch 'net/ntnic: unmap DMA during queue release' has been queued to stable release 24.11.3</div>
<div style="direction: ltr;"> </div>
</div>
<div style="font-size: 11pt;">Hi,<br>
<br>
FYI, your patch has been queued to stable release 24.11.3<br>
<br>
Note it hasn't been pushed to <a data-auth="NotApplicable" class="OWAAutoLink" id="OWA794355b9-c6d5-8671-762e-f7c082b3a3ad" href="https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdpdk.org%2fbrowse%2fdpdk-stable&c=E,1,3Suy4ri3RXJY7WvlDm4o0HlWW7YGi5f8DkoMo21K2P6u4x7bSnte4JjbHh7IEOZllLnwtcUgs85ON-NKs_usq60lx2EM02LQ4heXpVuseKDlZfpB8Q,,&typo=1">
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdpdk.org%2fbrowse%2fdpdk-stable&c=E,1,3Suy4ri3RXJY7WvlDm4o0HlWW7YGi5f8DkoMo21K2P6u4x7bSnte4JjbHh7IEOZllLnwtcUgs85ON-NKs_usq60lx2EM02LQ4heXpVuseKDlZfpB8Q,,&typo=1</a> yet.<br>
It will be pushed if I get no objections before 07/23/25. So please<br>
shout if anyone has objections.<br>
<br>
Also note that after the patch there's a diff of the upstream commit vs the<br>
patch applied to the branch. This will indicate if there was any rebasing<br>
needed to apply to the stable branch. If there were code changes for rebasing<br>
(ie: not only metadata diffs), please double check that the rebase was<br>
correctly done.<br>
<br>
Queued patches are on a temporary branch at:<br>
<a data-auth="NotApplicable" class="OWAAutoLink" id="OWA47f1e23f-3592-3f77-3397-d35b1c9d5409" href="https://github.com/kevintraynor/dpdk-stable">https://github.com/kevintraynor/dpdk-stable</a><br>
<br>
This queued commit can be viewed at:<br>
<a data-auth="NotApplicable" class="OWAAutoLink" id="OWAcc3b502c-16b1-1791-7c15-1fea5caddcb2" href="https://github.com/kevintraynor/dpdk-stable/commit/4719664fc8d68658bd2187851a72a0ec5e752c18">https://github.com/kevintraynor/dpdk-stable/commit/4719664fc8d68658bd2187851a72a0ec5e752c18</a><br>
<br>
Thanks.<br>
<br>
Kevin<br>
<br>
---<br>
>From 4719664fc8d68658bd2187851a72a0ec5e752c18 Mon Sep 17 00:00:00 2001<br>
From: Oleksandr Kolomeiets <okl-plv@napatech.com><br>
Date: Tue, 1 Jul 2025 12:20:27 +0200<br>
Subject: [PATCH] net/ntnic: unmap DMA during queue release<br>
<br>
[ upstream commit 842c1cee225ca8c79a8a321e2194f83d54a4495a ]<br>
<br>
Perform unmapping in a default container, which is used by queues.<br>
Handle multiple mappings when IOMMU is unoptimized.<br>
<br>
Fixes: c1c139535591 ("net/ntnic: add VFIO module")<br>
<br>
Signed-off-by: Oleksandr Kolomeiets <okl-plv@napatech.com><br>
---<br>
drivers/net/ntnic/include/ntos_drv.h | 1 +<br>
drivers/net/ntnic/ntnic_ethdev.c | 26 ++++++++++++++++++++++++--<br>
drivers/net/ntnic/ntnic_vfio.c | 3 ---<br>
3 files changed, 25 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/drivers/net/ntnic/include/ntos_drv.h b/drivers/net/ntnic/include/ntos_drv.h<br>
index f6ce442d17..cf3bb2396b 100644<br>
--- a/drivers/net/ntnic/include/ntos_drv.h<br>
+++ b/drivers/net/ntnic/include/ntos_drv.h<br>
@@ -52,4 +52,5 @@ struct hwq_s {<br>
int vf_num;<br>
struct nthw_memory_descriptor virt_queues_ctrl;<br>
+ struct nthw_memory_descriptor pkt_buffers_ctrl;<br>
struct nthw_memory_descriptor *pkt_buffers;<br>
};<br>
diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c<br>
index 2a2643a106..3c668a41ef 100644<br>
--- a/drivers/net/ntnic/ntnic_ethdev.c<br>
+++ b/drivers/net/ntnic/ntnic_ethdev.c<br>
@@ -879,4 +879,8 @@ static int allocate_hw_virtio_queues(struct rte_eth_dev *eth_dev, int vf_num, st<br>
return -1;<br>
<br>
+ hwq->pkt_buffers_ctrl.virt_addr = virt_addr;<br>
+ hwq->pkt_buffers_ctrl.phys_addr = (void *)iova_addr;<br>
+ hwq->pkt_buffers_ctrl.len = size;<br>
+<br>
for (i = 0; i < num_descr; i++) {<br>
hwq->pkt_buffers[i].virt_addr =<br>
@@ -900,7 +904,11 @@ static int allocate_hw_virtio_queues(struct rte_eth_dev *eth_dev, int vf_num, st<br>
hwq->virt_queues_ctrl.virt_addr = virt;<br>
hwq->virt_queues_ctrl.phys_addr = (void *)(iova_addr);<br>
- hwq->virt_queues_ctrl.len = 0x100000;<br>
+ hwq->virt_queues_ctrl.len = ONE_G_SIZE;<br>
iova_addr += 0x100000;<br>
<br>
+ hwq->pkt_buffers_ctrl.virt_addr = NULL;<br>
+ hwq->pkt_buffers_ctrl.phys_addr = NULL;<br>
+ hwq->pkt_buffers_ctrl.len = 0;<br>
+<br>
NT_LOG(DBG, NTNIC,<br>
"VFIO MMAP: virt_addr=%p phys_addr=%p size=%" PRIX32 " hpa=%" PRIX64 "",<br>
@@ -947,5 +955,5 @@ static int deallocate_hw_virtio_queues(struct hwq_s *hwq)<br>
<br>
int res = nt_vfio_dma_unmap(vf_num, hwq->virt_queues_ctrl.virt_addr,<br>
- (uint64_t)hwq->virt_queues_ctrl.phys_addr, ONE_G_SIZE);<br>
+ (uint64_t)hwq->virt_queues_ctrl.phys_addr, hwq->virt_queues_ctrl.len);<br>
<br>
if (res != 0) {<br>
@@ -954,4 +962,18 @@ static int deallocate_hw_virtio_queues(struct hwq_s *hwq)<br>
}<br>
<br>
+ if (hwq->pkt_buffers_ctrl.virt_addr != NULL &&<br>
+ hwq->pkt_buffers_ctrl.phys_addr != NULL &&<br>
+ hwq->pkt_buffers_ctrl.len > 0) {<br>
+ int res = nt_vfio_dma_unmap(vf_num,<br>
+ hwq->pkt_buffers_ctrl.virt_addr,<br>
+ (uint64_t)hwq->pkt_buffers_ctrl.phys_addr,<br>
+ hwq->pkt_buffers_ctrl.len);<br>
+<br>
+ if (res != 0) {<br>
+ NT_LOG(ERR, NTNIC, "VFIO UNMMAP FAILED! res %i, vf_num %i", res, vf_num);<br>
+ return -1;<br>
+ }<br>
+ }<br>
+<br>
release_hw_virtio_queues(hwq);<br>
rte_free(hwq->pkt_buffers);<br>
diff --git a/drivers/net/ntnic/ntnic_vfio.c b/drivers/net/ntnic/ntnic_vfio.c<br>
index a62234353b..8ddf676b99 100644<br>
--- a/drivers/net/ntnic/ntnic_vfio.c<br>
+++ b/drivers/net/ntnic/ntnic_vfio.c<br>
@@ -213,7 +213,4 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size<br>
}<br>
<br>
- if (vfio->container_fd == -1)<br>
- return 0;<br>
-<br>
int res = rte_vfio_container_dma_unmap(vfio->container_fd, gp_virt_base, iova_addr, size);<br>
<br>
--<br>
2.50.0<br>
<br>
---<br>
Diff of the applied patch vs upstream commit (please double-check if non-empty:<br>
---<br>
--- - 2025-07-18 20:29:15.807999110 +0100<br>
+++ 0136-net-ntnic-unmap-DMA-during-queue-release.patch 2025-07-18 20:29:11.097907843 +0100<br>
@@ -1 +1 @@<br>
-From 842c1cee225ca8c79a8a321e2194f83d54a4495a Mon Sep 17 00:00:00 2001<br>
+From 4719664fc8d68658bd2187851a72a0ec5e752c18 Mon Sep 17 00:00:00 2001<br>
@@ -5,0 +6,2 @@<br>
+[ upstream commit 842c1cee225ca8c79a8a321e2194f83d54a4495a ]<br>
+<br>
@@ -10 +11,0 @@<br>
-Cc: stable@dpdk.org<br>
@@ -20 +21 @@<br>
-index cef3c5c277..047c077057 100644<br>
+index f6ce442d17..cf3bb2396b 100644<br>
@@ -30 +31 @@<br>
-index d875e7c236..79ef9e7e7c 100644<br>
+index 2a2643a106..3c668a41ef 100644<br>
@@ -33 +34 @@<br>
-@@ -880,4 +880,8 @@ static int allocate_hw_virtio_queues(struct rte_eth_dev *eth_dev, int vf_num, st<br>
+@@ -879,4 +879,8 @@ static int allocate_hw_virtio_queues(struct rte_eth_dev *eth_dev, int vf_num, st<br>
@@ -42 +43 @@<br>
-@@ -901,7 +905,11 @@ static int allocate_hw_virtio_queues(struct rte_eth_dev *eth_dev, int vf_num, st<br>
+@@ -900,7 +904,11 @@ static int allocate_hw_virtio_queues(struct rte_eth_dev *eth_dev, int vf_num, st<br>
@@ -55 +56 @@<br>
-@@ -949,5 +957,5 @@ static int deallocate_hw_virtio_queues(struct hwq_s *hwq)<br>
+@@ -947,5 +955,5 @@ static int deallocate_hw_virtio_queues(struct hwq_s *hwq)<br>
@@ -62 +63 @@<br>
-@@ -956,4 +964,18 @@ static int deallocate_hw_virtio_queues(struct hwq_s *hwq)<br>
+@@ -954,4 +962,18 @@ static int deallocate_hw_virtio_queues(struct hwq_s *hwq)<br>
@@ -82 +83 @@<br>
-index 8d955e8342..1031b3cf67 100644<br>
+index a62234353b..8ddf676b99 100644<br>
@@ -85 +86 @@<br>
-@@ -212,7 +212,4 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size<br>
+@@ -213,7 +213,4 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size<br>
<br>
</div>
</body>
</html>