[ofw] IBAL CM ignores responder resources of the passive side

Leonid Keller leonid at mellanox.co.il
Wed Jun 22 08:46:50 PDT 2011


Hi guys,

Shortly:
As far as understand, IBAL CM ignores responder resources of the passive side and use the active side InitDepth as an ultimate value for the responder resources.
It's look like a bug.

Details:
Look at __save_user_rep(), which stores REP data into the CEP.
It trims p_cep->resp_res in case it exceeds the HW capabilities.
Then CM uses this field to set REP MAD resp_res field.
For some reason __save_user_rep() doesn't look at p_cm_rep->resp_res field, which claims the amount of responder resources the passive side is ready to allocate.

static void
__save_user_rep(
                IN                                                           cep_agent_t* const                                       p_port_cep,
                IN                                                           kcep_t* const                                                   p_cep,
                IN                           const     iba_cm_rep* const                                         p_cm_rep,
                IN                                                           uint8_t                                                                                 rnr_nak_timeout )
{
                AL_ENTER( AL_DBG_CM );

                p_cep->local_qpn = p_cm_rep->qpn;
                p_cep->rq_psn = p_cm_rep->starting_psn;
                p_cep->init_depth = p_cm_rep->init_depth;

                ci_ca_lock_attr( p_port_cep->h_ca->obj.p_ci_ca );
                /* Check the CA's responder resource max and trim if necessary. */
                if( p_port_cep->h_ca->obj.p_ci_ca->p_pnp_attr->max_qp_resp_res <
                                p_cep->resp_res )
                {
                                /*
                                 * The CA cannot handle the requested responder resources.
                                 * Set the response to the CA's maximum.
                                 */
                                p_cep->resp_res =
                                                p_port_cep->h_ca->obj.p_ci_ca->p_pnp_attr->max_qp_resp_res;
                }

                ci_ca_unlock_attr( p_port_cep->h_ca->obj.p_ci_ca );

                p_cep->rnr_nak_timeout = rnr_nak_timeout;

                AL_EXIT( AL_DBG_CM );
}

I suggest to fix it the following way. What do you think ?

static void
__save_user_rep(
                IN                                                           cep_agent_t* const                                       p_port_cep,
                IN                                                           kcep_t* const                                                   p_cep,
                IN                           const     iba_cm_rep* const                                         p_cm_rep,
                IN                                                           uint8_t                                                                                 rnr_nak_timeout )
{
                AL_ENTER( AL_DBG_CM );

                p_cep->local_qpn = p_cm_rep->qpn;
                p_cep->rq_psn = p_cm_rep->starting_psn;
                p_cep->init_depth = p_cm_rep->init_depth;

                ci_ca_lock_attr( p_port_cep->h_ca->obj.p_ci_ca );
                /* Check the CA's responder resource max and trim if necessary. */
                if( p_port_cep->h_ca->obj.p_ci_ca->p_pnp_attr->max_qp_resp_res <
                                p_cep->resp_res )
                {
                                /*
                                 * The CA cannot handle the requested responder resources.
                                 * Set the response to the CA's maximum.
                                 */
                                p_cep->resp_res =
                                                p_port_cep->h_ca->obj.p_ci_ca->p_pnp_attr->max_qp_resp_res;
                }

                /* set responder resources, claimed by Accept, if they are less then Connect ones */
                if ( p_cm_rep->resp_res && (p_cep->resp_res > p_cm_rep->resp_res) )
                                p_cep->resp_res = p_cm_rep->resp_res;

                ci_ca_unlock_attr( p_port_cep->h_ca->obj.p_ci_ca );

                p_cep->rnr_nak_timeout = rnr_nak_timeout;

                AL_EXIT( AL_DBG_CM );
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20110622/f8d02e7b/attachment.html>


More information about the ofw mailing list