Skip to content

fix use of pthread mutex between processes

Stephen Hemminger dpdk-dev 1 version Applied

Status from this message: Applied to next-net

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest7 patches 1 replyApplied

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/7eal: add helper to initialize process-shared mutexlib/eal/include/rte_thread.h lib/eal/unix/rte_thread.c lib/eal/windows/rte_thread.c+37 -00 replies
2/7ethdev: fix flow_ops_mutex for multi-processlib/ethdev/ethdev_driver.c+1 -10 replies
3/7net/failsafe: fix hotplug_mutex for multi-processdrivers/net/failsafe/failsafe.c+12 -30 replies
4/7net/atlantic: fix mbox_mutex for multi-processdrivers/net/atlantic/atl_ethdev.c+2 -10 replies
5/7net/axgbe: fix mutexes for multi-processdrivers/net/axgbe/axgbe_ethdev.c+7 -70 replies
6/7net/bnxt: fix mutexes for multi-processdrivers/net/bnxt/bnxt_ethdev.c drivers/net/bnxt/bnxt_txq.c drivers/net/bnxt/tf_ulp/bnxt_ulp.c +2 more+11 -90 replies
7/7net/hinic: fix mutexes for multi-processdrivers/net/hinic/base/hinic_compat.h+4 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/7] fix use of pthread mutex between processes

Several drivers and the ethdev layer initialize pthread mutexes in shared memory with default (process-private) attributes. This is undefined behavior when secondary processes use them.

This series adds PTHREAD_PROCESS_SHARED to all affected mutexes. All are on control paths (firmware mailbox, hotplug, flow ops, PHY negotiation) where sleeping is acceptable.

See POSIX spec:
https://pubs.opengroup.org/onlinepubs/009696899/functions/pthread_mutexattr_getpshared.html

Stephen Hemminger (7):
eal: add helper to initialize process-shared mutex
ethdev: fix flow_ops_mutex for multi-process net/failsafe: fix hotplug_mutex for multi-process net/atlantic: fix mbox_mutex for multi-process net/axgbe: fix mutexes for multi-process net/bnxt: fix mutexes for multi-process net/hinic: fix mutexes for multi-process

 drivers/net/atlantic/atl_ethdev.c      |  3 ++-
 drivers/net/axgbe/axgbe_ethdev.c       | 14 +++++++-------
 drivers/net/bnxt/bnxt_ethdev.c         | 11 ++++++-----
 drivers/net/bnxt/bnxt_txq.c            |  3 ++-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c     |  2 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c  |  2 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c |  2 +-
 drivers/net/failsafe/failsafe.c        | 15 ++++++++++++---
 drivers/net/hinic/base/hinic_compat.h  |  6 ++++--
 lib/eal/include/rte_thread.h           | 15 +++++++++++++++
 lib/eal/unix/rte_thread.c              | 12 ++++++++++++
 lib/eal/windows/rte_thread.c           | 10 ++++++++++
 lib/ethdev/ethdev_driver.c             |  2 +-
 13 files changed, 74 insertions(+), 23 deletions(-)
Signature · 1 line
2.53.0