From 39157ec04095ab012d11db23c462844634bfbb8f Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 23 Apr 2018 14:16:57 +0100 Subject: New upstream version 16.11.5 Change-Id: I47171042629a57c6958d50251351e668ca5f3d8b Signed-off-by: Luca Boccassi --- drivers/net/mlx5/mlx5.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'drivers/net/mlx5/mlx5.h') diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 79b7a600..0ffb9401 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -160,6 +160,22 @@ priv_lock(struct priv *priv) rte_spinlock_lock(&priv->lock); } +/** + * Try to lock private structure to protect it from concurrent access in the + * control path. + * + * @param priv + * Pointer to private structure. + * + * @return + * 1 if the lock is successfully taken; 0 otherwise. + */ +static inline int +priv_trylock(struct priv *priv) +{ + return rte_spinlock_trylock(&priv->lock); +} + /** * Unlock private structure. * -- cgit 1.2.3-korg