Re: Questions regarding CMA
From: Jack Morgenstein <hidden>
Date: 2011-07-17 07:08:53
On Thursday 14 July 2011 20:46, Hefty, Sean wrote:
Although it's a minor performance gain, I'm leaning towards keeping id_priv->cm_id.ib = NULL on failure, either by resetting it or using a local variable. cma_has_cm_dev() can then be replaced by checking id_priv->cm_id.ib for non-NULL, and checks for IS_ERR(id_priv->cm_id.ib) are removed.quoted
Please consider the patch below as a starting point (I did not touch the iwarp code). Please let me know (ASAP) what you think. (I still leave a window here where id_priv->cm_id.ib is ERR. Is this a problem? Would it be better to use a local variable instead of id_priv->cm_id.ib, and only assign to id_priv->cm_id.ib when all the error checks have passed? This would leave a window where a successful cm_id creation is not immediately assigned to the CMA object -- would this be a problem?).Without adding more synchronization, we need to ensure that id_priv->cm_id.ib is set before a user can receive any callbacks. This restricts our use of a local variable to the create_cm_id calls only. See cma_connect_iw() for an example of using this approach.
Agreed. That way we never have to test for IS_ERR. I'll send a patch. -Jack -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html