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

Xueming Li xuemingl at nvidia.com
Mon Feb 27 07:59:45 CET 2023


Hi,

FYI, your patch has been queued to stable release 22.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/01/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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=f5803ba5c5572d022512b2682925b2f945bef2d6

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From f5803ba5c5572d022512b2682925b2f945bef2d6 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
Cc: Xueming Li <xuemingl at nvidia.com>

[ 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 1117c3e160..6d48d227d6 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);
@@ -499,7 +499,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.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.391302000 +0800
+++ 0078-raw-ifpga-base-fix-init-with-multi-process.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From e6a2804b77c5fbfd97d0fe05ec7f959a0404a380 Mon Sep 17 00:00:00 2001
+From f5803ba5c5572d022512b2682925b2f945bef2d6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit e6a2804b77c5fbfd97d0fe05ec7f959a0404a380 ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list