[ofa-general] Does ib0 always map to port1?

David Dillow dave at thedillows.org
Thu Jan 22 04:59:20 PST 2009


On Thu, 2009-01-22 at 10:18 +0200, Dotan Barak wrote:
> On Thu, Jan 22, 2009 at 9:45 AM, Or Gerlitz <ogerlitz at voltaire.com> wrote:
> > Sumeet Lahorani wrote:
> >>
> >> I see that ib0 always maps to port1 and ib1 always maps to port2 on the
> >> HCA. I'm trying to find out if this will always be the case and if so which
> >> script ensures this mapping?
> >
> > Yes, on a dual ported HCA, ib0 maps to port1 and ib1 to port2, this is a
> > property of the ipoib driver regardless of which HW is used, see
> > drivers/infiniband/ulps/ipoib/ipoib_main :: ipoib_add_one()
> >
> 
> Part of the "MAC" address of the I/F is the port GUID, so you can use
> this value to determine which HCA.port is mapped to that I/Fs...
> (if there are several HCAs in the same host, this can be very useful ...)

This is the better way to go for general use, as it is entirely possible
for a user to change the device names such that ib0 swaps with ib1:

ip link set ib0 name ib0_rename
ip link set ib1 name ib0
ip link set ib0_rename ib1

Now, it is probably not very likely that a user will do this, but
Dotan's right that it can get fun when there are multiple HCA's, so it
is a good idea in any event.



More information about the general mailing list