[PATCH v3 7/7] net/hinic: fix mutexes for multi-process
Stephen Hemminger
stephen at networkplumber.org
Wed Apr 29 20:46:44 CEST 2026
The hinic driver supports secondary processes. Mutexes in structures
allocated in shared memory must be initialized with
PTHREAD_PROCESS_SHARED. All callers of hinic_mutex_init() pass NULL
as the attribute argument, so route it through the EAL helper and
drop the unused parameter handling.
Bugzilla ID: 662
Fixes: ae865766b334 ("net/hinic: replace spinlock with mutex")
Cc: stable at dpdk.org
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
drivers/net/hinic/base/hinic_compat.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/hinic/base/hinic_compat.h b/drivers/net/hinic/base/hinic_compat.h
index d3994c50e9..707a3b92b9 100644
--- a/drivers/net/hinic/base/hinic_compat.h
+++ b/drivers/net/hinic/base/hinic_compat.h
@@ -19,6 +19,7 @@
#include <rte_spinlock.h>
#include <rte_cycles.h>
#include <rte_log.h>
+#include <rte_thread.h>
typedef uint8_t u8;
typedef int8_t s8;
@@ -198,9 +199,10 @@ static inline u16 ilog2(u32 n)
}
static inline int hinic_mutex_init(pthread_mutex_t *pthreadmutex,
- const pthread_mutexattr_t *mattr)
+ __rte_unused const pthread_mutexattr_t *mattr)
{
- return pthread_mutex_init(pthreadmutex, mattr);
+ rte_thread_mutex_init_shared(pthreadmutex);
+ return 0;
}
static inline int hinic_mutex_destroy(pthread_mutex_t *pthreadmutex)
--
2.53.0
More information about the stable
mailing list