Lines Matching +full:lock +full:- +full:offset

14  *      - Redistributions of source code must retain the above
18 * - Redistributions in binary form must reproduce the above
45 #include "mlx5-abi.h"
112 MLX5_QP_TABLE_MASK = (1 << MLX5_QP_TABLE_SHIFT) - 1,
113 MLX5_QP_TABLE_SIZE = 1 << (24 - MLX5_QP_TABLE_SHIFT),
118 MLX5_UIDX_TABLE_MASK = (1 << MLX5_UIDX_TABLE_SHIFT) - 1,
119 MLX5_UIDX_TABLE_SIZE = 1 << (24 - MLX5_UIDX_TABLE_SHIFT),
124 MLX5_SRQ_TABLE_MASK = (1 << MLX5_SRQ_TABLE_SHIFT) - 1,
125 MLX5_SRQ_TABLE_SIZE = 1 << (24 - MLX5_SRQ_TABLE_SHIFT),
203 pthread_spinlock_t lock; member
262 uint64_t offset; member
325 struct mlx5_spinlock lock; member
348 struct mlx5_spinlock lock; member
369 struct mlx5_spinlock lock; member
377 int offset; member
385 struct mlx5_spinlock lock; member
386 unsigned offset; member
447 return -1; in mlx5_ilog2()
465 return (n + d - 1u) / d; in DIV_ROUND_UP()
470 return (val + align - 1) & ~(align - 1); in align()
475 ((void *) ib##xxx - offsetof(struct mlx5_##type, ibv_##xxx)))
481 ret = (void *)ibdev - offsetof(struct mlx5_device, verbs_dev); in to_mdev()
685 if (likely(ctx->uidx_table[tind].refcnt)) in mlx5_find_uidx()
686 return ctx->uidx_table[tind].table[uidx & MLX5_UIDX_TABLE_MASK]; in mlx5_find_uidx()
691 static inline int mlx5_spin_lock(struct mlx5_spinlock *lock) in mlx5_spin_lock() argument
694 return pthread_spin_lock(&lock->lock); in mlx5_spin_lock()
696 if (unlikely(lock->in_use)) { in mlx5_spin_lock()
702 lock->in_use = 1; in mlx5_spin_lock()
713 static inline int mlx5_spin_unlock(struct mlx5_spinlock *lock) in mlx5_spin_unlock() argument
716 return pthread_spin_unlock(&lock->lock); in mlx5_spin_unlock()
718 lock->in_use = 0; in mlx5_spin_unlock()
723 static inline int mlx5_spinlock_init(struct mlx5_spinlock *lock) in mlx5_spinlock_init() argument
725 lock->in_use = 0; in mlx5_spinlock_init()
726 return pthread_spin_init(&lock->lock, PTHREAD_PROCESS_PRIVATE); in mlx5_spinlock_init()
729 static inline int mlx5_spinlock_destroy(struct mlx5_spinlock *lock) in mlx5_spinlock_destroy() argument
731 return pthread_spin_destroy(&lock->lock); in mlx5_spinlock_destroy()
734 static inline void set_command(int command, off_t *offset) in set_command() argument
736 *offset |= (command << MLX5_IB_MMAP_CMD_SHIFT); in set_command()
739 static inline void set_arg(int arg, off_t *offset) in set_arg() argument
741 *offset |= arg; in set_arg()
744 static inline void set_order(int order, off_t *offset) in set_order() argument
746 set_arg(order, offset); in set_order()
749 static inline void set_index(int index, off_t *offset) in set_index() argument
751 set_arg(index, offset); in set_index()