Commit 5865316c authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

mlx4: mlx4_en_low_latency_recv() called with BH disabled

mlx4_en_low_latency_recv() is called with BH disabled,
as other ndo_busy_poll() methods.

No need for spin_lock_bh()/spin_unlock_bh()
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 52bd2d62
...@@ -660,11 +660,12 @@ static inline bool mlx4_en_cq_unlock_napi(struct mlx4_en_cq *cq) ...@@ -660,11 +660,12 @@ static inline bool mlx4_en_cq_unlock_napi(struct mlx4_en_cq *cq)
return rc; return rc;
} }
/* called from mlx4_en_low_latency_poll() */ /* called from mlx4_en_low_latency_recv(), BH are disabled */
static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq) static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq)
{ {
int rc = true; int rc = true;
spin_lock_bh(&cq->poll_lock);
spin_lock(&cq->poll_lock);
if ((cq->state & MLX4_CQ_LOCKED)) { if ((cq->state & MLX4_CQ_LOCKED)) {
struct net_device *dev = cq->dev; struct net_device *dev = cq->dev;
struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_priv *priv = netdev_priv(dev);
...@@ -676,7 +677,7 @@ static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq) ...@@ -676,7 +677,7 @@ static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq)
} else } else
/* preserve yield marks */ /* preserve yield marks */
cq->state |= MLX4_EN_CQ_STATE_POLL; cq->state |= MLX4_EN_CQ_STATE_POLL;
spin_unlock_bh(&cq->poll_lock); spin_unlock(&cq->poll_lock);
return rc; return rc;
} }
...@@ -684,13 +685,14 @@ static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq) ...@@ -684,13 +685,14 @@ static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq)
static inline bool mlx4_en_cq_unlock_poll(struct mlx4_en_cq *cq) static inline bool mlx4_en_cq_unlock_poll(struct mlx4_en_cq *cq)
{ {
int rc = false; int rc = false;
spin_lock_bh(&cq->poll_lock);
spin_lock(&cq->poll_lock);
WARN_ON(cq->state & (MLX4_EN_CQ_STATE_NAPI)); WARN_ON(cq->state & (MLX4_EN_CQ_STATE_NAPI));
if (cq->state & MLX4_EN_CQ_STATE_POLL_YIELD) if (cq->state & MLX4_EN_CQ_STATE_POLL_YIELD)
rc = true; rc = true;
cq->state = MLX4_EN_CQ_STATE_IDLE; cq->state = MLX4_EN_CQ_STATE_IDLE;
spin_unlock_bh(&cq->poll_lock); spin_unlock(&cq->poll_lock);
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment