Skip to content

Commit 2f62747

Browse files
author
Saeed Mahameed
committed
Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux
mlx5-next shared branch with rdma subtree to avoid mlx5 rdma v.s. netdev conflicts. Highlights: 1) RDMA ODP (On Demand Paging) improvements and moving ODP logic to mlx5 RDMA driver 2) Improved mlx5 core driver and device events handling and provided API for upper layers to subscribe to device events. 3) RDMA only code cleanup from mlx5 core 4) Add helper to get CQE opcode 5) Rework handling of port module events 6) shared mlx5_ifc.h updates to avoid conflicts Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2 parents d8ed257 + 6c22a11 commit 2f62747

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2611
-2088
lines changed

drivers/infiniband/core/umem_odp.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,13 @@ int ib_umem_odp_map_dma_pages(struct ib_umem_odp *umem_odp, u64 user_virt,
647647
flags, local_page_list, NULL, NULL);
648648
up_read(&owning_mm->mmap_sem);
649649

650-
if (npages < 0)
650+
if (npages < 0) {
651+
if (npages != -EAGAIN)
652+
pr_warn("fail to get %zu user pages with error %d\n", gup_num_pages, npages);
653+
else
654+
pr_debug("fail to get %zu user pages with error %d\n", gup_num_pages, npages);
651655
break;
656+
}
652657

653658
bcnt -= min_t(size_t, npages << PAGE_SHIFT, bcnt);
654659
mutex_lock(&umem_odp->umem_mutex);
@@ -666,8 +671,13 @@ int ib_umem_odp_map_dma_pages(struct ib_umem_odp *umem_odp, u64 user_virt,
666671
ret = ib_umem_odp_map_dma_single_page(
667672
umem_odp, k, local_page_list[j],
668673
access_mask, current_seq);
669-
if (ret < 0)
674+
if (ret < 0) {
675+
if (ret != -EAGAIN)
676+
pr_warn("ib_umem_odp_map_dma_single_page failed with error %d\n", ret);
677+
else
678+
pr_debug("ib_umem_odp_map_dma_single_page failed with error %d\n", ret);
670679
break;
680+
}
671681

672682
p = page_to_phys(local_page_list[j]);
673683
k++;

drivers/infiniband/hw/mlx5/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
obj-$(CONFIG_MLX5_INFINIBAND) += mlx5_ib.o
22

3-
mlx5_ib-y := main.o cq.o doorbell.o qp.o mem.o srq.o mr.o ah.o mad.o gsi.o ib_virt.o cmd.o cong.o
3+
mlx5_ib-y := main.o cq.o doorbell.o qp.o mem.o srq_cmd.o \
4+
srq.o mr.o ah.o mad.o gsi.o ib_virt.o cmd.o \
5+
cong.o
46
mlx5_ib-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += odp.o
57
mlx5_ib-$(CONFIG_MLX5_ESWITCH) += ib_rep.o
68
mlx5_ib-$(CONFIG_INFINIBAND_USER_ACCESS) += devx.o

drivers/infiniband/hw/mlx5/cq.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <rdma/ib_user_verbs.h>
3636
#include <rdma/ib_cache.h>
3737
#include "mlx5_ib.h"
38+
#include "srq.h"
3839

3940
static void mlx5_ib_cq_comp(struct mlx5_core_cq *cq)
4041
{
@@ -81,7 +82,7 @@ static void *get_sw_cqe(struct mlx5_ib_cq *cq, int n)
8182

8283
cqe64 = (cq->mcq.cqe_sz == 64) ? cqe : cqe + 64;
8384

84-
if (likely((cqe64->op_own) >> 4 != MLX5_CQE_INVALID) &&
85+
if (likely(get_cqe_opcode(cqe64) != MLX5_CQE_INVALID) &&
8586
!((cqe64->op_own & MLX5_CQE_OWNER_MASK) ^ !!(n & (cq->ibcq.cqe + 1)))) {
8687
return cqe;
8788
} else {
@@ -177,8 +178,7 @@ static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe,
177178
struct mlx5_core_srq *msrq = NULL;
178179

179180
if (qp->ibqp.xrcd) {
180-
msrq = mlx5_core_get_srq(dev->mdev,
181-
be32_to_cpu(cqe->srqn));
181+
msrq = mlx5_cmd_get_srq(dev, be32_to_cpu(cqe->srqn));
182182
srq = to_mibsrq(msrq);
183183
} else {
184184
srq = to_msrq(qp->ibqp.srq);
@@ -197,7 +197,7 @@ static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe,
197197
}
198198
wc->byte_len = be32_to_cpu(cqe->byte_cnt);
199199

200-
switch (cqe->op_own >> 4) {
200+
switch (get_cqe_opcode(cqe)) {
201201
case MLX5_CQE_RESP_WR_IMM:
202202
wc->opcode = IB_WC_RECV_RDMA_WITH_IMM;
203203
wc->wc_flags = IB_WC_WITH_IMM;
@@ -537,7 +537,7 @@ static int mlx5_poll_one(struct mlx5_ib_cq *cq,
537537
*/
538538
rmb();
539539

540-
opcode = cqe64->op_own >> 4;
540+
opcode = get_cqe_opcode(cqe64);
541541
if (unlikely(opcode == MLX5_CQE_RESIZE_CQ)) {
542542
if (likely(cq->resize_buf)) {
543543
free_cq_buf(dev, &cq->buf);
@@ -1295,7 +1295,7 @@ static int copy_resize_cqes(struct mlx5_ib_cq *cq)
12951295
return -EINVAL;
12961296
}
12971297

1298-
while ((scqe64->op_own >> 4) != MLX5_CQE_RESIZE_CQ) {
1298+
while (get_cqe_opcode(scqe64) != MLX5_CQE_RESIZE_CQ) {
12991299
dcqe = mlx5_frag_buf_get_wqe(&cq->resize_buf->fbc,
13001300
(i + 1) & cq->resize_buf->nent);
13011301
dcqe64 = dsize == 64 ? dcqe : dcqe + 64;

drivers/infiniband/hw/mlx5/ib_rep.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#include "ib_rep.h"
7+
#include "srq.h"
78

89
static const struct mlx5_ib_profile rep_profile = {
910
STAGE_CREATE(MLX5_IB_STAGE_INIT,
@@ -21,6 +22,9 @@ static const struct mlx5_ib_profile rep_profile = {
2122
STAGE_CREATE(MLX5_IB_STAGE_ROCE,
2223
mlx5_ib_stage_rep_roce_init,
2324
mlx5_ib_stage_rep_roce_cleanup),
25+
STAGE_CREATE(MLX5_IB_STAGE_SRQ,
26+
mlx5_init_srq_table,
27+
mlx5_cleanup_srq_table),
2428
STAGE_CREATE(MLX5_IB_STAGE_DEVICE_RESOURCES,
2529
mlx5_ib_stage_dev_res_init,
2630
mlx5_ib_stage_dev_res_cleanup),

0 commit comments

Comments
 (0)