Lines Matching refs:cq

626 static inline void mlx4_en_cq_init_lock(struct mlx4_en_cq *cq)  in mlx4_en_cq_init_lock()  argument
628 spin_lock_init(&cq->poll_lock); in mlx4_en_cq_init_lock()
629 cq->state = MLX4_EN_CQ_STATE_IDLE; in mlx4_en_cq_init_lock()
633 static inline bool mlx4_en_cq_lock_napi(struct mlx4_en_cq *cq) in mlx4_en_cq_lock_napi() argument
636 spin_lock(&cq->poll_lock); in mlx4_en_cq_lock_napi()
637 if (cq->state & MLX4_CQ_LOCKED) { in mlx4_en_cq_lock_napi()
638 WARN_ON(cq->state & MLX4_EN_CQ_STATE_NAPI); in mlx4_en_cq_lock_napi()
639 cq->state |= MLX4_EN_CQ_STATE_NAPI_YIELD; in mlx4_en_cq_lock_napi()
643 cq->state = MLX4_EN_CQ_STATE_NAPI; in mlx4_en_cq_lock_napi()
644 spin_unlock(&cq->poll_lock); in mlx4_en_cq_lock_napi()
649 static inline bool mlx4_en_cq_unlock_napi(struct mlx4_en_cq *cq) in mlx4_en_cq_unlock_napi() argument
652 spin_lock(&cq->poll_lock); in mlx4_en_cq_unlock_napi()
653 WARN_ON(cq->state & (MLX4_EN_CQ_STATE_POLL | in mlx4_en_cq_unlock_napi()
656 if (cq->state & MLX4_EN_CQ_STATE_POLL_YIELD) in mlx4_en_cq_unlock_napi()
658 cq->state = MLX4_EN_CQ_STATE_IDLE; in mlx4_en_cq_unlock_napi()
659 spin_unlock(&cq->poll_lock); in mlx4_en_cq_unlock_napi()
664 static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq) in mlx4_en_cq_lock_poll() argument
667 spin_lock_bh(&cq->poll_lock); in mlx4_en_cq_lock_poll()
668 if ((cq->state & MLX4_CQ_LOCKED)) { in mlx4_en_cq_lock_poll()
669 struct net_device *dev = cq->dev; in mlx4_en_cq_lock_poll()
671 struct mlx4_en_rx_ring *rx_ring = priv->rx_ring[cq->ring]; in mlx4_en_cq_lock_poll()
673 cq->state |= MLX4_EN_CQ_STATE_POLL_YIELD; in mlx4_en_cq_lock_poll()
678 cq->state |= MLX4_EN_CQ_STATE_POLL; in mlx4_en_cq_lock_poll()
679 spin_unlock_bh(&cq->poll_lock); in mlx4_en_cq_lock_poll()
684 static inline bool mlx4_en_cq_unlock_poll(struct mlx4_en_cq *cq) in mlx4_en_cq_unlock_poll() argument
687 spin_lock_bh(&cq->poll_lock); in mlx4_en_cq_unlock_poll()
688 WARN_ON(cq->state & (MLX4_EN_CQ_STATE_NAPI)); in mlx4_en_cq_unlock_poll()
690 if (cq->state & MLX4_EN_CQ_STATE_POLL_YIELD) in mlx4_en_cq_unlock_poll()
692 cq->state = MLX4_EN_CQ_STATE_IDLE; in mlx4_en_cq_unlock_poll()
693 spin_unlock_bh(&cq->poll_lock); in mlx4_en_cq_unlock_poll()
698 static inline bool mlx4_en_cq_busy_polling(struct mlx4_en_cq *cq) in mlx4_en_cq_busy_polling() argument
700 WARN_ON(!(cq->state & MLX4_CQ_LOCKED)); in mlx4_en_cq_busy_polling()
701 return cq->state & CQ_USER_PEND; in mlx4_en_cq_busy_polling()
704 static inline void mlx4_en_cq_init_lock(struct mlx4_en_cq *cq) in mlx4_en_cq_init_lock() argument
708 static inline bool mlx4_en_cq_lock_napi(struct mlx4_en_cq *cq) in mlx4_en_cq_lock_napi() argument
713 static inline bool mlx4_en_cq_unlock_napi(struct mlx4_en_cq *cq) in mlx4_en_cq_unlock_napi() argument
718 static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq) in mlx4_en_cq_lock_poll() argument
723 static inline bool mlx4_en_cq_unlock_poll(struct mlx4_en_cq *cq) in mlx4_en_cq_unlock_poll() argument
728 static inline bool mlx4_en_cq_busy_polling(struct mlx4_en_cq *cq) in mlx4_en_cq_busy_polling() argument
757 int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
759 void mlx4_en_deactivate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
760 int mlx4_en_set_cq_moder(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
761 int mlx4_en_arm_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
776 int cq, int user_prio);
791 struct mlx4_en_cq *cq,