Lines Matching refs:cq
623 static inline void mlx4_en_cq_init_lock(struct mlx4_en_cq *cq) in mlx4_en_cq_init_lock() argument
625 spin_lock_init(&cq->poll_lock); in mlx4_en_cq_init_lock()
626 cq->state = MLX4_EN_CQ_STATE_IDLE; in mlx4_en_cq_init_lock()
630 static inline bool mlx4_en_cq_lock_napi(struct mlx4_en_cq *cq) in mlx4_en_cq_lock_napi() argument
633 spin_lock(&cq->poll_lock); in mlx4_en_cq_lock_napi()
634 if (cq->state & MLX4_CQ_LOCKED) { in mlx4_en_cq_lock_napi()
635 WARN_ON(cq->state & MLX4_EN_CQ_STATE_NAPI); in mlx4_en_cq_lock_napi()
636 cq->state |= MLX4_EN_CQ_STATE_NAPI_YIELD; in mlx4_en_cq_lock_napi()
640 cq->state = MLX4_EN_CQ_STATE_NAPI; in mlx4_en_cq_lock_napi()
641 spin_unlock(&cq->poll_lock); in mlx4_en_cq_lock_napi()
646 static inline bool mlx4_en_cq_unlock_napi(struct mlx4_en_cq *cq) in mlx4_en_cq_unlock_napi() argument
649 spin_lock(&cq->poll_lock); in mlx4_en_cq_unlock_napi()
650 WARN_ON(cq->state & (MLX4_EN_CQ_STATE_POLL | in mlx4_en_cq_unlock_napi()
653 if (cq->state & MLX4_EN_CQ_STATE_POLL_YIELD) in mlx4_en_cq_unlock_napi()
655 cq->state = MLX4_EN_CQ_STATE_IDLE; in mlx4_en_cq_unlock_napi()
656 spin_unlock(&cq->poll_lock); in mlx4_en_cq_unlock_napi()
661 static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq) in mlx4_en_cq_lock_poll() argument
664 spin_lock_bh(&cq->poll_lock); in mlx4_en_cq_lock_poll()
665 if ((cq->state & MLX4_CQ_LOCKED)) { in mlx4_en_cq_lock_poll()
666 struct net_device *dev = cq->dev; in mlx4_en_cq_lock_poll()
668 struct mlx4_en_rx_ring *rx_ring = priv->rx_ring[cq->ring]; in mlx4_en_cq_lock_poll()
670 cq->state |= MLX4_EN_CQ_STATE_POLL_YIELD; in mlx4_en_cq_lock_poll()
675 cq->state |= MLX4_EN_CQ_STATE_POLL; in mlx4_en_cq_lock_poll()
676 spin_unlock_bh(&cq->poll_lock); in mlx4_en_cq_lock_poll()
681 static inline bool mlx4_en_cq_unlock_poll(struct mlx4_en_cq *cq) in mlx4_en_cq_unlock_poll() argument
684 spin_lock_bh(&cq->poll_lock); in mlx4_en_cq_unlock_poll()
685 WARN_ON(cq->state & (MLX4_EN_CQ_STATE_NAPI)); in mlx4_en_cq_unlock_poll()
687 if (cq->state & MLX4_EN_CQ_STATE_POLL_YIELD) in mlx4_en_cq_unlock_poll()
689 cq->state = MLX4_EN_CQ_STATE_IDLE; in mlx4_en_cq_unlock_poll()
690 spin_unlock_bh(&cq->poll_lock); in mlx4_en_cq_unlock_poll()
695 static inline bool mlx4_en_cq_busy_polling(struct mlx4_en_cq *cq) in mlx4_en_cq_busy_polling() argument
697 WARN_ON(!(cq->state & MLX4_CQ_LOCKED)); in mlx4_en_cq_busy_polling()
698 return cq->state & CQ_USER_PEND; in mlx4_en_cq_busy_polling()
701 static inline void mlx4_en_cq_init_lock(struct mlx4_en_cq *cq) in mlx4_en_cq_init_lock() argument
705 static inline bool mlx4_en_cq_lock_napi(struct mlx4_en_cq *cq) in mlx4_en_cq_lock_napi() argument
710 static inline bool mlx4_en_cq_unlock_napi(struct mlx4_en_cq *cq) in mlx4_en_cq_unlock_napi() argument
715 static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq) in mlx4_en_cq_lock_poll() argument
720 static inline bool mlx4_en_cq_unlock_poll(struct mlx4_en_cq *cq) in mlx4_en_cq_unlock_poll() argument
725 static inline bool mlx4_en_cq_busy_polling(struct mlx4_en_cq *cq) in mlx4_en_cq_busy_polling() argument
754 int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
756 void mlx4_en_deactivate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
757 int mlx4_en_set_cq_moder(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
758 int mlx4_en_arm_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
773 int cq, int user_prio);
788 struct mlx4_en_cq *cq,