Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma

Pull more rdma fixes from Doug Ledford:
"Well, I thought we were going to be done for this -rc cycle. I should
have known better than to say so though.

We have four additional items that trickled in.

One was a simple mistake on my part. I took a patch into my for-next
thinking that the issue was less severe than it was. I was then
notified that it needed to be in my -rc area instead.

The other three were just found late in testing.

Summary:

- One core fix accidentally applied first to for-next and then cherry
picked back because it needed to be in the -rc cycles instead

- Another core fix

- Two mlx5 fixes"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma:
IB/mlx5: Always return success for RoCE modify port
IB/mlx5: Fix Raw Packet QP event handler assignment
IB/core: Avoid accessing non-allocated memory when inferring port type
RDMA/uverbs: Initialize cq_context appropriately

+22 -6
+8 -5
drivers/infiniband/core/uverbs_cmd.c
··· 1015 1015 cq->uobject = &obj->uobject; 1016 1016 cq->comp_handler = ib_uverbs_comp_handler; 1017 1017 cq->event_handler = ib_uverbs_cq_event_handler; 1018 - cq->cq_context = &ev_file->ev_queue; 1018 + cq->cq_context = ev_file ? &ev_file->ev_queue : NULL; 1019 1019 atomic_set(&cq->usecnt, 0); 1020 1020 1021 1021 obj->uobject.object = cq; ··· 1522 1522 qp->qp_type = attr.qp_type; 1523 1523 atomic_set(&qp->usecnt, 0); 1524 1524 atomic_inc(&pd->usecnt); 1525 + qp->port = 0; 1525 1526 if (attr.send_cq) 1526 1527 atomic_inc(&attr.send_cq->usecnt); 1527 1528 if (attr.recv_cq) ··· 1963 1962 attr->alt_timeout = cmd->base.alt_timeout; 1964 1963 attr->rate_limit = cmd->rate_limit; 1965 1964 1966 - attr->ah_attr.type = rdma_ah_find_type(qp->device, 1967 - cmd->base.dest.port_num); 1965 + if (cmd->base.attr_mask & IB_QP_AV) 1966 + attr->ah_attr.type = rdma_ah_find_type(qp->device, 1967 + cmd->base.dest.port_num); 1968 1968 if (cmd->base.dest.is_global) { 1969 1969 rdma_ah_set_grh(&attr->ah_attr, NULL, 1970 1970 cmd->base.dest.flow_label, ··· 1983 1981 rdma_ah_set_port_num(&attr->ah_attr, 1984 1982 cmd->base.dest.port_num); 1985 1983 1986 - attr->alt_ah_attr.type = rdma_ah_find_type(qp->device, 1987 - cmd->base.dest.port_num); 1984 + if (cmd->base.attr_mask & IB_QP_ALT_PATH) 1985 + attr->alt_ah_attr.type = 1986 + rdma_ah_find_type(qp->device, cmd->base.dest.port_num); 1988 1987 if (cmd->base.alt_dest.is_global) { 1989 1988 rdma_ah_set_grh(&attr->alt_ah_attr, NULL, 1990 1989 cmd->base.alt_dest.flow_label,
+6 -1
drivers/infiniband/core/verbs.c
··· 838 838 spin_lock_init(&qp->mr_lock); 839 839 INIT_LIST_HEAD(&qp->rdma_mrs); 840 840 INIT_LIST_HEAD(&qp->sig_mrs); 841 + qp->port = 0; 841 842 842 843 if (qp_init_attr->qp_type == IB_QPT_XRC_TGT) 843 844 return ib_create_xrc_qp(qp, qp_init_attr); ··· 1298 1297 if (ret) 1299 1298 return ret; 1300 1299 } 1301 - return ib_security_modify_qp(qp, attr, attr_mask, udata); 1300 + ret = ib_security_modify_qp(qp, attr, attr_mask, udata); 1301 + if (!ret && (attr_mask & IB_QP_PORT)) 1302 + qp->port = attr->port_num; 1303 + 1304 + return ret; 1302 1305 } 1303 1306 EXPORT_SYMBOL(ib_modify_qp_with_udata); 1304 1307
+6
drivers/infiniband/hw/mlx5/main.c
··· 1085 1085 bool is_ib = (mlx5_ib_port_link_layer(ibdev, port) == 1086 1086 IB_LINK_LAYER_INFINIBAND); 1087 1087 1088 + /* CM layer calls ib_modify_port() regardless of the link layer. For 1089 + * Ethernet ports, qkey violation and Port capabilities are meaningless. 1090 + */ 1091 + if (!is_ib) 1092 + return 0; 1093 + 1088 1094 if (MLX5_CAP_GEN(dev->mdev, ib_virt) && is_ib) { 1089 1095 change_mask = props->clr_port_cap_mask | props->set_port_cap_mask; 1090 1096 value = ~props->clr_port_cap_mask | props->set_port_cap_mask;
+1
drivers/infiniband/hw/mlx5/qp.c
··· 1238 1238 goto err_destroy_tis; 1239 1239 1240 1240 sq->base.container_mibqp = qp; 1241 + sq->base.mqp.event = mlx5_ib_qp_event; 1241 1242 } 1242 1243 1243 1244 if (qp->rq.wqe_cnt) {
+1
include/rdma/ib_verbs.h
··· 1683 1683 enum ib_qp_type qp_type; 1684 1684 struct ib_rwq_ind_table *rwq_ind_tbl; 1685 1685 struct ib_qp_security *qp_sec; 1686 + u8 port; 1686 1687 }; 1687 1688 1688 1689 struct ib_mr {