[ofa-general] Re: [PATCH 1/4] rdma/addr: keep pointer to the netdevice in struct rdma_dev_addr

Roland Dreier rdreier at cisco.com
Sun Jul 6 21:49:26 PDT 2008


 > Keep a pointer to the local (src) netdevice in struct rdma_dev_addr. In a
 > High-Availability scheme this information can be used by the rdma-cm to align RDMA
 > sessions to use the same links as the IP stack does under fail-over and route change cases.

I don't understand how keeping the netdevice is related to this chunk:

 > --- infiniband.orig/drivers/infiniband/core/cma.c
 > +++ infiniband/drivers/infiniband/core/cma.c
 > @@ -1002,6 +1002,7 @@ static struct rdma_id_private *cma_new_c
 >  	union cma_ip_addr *src, *dst;
 >  	__be16 port;
 >  	u8 ip_ver;
 > +	int ret;
 > 
 >  	if (cma_get_net_info(ib_event->private_data, listen_id->ps,
 >  			     &ip_ver, &port, &src, &dst))
 > @@ -1026,10 +1027,11 @@ static struct rdma_id_private *cma_new_c
 >  	if (rt->num_paths == 2)
 >  		rt->path_rec[1] = *ib_event->param.req_rcvd.alternate_path;
 > 
 > -	ib_addr_set_sgid(&rt->addr.dev_addr, &rt->path_rec[0].sgid);
 >  	ib_addr_set_dgid(&rt->addr.dev_addr, &rt->path_rec[0].dgid);
 > -	ib_addr_set_pkey(&rt->addr.dev_addr, be16_to_cpu(rt->path_rec[0].pkey));
 > -	rt->addr.dev_addr.dev_type = RDMA_NODE_IB_CA;
 > +	ret = rdma_translate_ip(&id->route.addr.src_addr,
 > +				&id->route.addr.dev_addr);
 > +	if (ret)
 > +		goto destroy_id;
 > 
 >  	id_priv = container_of(id, struct rdma_id_private, id);
 >  	id_priv->state = CMA_CONNECT;



More information about the general mailing list