From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0CB2746BE7 for ; Tue, 22 Jul 2025 15:26:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 058334003C; Tue, 22 Jul 2025 15:26:34 +0200 (CEST) Received: from egress-ip42a.ess.de.barracuda.com (egress-ip42a.ess.de.barracuda.com [18.185.115.201]) by mails.dpdk.org (Postfix) with ESMTP id 1237E4003C for ; Tue, 22 Jul 2025 15:26:31 +0200 (CEST) Received: from GVXPR05CU001.outbound.protection.outlook.com (mail-swedencentralazon11023096.outbound.protection.outlook.com [52.101.83.96]) by mx-outbound10-106.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 22 Jul 2025 13:26:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ftG4gMXB6m+GB4M5UcPWG/Iis25Xec9zQU0PJtOwYnXQRt68FSk3e7AfwDmCP03bdAOkF0gVQIO283BsBa+sboXfinvgyvX99j+agJM5eGduVfYKuPcCNCiqO4erYm/Ij3h3yUxyCsIRzcpWX4GJj0FK+VnglcTzfRFHQpq+RpF+Vm/0rLB6v94Ler0rMHDzAVyVYPzCjY5S8e7LKqRa3iUQW8pu0w7v3LW/wf4XH7IZmsfj4v/e+XXN5GL951xnRZAjPEQEZsrVC0eIyTw9yITpcV6Gt/HXxz85NAghDkA9auApKSx5Qtntobek/p0nV5d1KndOUiDG9ryB5zlZwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oCAQ9R6ZE40nX6lvJRDvfpRRLTopHkfFKE5rGfzCiYA=; b=s3g+00p8EPzEZ+1ne1a7i/VcU4PPixA9rUdRPFhcRKe6MZ72akz7ZSz2g+kV00FWUK80P9MKBTgccdXEsWOcAZBuc6Skeyw+tOa/iq8KhjBFm5cBpZtuBalZbbxtXQVcuXeg/DZKmmVe+ZPzF0mdROgBQEj9a98Z6fAu5Y59A7zQtwLLFHFlFxLPzX9O6eCYuM0GNNA8iLnsFlp0Y9ZXuru8UlggQNWEM4iUqOUz26olCsc1CYRq2sSSuHPMzUbRdGqa+r/S4W+Z62WSSwivt63keg4epLSWel5P6ZZ8YrCc9PoIWPK85L/Rm42U/KCveVeHRQpjaBrBRJdeDRuEVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=napatech.com; dmarc=pass action=none header.from=napatech.com; dkim=pass header.d=napatech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=napatech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oCAQ9R6ZE40nX6lvJRDvfpRRLTopHkfFKE5rGfzCiYA=; b=oPzIhbGxakdB+MBeOI/IB7uX0blkvdyLfBZHq//sv+iDKLE2f3BMS9cqJsWrsfr6Rgt+RH/ncZkNXDTcOLktTWEpRh6JDf8k+7xF2eXiTUSTsHW4VBJr17YjHF0/t/BU/Xwd8GD5kaglupEv5LzRKkWcXjuGLYV5IKLIqOFznPw= Received: from VE1P190MB0830.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:1a9::5) by PR3P190MB0826.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:92::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8943.30; Tue, 22 Jul 2025 13:26:26 +0000 Received: from VE1P190MB0830.EURP190.PROD.OUTLOOK.COM ([fe80::fb19:d808:3eac:2ea3]) by VE1P190MB0830.EURP190.PROD.OUTLOOK.COM ([fe80::fb19:d808:3eac:2ea3%5]) with mapi id 15.20.8943.029; Tue, 22 Jul 2025 13:26:26 +0000 From: Serhii Iliushyk To: Kevin Traynor , Oleksandr Kolomeiets CC: dpdk stable Subject: Re: patch 'net/ntnic: unmap DMA during queue release' has been queued to stable release 24.11.3 Thread-Topic: patch 'net/ntnic: unmap DMA during queue release' has been queued to stable release 24.11.3 Thread-Index: AQHb+Btwc95/VH4YZE6HCj52AAoce7Q+JgdU Date: Tue, 22 Jul 2025 13:26:26 +0000 Message-ID: References: <20250718193247.1008129-1-ktraynor@redhat.com> <20250718193247.1008129-136-ktraynor@redhat.com> In-Reply-To: <20250718193247.1008129-136-ktraynor@redhat.com> Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=napatech.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VE1P190MB0830:EE_|PR3P190MB0826:EE_ x-ms-office365-filtering-correlation-id: 22919e29-bef0-4de1-1143-08ddc9235c09 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|376014|366016|7053199007|8096899003|13003099007|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?q8MdlVH078kTASuXTVSAQgrR55Po3PsObrMQ4WDMXPgYw7FV3DrjD50i/d?= =?iso-8859-1?Q?6IKLL7x7WvzJkWbg41UqmcPDYwVhW5mGnsa7dEQaxKRBx+Igx8XnterOQe?= =?iso-8859-1?Q?6EdhCKR6xI03DppYxQlHFLQYx+YAhD/WKUferCfdqjtaW+HB29CCTtpxZS?= =?iso-8859-1?Q?oQstSRzL5Yy2d7NPhQ4ukYkxxhtFK2JDbC0TNleGT4hzxo8AFEpL3Bktvw?= =?iso-8859-1?Q?JVmuDioruLkF8w4+FxZlOyOqXUuMz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so-8859-1?Q?pqmGycsCFVXLfQJPLFvLCIe95r0lhuZBdk7GDvlRSXxOKgFPhnj7SCXalr?= =?iso-8859-1?Q?E5b9cjW3wRBJG5jguka23udcdOycS+mgQzz3XcMSbXxpr4l1A8vQBcTwcU?= =?iso-8859-1?Q?fyHp4g9kp9xBMMdkJYE8J0Mje5jdk6jmgwgKAn8f0IcWjFwyPiPGIahJA1?= =?iso-8859-1?Q?Y1gyjLUDOj+z5xlZo3DhUeOvQREemecAYhTYc9V0XId3sE7v6e9O+iVEiB?= =?iso-8859-1?Q?vGKlgJoqZjdk0Mm6TjCLSklcuFK4mPatuawGND6aGV9624KGikvU1iDVn7?= =?iso-8859-1?Q?MSpCL1EKvRG0izaSkuoQSI81WCoNdGDcbKCEjiYZnRGilD5atomr+RbH7g?= =?iso-8859-1?Q?Y=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1P190MB0830.EURP190.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(7053199007)(8096899003)(13003099007)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?OCoM+m1De8VzXBbjwjsvwpCEvBAdw0gwFTz38R9nTmiEAmSyjZhcogkgi3?= =?iso-8859-1?Q?Xnf1afwe8eAe9xk3Bog+A/uKx/J75lJV5MUAAk5E2CUw/nG/XLfmWaFZyQ?= =?iso-8859-1?Q?ZAuBb/wV6gtEVSsbn66/cMP1G7ulZ4QuY+c1Nn+7095zLDce8oiLsqc0UM?= =?iso-8859-1?Q?oEnjIrU6otcdAOQNokaosh5fdFlEZzoaBliwwcb3KqVVVUxtoZT8AJrRzN?= =?iso-8859-1?Q?kVqWj3Rb0V2hI1fVe16F8w1YUCVk7lyZRPmTm/BnCaZseZlYbz7rVWrYi2?= =?iso-8859-1?Q?oRhAm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gPxcIqOOWYb3OIoL?= =?iso-8859-1?Q?xKxJ639WPqx2YhESWePl3HdL7WorenjV22mld+5kiPlHkUckkyyJiM3jah?= =?iso-8859-1?Q?ZvSc/tma17qyzwGuWq8NTMKJDKoTg/dvJCrAyZYj0oV/pbYairlUKdjOGo?= =?iso-8859-1?Q?X7mBKbJvkJZFQOo3X44mIdOIQfHbjM9PJcZsx9bFYDwVvqbsZPWc/PeRj7?= =?iso-8859-1?Q?Wh05dGUFi0WH4MfVoA/HqoqRnyINECbTJvzeA4snqaTX2QhyNg25wPLGFy?= =?iso-8859-1?Q?fDYaRCtSJSiX775RyNDfemGBG0WdYoeTsRvlZRdavQOQ4YImYpr2hUr+pB?= =?iso-8859-1?Q?lTCiK7upfXgwnBWHtNvRU06EQCeJNmw4NguH6ZlHOOqNUe2qtbUf5IWyP6?= =?iso-8859-1?Q?zTmrfUNJRYS+z0+a4fNnz6/xJtRe83vA75ti/3NxY7VO+afUHuSGZBcsx2?= =?iso-8859-1?Q?itnoLM9ouFjqgSHm7U+fWnedDn/bqUmSif?= Content-Type: multipart/alternative; boundary="_000_VE1P190MB083016F17AD452CA5E10C745805CAVE1P190MB0830EURP_" MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: LAuN4AbTanihNOOi8k0GnBPykP3HZcN8WWezbrtiOM3I0dqvZpczi8eoHdk6YZ9BBwVfGsb/Pl1kuKppySOcSmfyUENlgCni4EsOimk4MBkDUrDshwPOLemA2IQZNZ4NSZLZJFfUfhErSyUppP2dE4Kc+X3dJOknTSzJJvlSSsQnSPg5psYZk2cGG9S0JrkE80EjlrcdCgxz9aGJPqaKYnWl3YWDlo2p4iYk3IhRzXnoVWxbkMu1AIBEkkEwYrXFWsTiyuYpctVKMRyY2F3NmZIkXFPsQAsHy9xfXqUKdga0lCqDcZBzLiWnbg5uxrBHjjAFoMTcwuGSw4xNWC2L1SusAmHt/BJP4nIBnzrqmZmnv0Q6+/9ijT6Ur0bzUMmj5RDEyONWZhnV3Hswno6ZRlzNBfTkD0q1g0P/CH+uFiGyqZqujnnnD/VuV6U4kl8plIf8cqn+fjaV1WGTuftOQNUmHueYaH7oRaDvV7ji4o5Gji/ATxTrnGZRDZrs5W3nU977Oin9MxJNxHVex/4yzsebj5PE80Vjmkan+IGlCm7uDwz2TGJsU3EJp2DrkFlHRiNEHthQ8NhbAd0RTpgndYe/I4rGuXRKZYwQN6q/Dud55eYeOOpzl0ciRHQix3zzfLp9qVMyNYpNgGsY4fzGdA== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VE1P190MB0830.EURP190.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 22919e29-bef0-4de1-1143-08ddc9235c09 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jul 2025 13:26:26.1319 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: c4540d0b-728a-4233-9da5-9ea30c7ec3ed X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: WXvpBaXZhSSpY2qPvP/ZmsemepmUulUMshd1Vini+znzrXfipu0IIkkbAiFbLMezrKuoHzVEOnZ01xAR+eKvDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P190MB0826 X-BESS-ID: 1753190788-302666-7641-20351-1 X-BESS-VER: 2019.1_20250709.1638 X-BESS-Apparent-Source-IP: 52.101.83.96 X-BESS-Parts: H4sIAAAAAAACAzWMMQ6EMAwE/+KawrETm/AVdEUSbNEgiktxEuLvlwKa1Wik2f UC+3VYoI+d4PzCokw6aB8SkYpFIuMaN5mpsCfPnhM7iwnDPb393o+nD6yIz0GSktFl1q qBKATjiA1rdpJkLTa4P38zqTwYggAAAA== X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.266228 [from cloudscan8-106.eu-central-1a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound 0.00 HTML_MESSAGE BODY: HTML included in message X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND, HTML_MESSAGE X-BESS-BRTS-Status: 1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org --_000_VE1P190MB083016F17AD452CA5E10C745805CAVE1P190MB0830EURP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Kevin! Thank you for the notification about backporting. Please merge this patch into the stable release. If it is possible, it will be nice to add to the stable release this commit= too https://git.dpdk.org/dpdk/commit/?id=3Df7dabff91738e97d81f6844cb6c00b5= 03de3d9ea Thanks. Serhii ________________________________ From: Kevin Traynor Sent: 18 July 2025 22:31 To: Oleksandr Kolomeiets Cc: dpdk stable Subject: patch 'net/ntnic: unmap DMA during queue release' has been queued = to stable release 24.11.3 Hi, FYI, your patch has been queued to stable release 24.11.3 Note it hasn't been pushed to https://linkprotect.cudasvc.com/url?a=3Dhttp%= 3a%2f%2fdpdk.org%2fbrowse%2fdpdk-stable&c=3DE,1,3Suy4ri3RXJY7WvlDm4o0HlWW7Y= Gi5f8DkoMo21K2P6u4x7bSnte4JjbHh7IEOZllLnwtcUgs85ON-NKs_usq60lx2EM02LQ4heXpV= useKDlZfpB8Q,,&typo=3D1 yet. It will be pushed if I get no objections before 07/23/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/4719664fc8d68658bd218785= 1a72a0ec5e752c18 Thanks. Kevin --- >From 4719664fc8d68658bd2187851a72a0ec5e752c18 Mon Sep 17 00:00:00 2001 From: Oleksandr Kolomeiets Date: Tue, 1 Jul 2025 12:20:27 +0200 Subject: [PATCH] net/ntnic: unmap DMA during queue release [ upstream commit 842c1cee225ca8c79a8a321e2194f83d54a4495a ] Perform unmapping in a default container, which is used by queues. Handle multiple mappings when IOMMU is unoptimized. Fixes: c1c139535591 ("net/ntnic: add VFIO module") Signed-off-by: Oleksandr Kolomeiets --- drivers/net/ntnic/include/ntos_drv.h | 1 + drivers/net/ntnic/ntnic_ethdev.c | 26 ++++++++++++++++++++++++-- drivers/net/ntnic/ntnic_vfio.c | 3 --- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/drivers/net/ntnic/include/ntos_drv.h b/drivers/net/ntnic/inclu= de/ntos_drv.h index f6ce442d17..cf3bb2396b 100644 --- a/drivers/net/ntnic/include/ntos_drv.h +++ b/drivers/net/ntnic/include/ntos_drv.h @@ -52,4 +52,5 @@ struct hwq_s { int vf_num; struct nthw_memory_descriptor virt_queues_ctrl; + struct nthw_memory_descriptor pkt_buffers_ctrl; struct nthw_memory_descriptor *pkt_buffers; }; diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_eth= dev.c index 2a2643a106..3c668a41ef 100644 --- a/drivers/net/ntnic/ntnic_ethdev.c +++ b/drivers/net/ntnic/ntnic_ethdev.c @@ -879,4 +879,8 @@ static int allocate_hw_virtio_queues(struct rte_eth_dev= *eth_dev, int vf_num, st return -1; + hwq->pkt_buffers_ctrl.virt_addr =3D virt_addr; + hwq->pkt_buffers_ctrl.phys_addr =3D (void *)iova_addr; + hwq->pkt_buffers_ctrl.len =3D size; + for (i =3D 0; i < num_descr; i++) { hwq->pkt_buffers[i].virt_addr =3D @@ -900,7 +904,11 @@ static int allocate_hw_virtio_queues(struct rte_eth_de= v *eth_dev, int vf_num, st hwq->virt_queues_ctrl.virt_addr =3D virt; hwq->virt_queues_ctrl.phys_addr =3D (void *)(iova_addr); - hwq->virt_queues_ctrl.len =3D 0x100000; + hwq->virt_queues_ctrl.len =3D ONE_G_SIZE; iova_addr +=3D 0x100000; + hwq->pkt_buffers_ctrl.virt_addr =3D NULL; + hwq->pkt_buffers_ctrl.phys_addr =3D NULL; + hwq->pkt_buffers_ctrl.len =3D 0; + NT_LOG(DBG, NTNIC, "VFIO MMAP: virt_addr=3D%p phys_addr=3D%p size=3D%" PRIX32= " hpa=3D%" PRIX64 "", @@ -947,5 +955,5 @@ static int deallocate_hw_virtio_queues(struct hwq_s *hw= q) int res =3D nt_vfio_dma_unmap(vf_num, hwq->virt_queues_ctrl.virt_a= ddr, - (uint64_t)hwq->virt_queues_ctrl.phys_addr, ONE_G_SI= ZE); + (uint64_t)hwq->virt_queues_ctrl.phys_addr, hwq->vir= t_queues_ctrl.len); if (res !=3D 0) { @@ -954,4 +962,18 @@ static int deallocate_hw_virtio_queues(struct hwq_s *h= wq) } + if (hwq->pkt_buffers_ctrl.virt_addr !=3D NULL && + hwq->pkt_buffers_ctrl.phys_addr !=3D NULL && + hwq->pkt_buffers_ctrl.len > 0) { + int res =3D nt_vfio_dma_unmap(vf_num, + hwq->pkt_buffers_ctrl.virt_addr, + (uint64_t)hwq->pkt_buffers_ctrl.phys_addr, + hwq->pkt_buffers_ctrl.len); + + if (res !=3D 0) { + NT_LOG(ERR, NTNIC, "VFIO UNMMAP FAILED! res %i, vf_= num %i", res, vf_num); + return -1; + } + } + release_hw_virtio_queues(hwq); rte_free(hwq->pkt_buffers); diff --git a/drivers/net/ntnic/ntnic_vfio.c b/drivers/net/ntnic/ntnic_vfio.= c index a62234353b..8ddf676b99 100644 --- a/drivers/net/ntnic/ntnic_vfio.c +++ b/drivers/net/ntnic/ntnic_vfio.c @@ -213,7 +213,4 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t= iova_addr, uint64_t size } - if (vfio->container_fd =3D=3D -1) - return 0; - int res =3D rte_vfio_container_dma_unmap(vfio->container_fd, gp_vi= rt_base, iova_addr, size); -- 2.50.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- - 2025-07-18 20:29:15.807999110 +0100 +++ 0136-net-ntnic-unmap-DMA-during-queue-release.patch 2025-07-18 20:29:11= .097907843 +0100 @@ -1 +1 @@ -From 842c1cee225ca8c79a8a321e2194f83d54a4495a Mon Sep 17 00:00:00 2001 +From 4719664fc8d68658bd2187851a72a0ec5e752c18 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 842c1cee225ca8c79a8a321e2194f83d54a4495a ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index cef3c5c277..047c077057 100644 +index f6ce442d17..cf3bb2396b 100644 @@ -30 +31 @@ -index d875e7c236..79ef9e7e7c 100644 +index 2a2643a106..3c668a41ef 100644 @@ -33 +34 @@ -@@ -880,4 +880,8 @@ static int allocate_hw_virtio_queues(struct rte_eth_de= v *eth_dev, int vf_num, st +@@ -879,4 +879,8 @@ static int allocate_hw_virtio_queues(struct rte_eth_de= v *eth_dev, int vf_num, st @@ -42 +43 @@ -@@ -901,7 +905,11 @@ static int allocate_hw_virtio_queues(struct rte_eth_d= ev *eth_dev, int vf_num, st +@@ -900,7 +904,11 @@ static int allocate_hw_virtio_queues(struct rte_eth_d= ev *eth_dev, int vf_num, st @@ -55 +56 @@ -@@ -949,5 +957,5 @@ static int deallocate_hw_virtio_queues(struct hwq_s *h= wq) +@@ -947,5 +955,5 @@ static int deallocate_hw_virtio_queues(struct hwq_s *h= wq) @@ -62 +63 @@ -@@ -956,4 +964,18 @@ static int deallocate_hw_virtio_queues(struct hwq_s *= hwq) +@@ -954,4 +962,18 @@ static int deallocate_hw_virtio_queues(struct hwq_s *= hwq) @@ -82 +83 @@ -index 8d955e8342..1031b3cf67 100644 +index a62234353b..8ddf676b99 100644 @@ -85 +86 @@ -@@ -212,7 +212,4 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_= t iova_addr, uint64_t size +@@ -213,7 +213,4 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_= t iova_addr, uint64_t size --_000_VE1P190MB083016F17AD452CA5E10C745805CAVE1P190MB0830EURP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Kevin!

Thank you for the notification about backporting. 
Please merge this patch into the stable release. 

If it is possible, it will be nice to add to the stable release this commit= too https://git.dpdk.org/dpdk/commit/?id=3Df7dabff91738e97d81f6844cb6c00b503de3= d9ea

Thanks.
Serhii


From: Kevin Traynor <ktraynor@redhat.com>
Sent: 18 July 2025 22:31
To: Oleksandr Kolomeiets <okl-plv@napatech.com>
Cc: dpdk stable <stable@dpdk.org>
Subject: patch 'net/ntnic: unmap DMA during queue release' has = been queued to stable release 24.11.3
 
Hi,

FYI, your patch has been queued to stable release 24.11.3

Note it hasn't been pushed to https://linkprotect.cudasvc.com/url?a=3Dhttp%3a%2f%2fdpdk.org%2fbrowse%2fdp= dk-stable&c=3DE,1,3Suy4ri3RXJY7WvlDm4o0HlWW7YGi5f8DkoMo21K2P6u4x7bSnte4= JjbHh7IEOZllLnwtcUgs85ON-NKs_usq60lx2EM02LQ4heXpVuseKDlZfpB8Q,,&typo=3D= 1 yet.
It will be pushed if I get no objections before 07/23/25. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the=
patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasi= ng
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevin= traynor/dpdk-stable/commit/4719664fc8d68658bd2187851a72a0ec5e752c18

Thanks.

Kevin

---
>From 4719664fc8d68658bd2187851a72a0ec5e752c18 Mon Sep 17 00:00:00 2001
From: Oleksandr Kolomeiets <okl-plv@napatech.com>
Date: Tue, 1 Jul 2025 12:20:27 +0200
Subject: [PATCH] net/ntnic: unmap DMA during queue release

[ upstream commit 842c1cee225ca8c79a8a321e2194f83d54a4495a ]

Perform unmapping in a default container, which is used by queues.
Handle multiple mappings when IOMMU is unoptimized.

Fixes: c1c139535591 ("net/ntnic: add VFIO module")

Signed-off-by: Oleksandr Kolomeiets <okl-plv@napatech.com>
---
 drivers/net/ntnic/include/ntos_drv.h |  1 +
 drivers/net/ntnic/ntnic_ethdev.c     | 26 +++++++= +++++++++++++++++--
 drivers/net/ntnic/ntnic_vfio.c       |&= nbsp; 3 ---
 3 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ntnic/include/ntos_drv.h b/drivers/net/ntnic/inclu= de/ntos_drv.h
index f6ce442d17..cf3bb2396b 100644
--- a/drivers/net/ntnic/include/ntos_drv.h
+++ b/drivers/net/ntnic/include/ntos_drv.h
@@ -52,4 +52,5 @@ struct hwq_s {
         int vf_num;
         struct nthw_memory_descrip= tor virt_queues_ctrl;
+       struct nthw_memory_descriptor pkt_buf= fers_ctrl;
         struct nthw_memory_descrip= tor *pkt_buffers;
 };
diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_eth= dev.c
index 2a2643a106..3c668a41ef 100644
--- a/drivers/net/ntnic/ntnic_ethdev.c
+++ b/drivers/net/ntnic/ntnic_ethdev.c
@@ -879,4 +879,8 @@ static int allocate_hw_virtio_queues(struct rte_eth_dev= *eth_dev, int vf_num, st
            &nb= sp;            retur= n -1;
 
+            &n= bsp;  hwq->pkt_buffers_ctrl.virt_addr =3D virt_addr;
+            &n= bsp;  hwq->pkt_buffers_ctrl.phys_addr =3D (void *)iova_addr;
+            &n= bsp;  hwq->pkt_buffers_ctrl.len =3D size;
+
            &nb= sp;    for (i =3D 0; i < num_descr; i++) {
            &nb= sp;            hwq-&= gt;pkt_buffers[i].virt_addr =3D
@@ -900,7 +904,11 @@ static int allocate_hw_virtio_queues(struct rte_eth_de= v *eth_dev, int vf_num, st
         hwq->virt_queues_ctrl.v= irt_addr =3D virt;
         hwq->virt_queues_ctrl.p= hys_addr =3D (void *)(iova_addr);
-       hwq->virt_queues_ctrl.len =3D 0x10= 0000;
+       hwq->virt_queues_ctrl.len =3D ONE_= G_SIZE;
         iova_addr +=3D 0x100000;  
+       hwq->pkt_buffers_ctrl.virt_addr = =3D NULL;
+       hwq->pkt_buffers_ctrl.phys_addr = =3D NULL;
+       hwq->pkt_buffers_ctrl.len =3D 0; +
         NT_LOG(DBG, NTNIC,
            &nb= sp;    "VFIO MMAP: virt_addr=3D%p phys_addr=3D%p size= =3D%" PRIX32 " hpa=3D%" PRIX64 "",
@@ -947,5 +955,5 @@ static int deallocate_hw_virtio_queues(struct hwq_s *hw= q)
 
         int res =3D nt_vfio_dma_un= map(vf_num, hwq->virt_queues_ctrl.virt_addr,
-            &n= bsp;          (uint64_t)hwq-&g= t;virt_queues_ctrl.phys_addr, ONE_G_SIZE);
+            &n= bsp;          (uint64_t)hwq-&g= t;virt_queues_ctrl.phys_addr, hwq->virt_queues_ctrl.len);
 
         if (res !=3D 0) {
@@ -954,4 +962,18 @@ static int deallocate_hw_virtio_queues(struct hwq_s *h= wq)
         }
 
+       if (hwq->pkt_buffers_ctrl.virt_add= r !=3D NULL &&
+            &n= bsp;          hwq->pkt_buff= ers_ctrl.phys_addr !=3D NULL &&
+            &n= bsp;          hwq->pkt_buff= ers_ctrl.len > 0) {
+            &n= bsp;  int res =3D nt_vfio_dma_unmap(vf_num,
+            &n= bsp;            = ;      hwq->pkt_buffers_ctrl.virt_addr,
+            &n= bsp;            = ;      (uint64_t)hwq->pkt_buffers_ctrl.phys_add= r,
+            &n= bsp;            = ;      hwq->pkt_buffers_ctrl.len);
+
+            &n= bsp;  if (res !=3D 0) {
+            &n= bsp;          NT_LOG(ERR, NTNI= C, "VFIO UNMMAP FAILED! res %i, vf_num %i", res, vf_num);
+            &n= bsp;          return -1;
+            &n= bsp;  }
+       }
+
         release_hw_virtio_queues(h= wq);
         rte_free(hwq->pkt_buffe= rs);
diff --git a/drivers/net/ntnic/ntnic_vfio.c b/drivers/net/ntnic/ntnic_vfio.= c
index a62234353b..8ddf676b99 100644
--- a/drivers/net/ntnic/ntnic_vfio.c
+++ b/drivers/net/ntnic/ntnic_vfio.c
@@ -213,7 +213,4 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t= iova_addr, uint64_t size
         }
 
-       if (vfio->container_fd =3D=3D -1)<= br> -            &n= bsp;  return 0;
-
         int res =3D rte_vfio_conta= iner_dma_unmap(vfio->container_fd, gp_virt_base, iova_addr, size);
 
--
2.50.0

---
  Diff of the applied patch vs upstream commit (please double-check if= non-empty:
---
--- -   2025-07-18 20:29:15.807999110 +0100
+++ 0136-net-ntnic-unmap-DMA-during-queue-release.patch 2025-07-18 20:29:11= .097907843 +0100
@@ -1 +1 @@
-From 842c1cee225ca8c79a8a321e2194f83d54a4495a Mon Sep 17 00:00:00 2001
+From 4719664fc8d68658bd2187851a72a0ec5e752c18 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 842c1cee225ca8c79a8a321e2194f83d54a4495a ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index cef3c5c277..047c077057 100644
+index f6ce442d17..cf3bb2396b 100644
@@ -30 +31 @@
-index d875e7c236..79ef9e7e7c 100644
+index 2a2643a106..3c668a41ef 100644
@@ -33 +34 @@
-@@ -880,4 +880,8 @@ static int allocate_hw_virtio_queues(struct rte_eth_de= v *eth_dev, int vf_num, st
+@@ -879,4 +879,8 @@ static int allocate_hw_virtio_queues(struct rte_eth_de= v *eth_dev, int vf_num, st
@@ -42 +43 @@
-@@ -901,7 +905,11 @@ static int allocate_hw_virtio_queues(struct rte_eth_d= ev *eth_dev, int vf_num, st
+@@ -900,7 +904,11 @@ static int allocate_hw_virtio_queues(struct rte_eth_d= ev *eth_dev, int vf_num, st
@@ -55 +56 @@
-@@ -949,5 +957,5 @@ static int deallocate_hw_virtio_queues(struct hwq_s *h= wq)
+@@ -947,5 +955,5 @@ static int deallocate_hw_virtio_queues(struct hwq_s *h= wq)
@@ -62 +63 @@
-@@ -956,4 +964,18 @@ static int deallocate_hw_virtio_queues(struct hwq_s *= hwq)
+@@ -954,4 +962,18 @@ static int deallocate_hw_virtio_queues(struct hwq_s *= hwq)
@@ -82 +83 @@
-index 8d955e8342..1031b3cf67 100644
+index a62234353b..8ddf676b99 100644
@@ -85 +86 @@
-@@ -212,7 +212,4 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_= t iova_addr, uint64_t size
+@@ -213,7 +213,4 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_= t iova_addr, uint64_t size

--_000_VE1P190MB083016F17AD452CA5E10C745805CAVE1P190MB0830EURP_--