summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/uverbs_cmd.c
diff options
context:
space:
mode:
authorDoug Ledford <dledford@redhat.com>2017-08-24 15:58:26 -0400
committerDoug Ledford <dledford@redhat.com>2017-08-24 15:58:26 -0400
commit732912c7386120179bf8f666febc232922e3ee17 (patch)
treee28dea126ed19c39c3a4eccff36687d5028bda9e /drivers/infiniband/core/uverbs_cmd.c
parente3bf14bdc17a8e917f337760cc7cacf3232d7dbc (diff)
parentec2558796d25e6024071b6bcb8e11392538d57bf (diff)
downloadlinux-0-day-732912c7386120179bf8f666febc232922e3ee17.tar.gz
linux-0-day-732912c7386120179bf8f666febc232922e3ee17.tar.xz
Merge branch 'k.o/for-4.13-rc' into k.o/for-next
Pick up -rc fixes. Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_cmd.c')
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index dc7d773a96ec8..59696f568f537 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -1550,6 +1550,7 @@ static int create_qp(struct ib_uverbs_file *file,
qp->qp_type = attr.qp_type;
atomic_set(&qp->usecnt, 0);
atomic_inc(&pd->usecnt);
+ qp->port = 0;
if (attr.send_cq)
atomic_inc(&attr.send_cq->usecnt);
if (attr.recv_cq)
@@ -1991,8 +1992,9 @@ static int modify_qp(struct ib_uverbs_file *file,
attr->alt_timeout = cmd->base.alt_timeout;
attr->rate_limit = cmd->rate_limit;
- attr->ah_attr.type = rdma_ah_find_type(qp->device,
- cmd->base.dest.port_num);
+ if (cmd->base.attr_mask & IB_QP_AV)
+ attr->ah_attr.type = rdma_ah_find_type(qp->device,
+ cmd->base.dest.port_num);
if (cmd->base.dest.is_global) {
rdma_ah_set_grh(&attr->ah_attr, NULL,
cmd->base.dest.flow_label,
@@ -2011,8 +2013,9 @@ static int modify_qp(struct ib_uverbs_file *file,
cmd->base.dest.port_num);
rdma_ah_set_make_grd(&attr->ah_attr, false);
- attr->alt_ah_attr.type = rdma_ah_find_type(qp->device,
- cmd->base.dest.port_num);
+ if (cmd->base.attr_mask & IB_QP_ALT_PATH)
+ attr->alt_ah_attr.type =
+ rdma_ah_find_type(qp->device, cmd->base.dest.port_num);
if (cmd->base.alt_dest.is_global) {
rdma_ah_set_grh(&attr->alt_ah_attr, NULL,
cmd->base.alt_dest.flow_label,