Sean Hefty wrote:
@@ -2167,6 +2170,12 @@ static int cma_sidr_rep_handler(struct i
event.status = ib_event->param.sidr_rep_rcvd.status;
break;
}
+ ret = cma_set_qkey(id_priv);
+ if (ret) {
+ event.event = RDMA_CM_EVENT_ADDR_ERROR;
+ event.status = -EINVAL;
+ break;
+ }
if (id_priv->qkey != rep->qkey) {
event.event = RDMA_CM_EVENT_UNREACHABLE;
event.status = -EINVAL;
@@ -2446,10 +2455,14 @@ static int cma_send_sidr_rep(struct rdma
const void *private_data, int private_data_len)
{
struct ib_cm_sidr_rep_param rep;
+ int ret;
memset(&rep, 0, sizeof rep);
rep.status = status;
if (status == IB_SIDR_SUCCESS) {
+ ret = cma_set_qkey(id_priv);
+ if (ret)
+ return ret;
rep.qp_num = id_priv->qp_num;
rep.qkey = id_priv->qkey;
}
Looking at this, I keep wanting to set the qkey when sending or receiving the
sidr req, not rep. This is earlier than the qkey is needed, but catching the
error sooner in this case seems better to me than deferring. Thoughts?
- Sean
It might be better to catch errors earlier, but there is the risk that the
flow might change somehow, and losing the (now obvious) logical connection
between retrieving the qkey and actually using it.
--
--Yossi
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general