[ofa-general] Re: [PATCH 2/3] Add combined routing support to libibnetdisc

Ira Weiny weiny2 at llnl.gov
Tue May 5 14:19:40 PDT 2009


On Tue, 5 May 2009 23:15:39 +0300
Sasha Khapyorsky <sashak at voltaire.com> wrote:

> On 14:29 Thu 30 Apr     , Ira Weiny wrote:
> >  
> >  static int
> > -extend_dpath(struct ibnd_fabric *f, ib_dr_path_t *path, int nextport)
> > +extend_dpath(struct ibnd_fabric *f, ib_portid_t *portid, int nextport)
> >  {
> > -	int rc = add_port_to_dpath(path, nextport);
> > -	if ((rc != -1) && (path->cnt > f->fabric.maxhops_discovered))
> > -		f->fabric.maxhops_discovered = path->cnt;
> > +	int rc = 0;
> > +
> > +	if (portid->lid && !portid->drpath.drslid) {
> > +		/* If we were LID routed
> > +		 * AND have not done so already
> > +		 * we need to set up the drslid
> > +		 */
> > +		ib_portid_t selfportid = { 0 };
> > +		if (ib_resolve_self_via(&selfportid, NULL, NULL, f->fabric.ibmad_port) < 0)
> > +			return -1;
> > +		portid->drpath.drslid = selfportid.lid;
> > +		portid->drpath.drdlid = 0xFFFF;
> 
> How does it work? Shouldn't be portid->drpath.drslid = portid->lid? What
> am I missing?

Using a combined route where we are starting at some remote node.  We have to
use a directed route which does not start at "our" requester node.  From the
spec. C14-6 "bullet 6" states:

   "... If the directed route does not start from the requester node, then
   DrSLID shall be set to the LID of the requester node, which must have been
   assigned."

The requester node is "self" in this case.  If the DRSLID was set to the
portid->lid then the response would not come back to us because portid->lid is
the LID of the remote node we are starting the DR Path at.

Ira

> 
> Sasha
> 
> > +	}
> > +
> > +	rc = add_port_to_dpath(&portid->drpath, nextport);
> > +
> > +	if ((rc != -1) && (portid->drpath.cnt > f->fabric.maxhops_discovered))
> > +		f->fabric.maxhops_discovered = portid->drpath.cnt;
> >  	return (rc);
> >  }
> >  
> > @@ -447,7 +462,7 @@ get_remote_node(struct ibnd_fabric *fabric, struct ibnd_node *node, struct ibnd_
> >  			!= IB_PORT_PHYS_STATE_LINKUP)
> >  		return -1;
> >  
> > -	if (extend_dpath(fabric, &path->drpath, portnum) < 0)
> > +	if (extend_dpath(fabric, path, portnum) < 0)
> >  		return -1;
> >  
> >  	if (query_node(fabric, &node_buf, &port_buf, path)) {
> > @@ -546,8 +561,7 @@ ibnd_discover_fabric(struct ibmad_port *ibmad_port, int timeout_ms,
> >  	if (!port)
> >  		IBPANIC("out of memory");
> >  
> > -	if (node->node.type != IB_NODE_SWITCH &&
> > -	    get_remote_node(fabric, node, port, from,
> > +	if(get_remote_node(fabric, node, port, from,
> >  				mad_get_field(node->node.info, 0, IB_NODE_LOCAL_PORT_F),
> >  				0) < 0)
> >  		return ((ibnd_fabric_t *)fabric);
> > -- 
> > 1.5.4.5
> > 


-- 
Ira Weiny
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
weiny2 at llnl.gov



More information about the general mailing list