Open MPI logo

Hardware Locality Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Development mailing list

Subject: Re: [hwloc-devel] PCI device name question
From: Brice Goglin (Brice.Goglin_at_[hidden])
Date: 2012-03-20 17:07:25


Le 20/03/2012 21:48, Jeffrey Squyres a écrit :
> On Mar 20, 2012, at 3:45 PM, Brice Goglin wrote:
>
>> That looks good to me, as long as starting port numbers to 1 for
>> non-IB/OFED is OK.
>
> Hmm. Not sure about that. I always thought it was strange that IB devices started with port 1.
>
> Are *we* (hwloc) supplying the port number, or are you getting it from /sys somewhere?
>
> (/me reads the patch and ibdev2netdev...)
>
> Ah, I see -- we're effectively doing the same thing as the ibdev2netdev script:
>
> -----
> port=$(cat /sys/class/net/$eth/dev_id)
> port=$(printf "%d" $port)
> port=$(( port + 1 ))
> -----
>
> Hrm. I don't know if the +1 is a good assumption to make in general.

Yeah the kernel code tells me that this +1 is really IB specific. dev_id
was initially added for shared NIC, each client gets a different dev_id
(starting at 0). It was later used by IB guys to identify ports 1 and 2
(each port gets a netdevice and they all share the same hardware device,
so they used dev_id as well).

New patch attached, it doesn't add port numbers for non-IB devices.

Brice