patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/1] eal/linux: do not create user mem map repeatedly when it exists
@ 2020-07-16 13:38 wangyunjian
  2020-07-17 14:19 ` [dpdk-stable] [dpdk-dev] " Burakov, Anatoly
  2020-07-23 14:48 ` [dpdk-stable] [dpdk-dev] [PATCH v2] " wangyunjian
  0 siblings, 2 replies; 30+ messages in thread
From: wangyunjian @ 2020-07-16 13:38 UTC (permalink / raw)
  To: dev, david.marchand; +Cc: jerry.lilijun, xudingke, Yunjian Wang, stable

From: Yunjian Wang <wangyunjian@huawei.com>

Currently, we will create new user mem map entry for the same memory
segment, but in fact it has already been added to the user mem maps.
It's not necessary to create it twice.

Fixes: 0cbce3a167f1 ("vfio: skip DMA map failure if already mapped")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 lib/librte_eal/linux/eal_vfio.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/librte_eal/linux/eal_vfio.c b/lib/librte_eal/linux/eal_vfio.c
index abb12a354..d8a8c39ab 100644
--- a/lib/librte_eal/linux/eal_vfio.c
+++ b/lib/librte_eal/linux/eal_vfio.c
@@ -1828,6 +1828,13 @@ container_dma_map(struct vfio_config *vfio_cfg, uint64_t vaddr, uint64_t iova,
 		ret = -1;
 		goto out;
 	}
+
+	/* we don't need create new user mem map entry
+	 * for the same memory segment.
+	 */
+	if (errno == EBUSY || errno == EEXIST)
+		goto out;
+
 	/* create new user mem map entry */
 	new_map = &user_mem_maps->maps[user_mem_maps->n_maps++];
 	new_map->addr = vaddr;
-- 
2.23.0



^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2021-04-19 11:48 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16 13:38 [dpdk-stable] [PATCH 1/1] eal/linux: do not create user mem map repeatedly when it exists wangyunjian
2020-07-17 14:19 ` [dpdk-stable] [dpdk-dev] " Burakov, Anatoly
2020-07-17 14:23   ` Burakov, Anatoly
2020-07-20  2:00     ` wangyunjian
2020-07-20 11:46       ` Burakov, Anatoly
2020-07-22 12:47         ` wangyunjian
2020-07-23 14:48 ` [dpdk-stable] [dpdk-dev] [PATCH v2] " wangyunjian
2020-07-24 13:25   ` Burakov, Anatoly
2020-07-25  9:59     ` wangyunjian
2020-07-27  9:24       ` Burakov, Anatoly
2020-07-30 13:16         ` wangyunjian
2020-07-31 11:55           ` Burakov, Anatoly
2020-08-05 12:58             ` wangyunjian
2020-09-17 11:33               ` Burakov, Anatoly
2020-09-17 11:35   ` Burakov, Anatoly
2020-10-15 12:46     ` wangyunjian
2020-10-15 12:54       ` David Marchand
2020-10-16  9:48         ` wangyunjian
2020-10-16  9:28   ` [dpdk-stable] [dpdk-dev] [PATCH v3] eal: fix " wangyunjian
2020-10-20 14:09     ` Thomas Monjalon
2020-11-15 14:23       ` Thomas Monjalon
2020-11-22 18:20         ` Thomas Monjalon
2020-11-23  7:40           ` wangyunjian
2020-11-27 12:54       ` Burakov, Anatoly
2020-12-07 11:08     ` [dpdk-stable] [dpdk-dev] [PATCH v4] " wangyunjian
2021-03-25 13:38       ` wangyunjian
2021-03-25 14:30       ` Thomas Monjalon
2021-03-25 16:45         ` Kevin Traynor
2021-04-10  9:37     ` [dpdk-stable] [dpdk-dev] [PATCH v5] " wangyunjian
2021-04-19 11:47       ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).