mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-15 23:14:31 +08:00
IB/mlx4: Don't return errors from poll_cq
Remove returning errors from mlx4 poll_cq function. Polling CQ operation in kernel never fails by Mellanox HCA architecture and respective driver design. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
25b64fc5f2
commit
20697434b6
@ -687,12 +687,6 @@ repoll:
|
||||
is_error = (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) ==
|
||||
MLX4_CQE_OPCODE_ERROR;
|
||||
|
||||
if (unlikely((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) == MLX4_OPCODE_NOP &&
|
||||
is_send)) {
|
||||
pr_warn("Completion for NOP opcode detected!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Resize CQ in progress */
|
||||
if (unlikely((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) == MLX4_CQE_OPCODE_RESIZE)) {
|
||||
if (cq->resize_buf) {
|
||||
@ -718,12 +712,6 @@ repoll:
|
||||
*/
|
||||
mqp = __mlx4_qp_lookup(to_mdev(cq->ibcq.device)->dev,
|
||||
be32_to_cpu(cqe->vlan_my_qpn));
|
||||
if (unlikely(!mqp)) {
|
||||
pr_warn("CQ %06x with entry for unknown QPN %06x\n",
|
||||
cq->mcq.cqn, be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_QPN_MASK);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
*cur_qp = to_mibqp(mqp);
|
||||
}
|
||||
|
||||
@ -736,11 +724,6 @@ repoll:
|
||||
/* SRQ is also in the radix tree */
|
||||
msrq = mlx4_srq_lookup(to_mdev(cq->ibcq.device)->dev,
|
||||
srq_num);
|
||||
if (unlikely(!msrq)) {
|
||||
pr_warn("CQ %06x with entry for unknown SRQN %06x\n",
|
||||
cq->mcq.cqn, srq_num);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_send) {
|
||||
@ -891,7 +874,6 @@ int mlx4_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc)
|
||||
struct mlx4_ib_qp *cur_qp = NULL;
|
||||
unsigned long flags;
|
||||
int npolled;
|
||||
int err = 0;
|
||||
struct mlx4_ib_dev *mdev = to_mdev(cq->ibcq.device);
|
||||
|
||||
spin_lock_irqsave(&cq->lock, flags);
|
||||
@ -901,8 +883,7 @@ int mlx4_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc)
|
||||
}
|
||||
|
||||
for (npolled = 0; npolled < num_entries; ++npolled) {
|
||||
err = mlx4_ib_poll_one(cq, &cur_qp, wc + npolled);
|
||||
if (err)
|
||||
if (mlx4_ib_poll_one(cq, &cur_qp, wc + npolled))
|
||||
break;
|
||||
}
|
||||
|
||||
@ -911,10 +892,7 @@ int mlx4_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc)
|
||||
out:
|
||||
spin_unlock_irqrestore(&cq->lock, flags);
|
||||
|
||||
if (err == 0 || err == -EAGAIN)
|
||||
return npolled;
|
||||
else
|
||||
return err;
|
||||
return npolled;
|
||||
}
|
||||
|
||||
int mlx4_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
|
||||
|
Loading…
Reference in New Issue
Block a user