diff options
author | 2018-04-23 14:16:57 +0100 | |
---|---|---|
committer | 2018-04-23 14:17:34 +0100 | |
commit | 39157ec04095ab012d11db23c462844634bfbb8f (patch) | |
tree | 643f83dc46445aa7834fe271ce2c21a5cb278cee /drivers/net/mlx5/mlx5.h | |
parent | 47d9763a1dd3103d732da9eec350cfc1cd784717 (diff) |
New upstream version 16.11.5upstream/16.11.5
Change-Id: I47171042629a57c6958d50251351e668ca5f3d8b
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5.h')
-rw-r--r-- | drivers/net/mlx5/mlx5.h | 16 |
1 files changed, 16 insertions, 0 deletions
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 @@ -161,6 +161,22 @@ priv_lock(struct priv *priv) } /** + * 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. * * @param priv |