[PATCH v3 5/7] net/axgbe: fix mutexes for multi-process
Stephen Hemminger
stephen at networkplumber.org
Wed Apr 29 20:46:42 CEST 2026
The AXGBE driver supports secondary processes. The xpcs_mutex,
i2c_mutex, an_mutex and phy_mutex in axgbe_port live in dev_private
(shared memory) and must be initialized with PTHREAD_PROCESS_SHARED.
Also, make headers use standard <> format when accessing
DPDK EAL includes.
Bugzilla ID: 662
Fixes: 572890ef6625 ("net/axgbe: add structs for MAC init and reset")
Cc: stable at dpdk.org
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
drivers/net/axgbe/axgbe_ethdev.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
index cfcd880961..9491f18b7c 100644
--- a/drivers/net/axgbe/axgbe_ethdev.c
+++ b/drivers/net/axgbe/axgbe_ethdev.c
@@ -8,10 +8,10 @@
#include "axgbe_common.h"
#include "axgbe_phy.h"
#include "axgbe_regs.h"
-#include "rte_time.h"
-
-#include "eal_filesystem.h"
+#include <rte_thread.h>
+#include <rte_time.h>
+#include <eal_filesystem.h>
#include <rte_vect.h>
#ifdef RTE_ARCH_X86
@@ -2419,10 +2419,10 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)
pdata->tx_desc_count = AXGBE_MAX_RING_DESC;
pdata->rx_desc_count = AXGBE_MAX_RING_DESC;
- pthread_mutex_init(&pdata->xpcs_mutex, NULL);
- pthread_mutex_init(&pdata->i2c_mutex, NULL);
- pthread_mutex_init(&pdata->an_mutex, NULL);
- pthread_mutex_init(&pdata->phy_mutex, NULL);
+ rte_thread_mutex_init_shared(&pdata->xpcs_mutex);
+ rte_thread_mutex_init_shared(&pdata->i2c_mutex);
+ rte_thread_mutex_init_shared(&pdata->an_mutex);
+ rte_thread_mutex_init_shared(&pdata->phy_mutex);
ret = pdata->phy_if.phy_init(pdata);
if (ret) {
--
2.53.0
More information about the stable
mailing list