Commit 638ef7a6 authored by Sean Hefty's avatar Sean Hefty Committed by Roland Dreier

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: default avatarSean Hefty <sean.hefty@intel.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 2d2e9415
...@@ -276,7 +276,7 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id, ...@@ -276,7 +276,7 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id,
ucma_set_event_context(ctx, event, uevent); ucma_set_event_context(ctx, event, uevent);
uevent->resp.event = event->event; uevent->resp.event = event->event;
uevent->resp.status = event->status; uevent->resp.status = event->status;
if (cm_id->ps == RDMA_PS_UDP || cm_id->ps == RDMA_PS_IPOIB) if (cm_id->qp_type == IB_QPT_UD)
ucma_copy_ud_event(&uevent->resp.param.ud, &event->param.ud); ucma_copy_ud_event(&uevent->resp.param.ud, &event->param.ud);
else else
ucma_copy_conn_event(&uevent->resp.param.conn, 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,6 +377,9 @@ static int ucma_get_qp_type(struct rdma_ucm_create_id *cmd, enum ib_qp_type *qp_
case RDMA_PS_IPOIB: case RDMA_PS_IPOIB:
*qp_type = IB_QPT_UD; *qp_type = IB_QPT_UD;
return 0; return 0;
case RDMA_PS_IB:
*qp_type = cmd->qp_type;
return 0;
default: default:
return -EINVAL; return -EINVAL;
} }
......
...@@ -77,7 +77,8 @@ struct rdma_ucm_create_id { ...@@ -77,7 +77,8 @@ struct rdma_ucm_create_id {
__u64 uid; __u64 uid;
__u64 response; __u64 response;
__u16 ps; __u16 ps;
__u8 reserved[6]; __u8 qp_type;
__u8 reserved[5];
}; };
struct rdma_ucm_create_id_resp { struct rdma_ucm_create_id_resp {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment