diff options
-rw-r--r-- | drivers/infiniband/hw/mlx5/cq.c | 10 | ||||
-rw-r--r-- | drivers/infiniband/hw/mlx5/mlx5_ib.h | 5 | ||||
-rw-r--r-- | drivers/infiniband/hw/mlx5/qp.c | 5 |
3 files changed, 14 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c index 5c9eeea62805..2d0dbbf38ceb 100644 --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/kref.h> | 33 | #include <linux/kref.h> |
34 | #include <rdma/ib_umem.h> | 34 | #include <rdma/ib_umem.h> |
35 | #include <rdma/ib_user_verbs.h> | 35 | #include <rdma/ib_user_verbs.h> |
36 | #include <rdma/ib_cache.h> | ||
36 | #include "mlx5_ib.h" | 37 | #include "mlx5_ib.h" |
37 | #include "user.h" | 38 | #include "user.h" |
38 | 39 | ||
@@ -227,7 +228,14 @@ static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe, | |||
227 | wc->dlid_path_bits = cqe->ml_path; | 228 | wc->dlid_path_bits = cqe->ml_path; |
228 | g = (be32_to_cpu(cqe->flags_rqpn) >> 28) & 3; | 229 | g = (be32_to_cpu(cqe->flags_rqpn) >> 28) & 3; |
229 | wc->wc_flags |= g ? IB_WC_GRH : 0; | 230 | wc->wc_flags |= g ? IB_WC_GRH : 0; |
230 | wc->pkey_index = be32_to_cpu(cqe->imm_inval_pkey) & 0xffff; | 231 | if (unlikely(is_qp1(qp->ibqp.qp_type))) { |
232 | u16 pkey = be32_to_cpu(cqe->imm_inval_pkey) & 0xffff; | ||
233 | |||
234 | ib_find_cached_pkey(&dev->ib_dev, qp->port, pkey, | ||
235 | &wc->pkey_index); | ||
236 | } else { | ||
237 | wc->pkey_index = 0; | ||
238 | } | ||
231 | } | 239 | } |
232 | 240 | ||
233 | static void dump_cqe(struct mlx5_ib_dev *dev, struct mlx5_err_cqe *cqe) | 241 | static void dump_cqe(struct mlx5_ib_dev *dev, struct mlx5_err_cqe *cqe) |
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h index a5fa0b9c7580..bb8cda79e881 100644 --- a/drivers/infiniband/hw/mlx5/mlx5_ib.h +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h | |||
@@ -680,6 +680,11 @@ static inline u8 convert_access(int acc) | |||
680 | MLX5_PERM_LOCAL_READ; | 680 | MLX5_PERM_LOCAL_READ; |
681 | } | 681 | } |
682 | 682 | ||
683 | static inline int is_qp1(enum ib_qp_type qp_type) | ||
684 | { | ||
685 | return qp_type == IB_QPT_GSI; | ||
686 | } | ||
687 | |||
683 | #define MLX5_MAX_UMR_SHIFT 16 | 688 | #define MLX5_MAX_UMR_SHIFT 16 |
684 | #define MLX5_MAX_UMR_PAGES (1 << MLX5_MAX_UMR_SHIFT) | 689 | #define MLX5_MAX_UMR_PAGES (1 << MLX5_MAX_UMR_SHIFT) |
685 | 690 | ||
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 203c8a45e095..c745c6c5e10d 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c | |||
@@ -76,11 +76,6 @@ static int is_qp0(enum ib_qp_type qp_type) | |||
76 | return qp_type == IB_QPT_SMI; | 76 | return qp_type == IB_QPT_SMI; |
77 | } | 77 | } |
78 | 78 | ||
79 | static int is_qp1(enum ib_qp_type qp_type) | ||
80 | { | ||
81 | return qp_type == IB_QPT_GSI; | ||
82 | } | ||
83 | |||
84 | static int is_sqp(enum ib_qp_type qp_type) | 79 | static int is_sqp(enum ib_qp_type qp_type) |
85 | { | 80 | { |
86 | return is_qp0(qp_type) || is_qp1(qp_type); | 81 | return is_qp0(qp_type) || is_qp1(qp_type); |