[v2,15/20] ethdev: annotate pthread mutex
Checks
Commit Message
fts_enter/exit take mutexes depending on device flags set at
initialisation.
Annotate those helpers and, since clang does not support conditional
locking, waive the lock check on their implementation.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
lib/ethdev/rte_flow.c | 8 ++++++++
1 file changed, 8 insertions(+)
@@ -297,6 +297,10 @@ rte_flow_dynf_metadata_register(void)
static inline void
fts_enter(struct rte_eth_dev *dev)
+#ifdef RTE_EXEC_ENV_FREEBSD
+ __rte_exclusive_lock_function(dev->data->flow_ops_mutex)
+ __rte_no_thread_safety_analysis
+#endif
{
if (!(dev->data->dev_flags & RTE_ETH_DEV_FLOW_OPS_THREAD_SAFE))
pthread_mutex_lock(&dev->data->flow_ops_mutex);
@@ -304,6 +308,10 @@ fts_enter(struct rte_eth_dev *dev)
static inline void
fts_exit(struct rte_eth_dev *dev)
+#ifdef RTE_EXEC_ENV_FREEBSD
+ __rte_unlock_function(dev->data->flow_ops_mutex)
+ __rte_no_thread_safety_analysis
+#endif
{
if (!(dev->data->dev_flags & RTE_ETH_DEV_FLOW_OPS_THREAD_SAFE))
pthread_mutex_unlock(&dev->data->flow_ops_mutex);