aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorSean Hefty <sean.hefty@intel.com>2011-06-14 19:31:53 -0400
committerRoland Dreier <roland@purestorage.com>2011-10-13 12:40:36 -0400
commit638ef7a6c6a599b2e4c00ebf35d281721d2a42f6 (patch)
tree13a1e34b0c4cccbffba11ed71cad28bbcfd03fda /drivers/infiniband
parent2d2e94152928209de13dea0535242c0e457bdcbb (diff)
RDMA/ucm: Allow user to specify QP type when creating id
Allow the user to indicate the QP type separately from the port space when allocating an rdma_cm_id. With RDMA_PS_IB, there is no longer a 1:1 relationship between the QP type and port space, so we need to switch on the QP type to select between UD and connected QPs. Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/ucma.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 71be5eebd683..eb0a8e8a6943 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -276,7 +276,7 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id,
276 ucma_set_event_context(ctx, event, uevent); 276 ucma_set_event_context(ctx, event, uevent);
277 uevent->resp.event = event->event; 277 uevent->resp.event = event->event;
278 uevent->resp.status = event->status; 278 uevent->resp.status = event->status;
279 if (cm_id->ps == RDMA_PS_UDP || cm_id->ps == RDMA_PS_IPOIB) 279 if (cm_id->qp_type == IB_QPT_UD)
280 ucma_copy_ud_event(&uevent->resp.param.ud, &event->param.ud); 280 ucma_copy_ud_event(&uevent->resp.param.ud, &event->param.ud);
281 else 281 else
282 ucma_copy_conn_event(&uevent->resp.param.conn, 282 ucma_copy_conn_event(&uevent->resp.param.conn,
@@ -377,6 +377,9 @@ static int ucma_get_qp_type(struct rdma_ucm_create_id *cmd, enum ib_qp_type *qp_
377 case RDMA_PS_IPOIB: 377 case RDMA_PS_IPOIB:
378 *qp_type = IB_QPT_UD; 378 *qp_type = IB_QPT_UD;
379 return 0; 379 return 0;
380 case RDMA_PS_IB:
381 *qp_type = cmd->qp_type;
382 return 0;
380 default: 383 default:
381 return -EINVAL; 384 return -EINVAL;
382 } 385 }