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

Sasha Khapyorsky sashak at voltaire.com
Tue May 5 13:15:39 PDT 2009


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?

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
> 



More information about the general mailing list