[openib-general] [PATCH] [CM] 1/2 Fix CM redirection

Fab Tillier ftillier at silverstorm.com
Wed Sep 7 11:42:25 PDT 2005


> From: John Kingman [mailto:kingman at storagegear.com]
> Sent: Wednesday, September 07, 2005 10:09 AM
> 
> I found that CM handling for SRP is broken when handling a REJ with
> reason 24 (Port and CM Redirection) with a RedirectLID supplied.  As
> stated in the spec, if RedirectLID is non-zero, it is the DLID a
> requester _shall_ use to access the class services.  I believe that
> without this support, CM does not comply with C13-28 with respect to
> RedirectLID.
> 
> In my testing, the following patches seem to fix the problem.  If there
> is a better way to fix the problem, I would appreciate the input.
> 
> Signed-off-by: John Kingman <kingman <at> storagegear.com>
> 
> Index: ib_cm.h
> ===================================================================
> --- ib_cm.h	(revision 3328)
> +++ ib_cm.h	(working copy)
> @@ -290,6 +290,7 @@ struct ib_cm_id {
>  	enum ib_cm_lap_state	lap_state;	/* internal CM/debug use */
>  	__be32			local_id;
>  	__be32			remote_id;
> +	u32			redirect_qpn;
>  };
> 
>  /**
> 
> Index: cm.c
> ===================================================================
> --- cm.c	(revision 3328)
> +++ cm.c	(working copy)
> @@ -167,13 +167,14 @@ static int cm_alloc_msg(struct cm_id_pri
>  	struct ib_mad_agent *mad_agent;
>  	struct ib_mad_send_buf *m;
>  	struct ib_ah *ah;
> +	u32    qpn = cm_id_priv->id.redirect_qpn? cm_id_priv->id.redirect_qpn:
> 1;
> 
>  	mad_agent = cm_id_priv->av.port->mad_agent;
>  	ah = ib_create_ah(mad_agent->qp->pd, &cm_id_priv->av.ah_attr);
>  	if (IS_ERR(ah))
>  		return PTR_ERR(ah);
> 
> -	m = ib_create_send_mad(mad_agent, 1, cm_id_priv->av.pkey_index,
> +	m = ib_create_send_mad(mad_agent, qpn, cm_id_priv->av.pkey_index,
>  			       ah, 0, sizeof(struct ib_mad_hdr),
>  			       sizeof(struct ib_mad)-sizeof(struct ib_mad_hdr),
>  			       GFP_ATOMIC);

Why not just initialize redirect_qpn to 1 and just use it always?




More information about the general mailing list