patch 'raw/ifpga/base: fix init with multi-process' has been queued to stable release 20.11.8

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Feb 23 10:36:31 CET 2023


Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/a16c5f0eea2899d4983e68a251e67a45b5588d1e

Thanks.

Luca Boccassi

---
>From a16c5f0eea2899d4983e68a251e67a45b5588d1e Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen at huawei.com>
Date: Mon, 6 Feb 2023 10:53:11 +0000
Subject: [PATCH] raw/ifpga/base: fix init with multi-process

[ upstream commit e6a2804b77c5fbfd97d0fe05ec7f959a0404a380 ]

The MAP_FAILED should be used to determine whether the mapping is
successful.

Fixes: e41856b515ce ("raw/ifpga/base: enhance driver reliability in multi-process")

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
Reviewed-by: Rosen Xu <rosen.xu at intel.com>
---
 drivers/raw/ifpga/base/opae_hw_api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/ifpga/base/opae_hw_api.c b/drivers/raw/ifpga/base/opae_hw_api.c
index d5cd5fe608..8b05a2988d 100644
--- a/drivers/raw/ifpga/base/opae_hw_api.c
+++ b/drivers/raw/ifpga/base/opae_hw_api.c
@@ -380,7 +380,7 @@ static pthread_mutex_t *opae_adapter_mutex_open(struct opae_adapter *adapter)
 				PROT_READ | PROT_WRITE, MAP_SHARED,
 				shm_id, 0);
 		adapter->lock = (pthread_mutex_t *)ptr;
-		if (ptr) {
+		if (ptr != MAP_FAILED) {
 			dev_info(NULL,
 					"shared memory %s address is %p\n",
 					shm_name, ptr);
@@ -497,7 +497,7 @@ static void *opae_adapter_shm_alloc(struct opae_adapter *adapter)
 		adapter->shm.size = size;
 		adapter->shm.ptr = mmap(NULL, size, PROT_READ | PROT_WRITE,
 							MAP_SHARED, shm_id, 0);
-		if (adapter->shm.ptr) {
+		if (adapter->shm.ptr != MAP_FAILED) {
 			dev_info(NULL,
 					"shared memory %s address is %p\n",
 					shm_name, adapter->shm.ptr);
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.348212901 +0000
+++ 0027-raw-ifpga-base-fix-init-with-multi-process.patch	2023-02-23 09:36:28.222169866 +0000
@@ -1 +1 @@
-From e6a2804b77c5fbfd97d0fe05ec7f959a0404a380 Mon Sep 17 00:00:00 2001
+From a16c5f0eea2899d4983e68a251e67a45b5588d1e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e6a2804b77c5fbfd97d0fe05ec7f959a0404a380 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index 1117c3e160..6d48d227d6 100644
+index d5cd5fe608..8b05a2988d 100644
@@ -31 +32 @@
-@@ -499,7 +499,7 @@ static void *opae_adapter_shm_alloc(struct opae_adapter *adapter)
+@@ -497,7 +497,7 @@ static void *opae_adapter_shm_alloc(struct opae_adapter *adapter)


More information about the stable mailing list