[ofa-general] RE: new API for the rdma-cma

Steve Wise swise at opengridcomputing.com
Wed Jan 16 07:33:22 PST 2008


Jason Gunthorpe wrote:
> On Tue, Jan 15, 2008 at 04:28:16PM -0800, Sean Hefty wrote:
>>> I'm prototyping this now (as part of our OMPI/rdma-cm/iwarp work).
>> I'm not sure about what the interface should be, since there could
>> be multiple addresses (IPv4 and IPv6) on a port.  As a generality,
>> my preference is to use sockaddr where possible.
> 
> Generally sockaddr alone for this kind of purpose is frowned on in my
> view since there is no portable way to get the address length, and all
> downstream functions require the length..
> 
> The best interface is something like getaddrinfo that returns a new
> type that has the family, address and length in the structure.
> 
> Also, your second version would require the address array to be of
> type sockaddr_storage, since sockaddr can only point to, not store
> addresses..
> 
> Jason

Jason, maybe the if_index is a good start like you said.

Regardless, I don't see any way to know which if_index (or even if_name) 
maps to which port on a multi-port rdma device.  The 
/sys/class/.../net:* entries show both port device if_names, but there 
is really no way to know which one is port 1 and which one is port 2. 
With interface renaming, it is not necessarily true, for example, given 
an rnic with 2 ports setup as eth1 and eth2, that eth1 maps to port 1 of 
a device and eth2 maps to port 2.  They could be renamed to anything. 
Does if_index remain constant?  IE maybe I can assume that the if_index 
ordering is the same as the port ordering.    So if a 2 port rnic, for 
example, has if indecies 2 and 3.  Then I can assume if_index 2 is port 
1 and if_index 3 is port 2.  Is that a valid assumption?  The other way 
to do this, I guess, is to look at port gids and map them back to the 
nic mac address.  But I was hoping for something easier.

Thoughts?



More information about the general mailing list