Skip to content

Commit

Permalink
RDMA/iwcm: Propagate ird/ord values upwards
Browse files Browse the repository at this point in the history
Update struct iw_cm_event to support propagating the ird/ord values
upwards to the application.

Signed-off-by: Kumar Sanghvi <[email protected]>
Reviewed-by: Steve Wise <[email protected]>
Signed-off-by: Roland Dreier <[email protected]>
  • Loading branch information
Kumar Sanghvi authored and rolandd committed Oct 6, 2011
1 parent 9595480 commit 3ebeebc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions drivers/infiniband/core/cma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1340,6 +1340,8 @@ static int cma_iw_handler(struct iw_cm_id *iw_id, struct iw_cm_event *iw_event)
switch (iw_event->status) {
case 0:
event.event = RDMA_CM_EVENT_ESTABLISHED;
event.param.conn.initiator_depth = iw_event->ird;
event.param.conn.responder_resources = iw_event->ord;
break;
case -ECONNRESET:
case -ECONNREFUSED:
Expand All @@ -1355,6 +1357,8 @@ static int cma_iw_handler(struct iw_cm_id *iw_id, struct iw_cm_event *iw_event)
break;
case IW_CM_EVENT_ESTABLISHED:
event.event = RDMA_CM_EVENT_ESTABLISHED;
event.param.conn.initiator_depth = iw_event->ird;
event.param.conn.responder_resources = iw_event->ord;
break;
default:
BUG_ON(1);
Expand Down Expand Up @@ -1445,8 +1449,8 @@ static int iw_conn_req_handler(struct iw_cm_id *cm_id,
event.event = RDMA_CM_EVENT_CONNECT_REQUEST;
event.param.conn.private_data = iw_event->private_data;
event.param.conn.private_data_len = iw_event->private_data_len;
event.param.conn.initiator_depth = attr.max_qp_init_rd_atom;
event.param.conn.responder_resources = attr.max_qp_rd_atom;
event.param.conn.initiator_depth = iw_event->ird;
event.param.conn.responder_resources = iw_event->ord;

/*
* Protect against the user destroying conn_id from another thread
Expand Down
4 changes: 3 additions & 1 deletion include/rdma/iw_cm.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ struct iw_cm_event {
struct sockaddr_in local_addr;
struct sockaddr_in remote_addr;
void *private_data;
u8 private_data_len;
void *provider_data;
u8 private_data_len;
u8 ord;
u8 ird;
};

/**
Expand Down

0 comments on commit 3ebeebc

Please sign in to comment.