diff options
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/mlx5/cq.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c index e7c64c57d699..84591865e39d 100644 --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c | |||
@@ -750,17 +750,9 @@ int mlx5_ib_destroy_cq(struct ib_cq *cq) | |||
750 | return 0; | 750 | return 0; |
751 | } | 751 | } |
752 | 752 | ||
753 | static int is_equal_rsn(struct mlx5_cqe64 *cqe64, struct mlx5_ib_srq *srq, | 753 | static int is_equal_rsn(struct mlx5_cqe64 *cqe64, u32 rsn) |
754 | u32 rsn) | ||
755 | { | 754 | { |
756 | u32 lrsn; | 755 | return rsn == (ntohl(cqe64->sop_drop_qpn) & 0xffffff); |
757 | |||
758 | if (srq) | ||
759 | lrsn = be32_to_cpu(cqe64->srqn) & 0xffffff; | ||
760 | else | ||
761 | lrsn = be32_to_cpu(cqe64->sop_drop_qpn) & 0xffffff; | ||
762 | |||
763 | return rsn == lrsn; | ||
764 | } | 756 | } |
765 | 757 | ||
766 | void __mlx5_ib_cq_clean(struct mlx5_ib_cq *cq, u32 rsn, struct mlx5_ib_srq *srq) | 758 | void __mlx5_ib_cq_clean(struct mlx5_ib_cq *cq, u32 rsn, struct mlx5_ib_srq *srq) |
@@ -790,8 +782,8 @@ void __mlx5_ib_cq_clean(struct mlx5_ib_cq *cq, u32 rsn, struct mlx5_ib_srq *srq) | |||
790 | while ((int) --prod_index - (int) cq->mcq.cons_index >= 0) { | 782 | while ((int) --prod_index - (int) cq->mcq.cons_index >= 0) { |
791 | cqe = get_cqe(cq, prod_index & cq->ibcq.cqe); | 783 | cqe = get_cqe(cq, prod_index & cq->ibcq.cqe); |
792 | cqe64 = (cq->mcq.cqe_sz == 64) ? cqe : cqe + 64; | 784 | cqe64 = (cq->mcq.cqe_sz == 64) ? cqe : cqe + 64; |
793 | if (is_equal_rsn(cqe64, srq, rsn)) { | 785 | if (is_equal_rsn(cqe64, rsn)) { |
794 | if (srq) | 786 | if (srq && (ntohl(cqe64->srqn) & 0xffffff)) |
795 | mlx5_ib_free_srq_wqe(srq, be16_to_cpu(cqe64->wqe_counter)); | 787 | mlx5_ib_free_srq_wqe(srq, be16_to_cpu(cqe64->wqe_counter)); |
796 | ++nfreed; | 788 | ++nfreed; |
797 | } else if (nfreed) { | 789 | } else if (nfreed) { |