[v2,17/20] net/failsafe: annotate pthread mutex

Message ID 20230224151143.3274897-18-david.marchand@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Enable lock annotations on most libraries and drivers |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

David Marchand Feb. 24, 2023, 3:11 p.m. UTC
  Annotate wrappers on top of the pthread mutex API.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/failsafe/failsafe_private.h | 6 ++++++
 1 file changed, 6 insertions(+)
  

Patch

diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h
index 53a451c1b1..97b6f5300d 100644
--- a/drivers/net/failsafe/failsafe_private.h
+++ b/drivers/net/failsafe/failsafe_private.h
@@ -403,6 +403,9 @@  fs_dev(struct sub_device *sdev) {
  */
 static inline int
 fs_lock(struct rte_eth_dev *dev, unsigned int is_alarm)
+#ifdef RTE_EXEC_ENV_FREEBSD
+	__rte_exclusive_trylock_function(0, PRIV(dev)->hotplug_mutex)
+#endif
 {
 	int ret;
 
@@ -430,6 +433,9 @@  fs_lock(struct rte_eth_dev *dev, unsigned int is_alarm)
  */
 static inline void
 fs_unlock(struct rte_eth_dev *dev, unsigned int is_alarm)
+#ifdef RTE_EXEC_ENV_FREEBSD
+	__rte_unlock_function(PRIV(dev)->hotplug_mutex)
+#endif
 {
 	int ret;