patch 'eal/freebsd: lock memory device to prevent conflicts' has been queued to stable release 19.11.11

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Nov 30 17:34:09 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before December 10th 2021. 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 rebasing
(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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/33708f0d770a4afad8a65fc507ebc21ff463600a

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 33708f0d770a4afad8a65fc507ebc21ff463600a Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Mon, 13 Sep 2021 15:08:48 +0100
Subject: [PATCH] eal/freebsd: lock memory device to prevent conflicts

[ upstream commit 47a4f2650c71d9197231a95c5df8f89d0f65e882 ]

Only a single DPDK process on the system can be using the /dev/contigmem
mappings at a time, but this was never explicitly enforced, e.g. when
using --in-memory flag on two processes. To prevent possible conflict
issues, we lock the dev node when it's in use, preventing other DPDK
processes from starting up and causing problems for us.

Fixes: 764bf26873b9 ("add FreeBSD support")

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 lib/librte_eal/freebsd/eal/eal_hugepage_info.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_eal/freebsd/eal/eal_hugepage_info.c b/lib/librte_eal/freebsd/eal/eal_hugepage_info.c
index 32012e1427..a2327b6edd 100644
--- a/lib/librte_eal/freebsd/eal/eal_hugepage_info.c
+++ b/lib/librte_eal/freebsd/eal/eal_hugepage_info.c
@@ -85,6 +85,10 @@ eal_hugepage_info_init(void)
 		RTE_LOG(ERR, EAL, "could not open "CONTIGMEM_DEV"\n");
 		return -1;
 	}
+	if (flock(fd, LOCK_EX | LOCK_NB) < 0) {
+		RTE_LOG(ERR, EAL, "could not lock memory. Is another DPDK process running?\n");
+		return -1;
+	}
 
 	if (buffer_size >= 1<<30)
 		RTE_LOG(INFO, EAL, "Contigmem driver has %d buffers, each of size %dGB\n",
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-30 16:50:08.684337416 +0100
+++ 0045-eal-freebsd-lock-memory-device-to-prevent-conflicts.patch	2021-11-30 16:50:05.658872561 +0100
@@ -1 +1 @@
-From 47a4f2650c71d9197231a95c5df8f89d0f65e882 Mon Sep 17 00:00:00 2001
+From 33708f0d770a4afad8a65fc507ebc21ff463600a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 47a4f2650c71d9197231a95c5df8f89d0f65e882 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -18 +19 @@
- lib/eal/freebsd/eal_hugepage_info.c | 4 ++++
+ lib/librte_eal/freebsd/eal/eal_hugepage_info.c | 4 ++++
@@ -21,5 +22,5 @@
-diff --git a/lib/eal/freebsd/eal_hugepage_info.c b/lib/eal/freebsd/eal_hugepage_info.c
-index 408f054f7a..9dbe375bd3 100644
---- a/lib/eal/freebsd/eal_hugepage_info.c
-+++ b/lib/eal/freebsd/eal_hugepage_info.c
-@@ -90,6 +90,10 @@ eal_hugepage_info_init(void)
+diff --git a/lib/librte_eal/freebsd/eal/eal_hugepage_info.c b/lib/librte_eal/freebsd/eal/eal_hugepage_info.c
+index 32012e1427..a2327b6edd 100644
+--- a/lib/librte_eal/freebsd/eal/eal_hugepage_info.c
++++ b/lib/librte_eal/freebsd/eal/eal_hugepage_info.c
+@@ -85,6 +85,10 @@ eal_hugepage_info_init(void)


More information about the stable mailing list