[dpdk-dev] [PATCH 2/4] eal: allow getting memory segment FD with external memory

Maxime Coquelin maxime.coquelin at redhat.com
Fri Dec 13 15:13:20 CET 2019


Now that it is possible to associate a file descriptor when
registering external and contiguous memory, let's allow it.

If no FD is available for the memory segment, ENOENT error
is returned.

Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 lib/librte_eal/common/eal_common_memory.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
index 7a4b371828..cc660f5b85 100644
--- a/lib/librte_eal/common/eal_common_memory.c
+++ b/lib/librte_eal/common/eal_common_memory.c
@@ -691,12 +691,6 @@ rte_memseg_get_fd_thread_unsafe(const struct rte_memseg *ms)
 		return -1;
 	}
 
-	/* segment fd API is not supported for external segments */
-	if (msl->external) {
-		rte_errno = ENOTSUP;
-		return -1;
-	}
-
 	ret = eal_memalloc_get_seg_fd(msl_idx, seg_idx);
 	if (ret < 0) {
 		rte_errno = -ret;
@@ -746,12 +740,6 @@ rte_memseg_get_fd_offset_thread_unsafe(const struct rte_memseg *ms,
 		return -1;
 	}
 
-	/* segment fd API is not supported for external segments */
-	if (msl->external) {
-		rte_errno = ENOTSUP;
-		return -1;
-	}
-
 	ret = eal_memalloc_get_seg_fd_offset(msl_idx, seg_idx, offset);
 	if (ret < 0) {
 		rte_errno = -ret;
-- 
2.21.0



More information about the dev mailing list