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

Dotan Barak dotanba at gmail.com
Thu Jan 22 09:28:57 PST 2009


Try to check the value of the MAC address using "ip addr" (i don't 
remember the full command) and not using ifconfig.
This will be more accurate.

Dotan

Sumeet Lahorani wrote:
>
> Thanks all. When I look at the ifconfig ib0 output, it looks as though 
> only the first 6 bytes of the HWaddr are printed correctly and the 
> rest are 0's.
>
> ib0       Link encap:InfiniBand  HWaddr 
> 80:00:00:48:FE:80:00:00:00:00:00:00:00:00:00:00:00:00:00:00          
> inet6 addr: fe80::21e:bff:ff4c:8a2d/64 Scope:Link
>          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
>          RX packets:7359 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:7054 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:256
>          RX bytes:974584 (951.7 KiB)  TX bytes:562068 (548.8 KiB)
>
> The IPv6 address seems to more closely match the GUID of the port
>
> # ibstatus
> Infiniband device 'mlx4_0' port 1 status:
>        default gid:     fe80:0000:0000:0000:001e:0bff:ff4c:8a2d
>        base lid:        0x1f
>        sm lid:          0x4
>        state:           4: ACTIVE
>        phys state:      5: LinkUp
>        rate:            20 Gb/sec (4X DDR)
>
> But this is not an exact match either (0x21e vs 0x1e). Is there 
> another command (apart from ifconfig) I can use to get a better match?
>
> - Sumeet
>
> David Dillow wrote:
>> 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