[ofa-general] [PATCH] IB/core - Don't modify outgoing DR SMP if first part is LID routed

Ralph Campbell ralph.campbell at qlogic.com
Wed Oct 17 15:44:18 PDT 2007


I need to double check too. I was thinking the packet
was originating on the node calling handle_outgoing_dr_smp()
and therefore, if there is a leading LID part, just send the
packet. But, if it is forwarding the MAD, I think the check is
more complex. It may be necessary for handle_outgoing_dr_smp()
to classify whether the packet should be sent, modify the
directed route hop_ptr, or process locally, etc.
similar to smi_check_forward_dr_smp().

On Wed, 2007-10-17 at 15:07 -0700, Sean Hefty wrote:
> Ralph Campbell wrote:
> > The code in handle_outgoing_dr_smp() checks to see if the directed
> > route SMP has an initial LID routed part and correctly does not
> > modify the hop pointer but it then proceeds to process the packet
> > as if there was no initial LID routed part.  Instead, if there
> > is an initial LID routed part, the packet should just be sent on
> > to the destination and not processed further since it can't be
> > destined for the local SM/SMA.
> 
> This makes sense to me at first read, but I need more time studying the 
> spec and existing code before reaching any conclusions.  Can't a DR SMP 
> be entirely LID routed, meaning that this SMP could be for the local 
> node?  (I know that doesn't seem to make sense, but is it permitted?)
> 
> > @@ -691,9 +691,10 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
> >  	 * If we are at the start of the LID routed part, don't update the
> >  	 * hop_ptr or hop_cnt.  See section 14.2.2, Vol 1 IB spec.
> >  	 */
> > -	if ((ib_get_smp_direction(smp) ? smp->dr_dlid : smp->dr_slid) ==
> > -	     IB_LID_PERMISSIVE &&
> > -	     smi_handle_dr_smp_send(smp, device->node_type, port_num) ==
> > +	if ((ib_get_smp_direction(smp) ? smp->dr_dlid : smp->dr_slid) !=
> > +	     IB_LID_PERMISSIVE)
> > +		goto out;
> 
> With this change, I would move the LID check up higher in the function, 
> to avoid setting the port_num as a minor nit optimization.
> 
> - Sean




More information about the general mailing list