[openib-general] Re: [IBAT] interface numbering assumption

Hal Rosenstock halr at voltaire.com
Fri Sep 23 07:10:33 PDT 2005


On Thu, 2005-09-22 at 12:29, James Lentini wrote:
> Hal,
> 
> IBAT's resolve_ip function assumes that network interfaces are 
> consecutively numbered, see at.c line 1691.

Yes, I see that code but not at line 1691 but your point is valid.

> One of my machines ended up with the following configuration:
> 
> # ls /sys/class/net/
> eth0  eth1  ib0  ib1  lo  sit0
> # cat /sys/class/net/lo/ifindex 
> 1
> # cat /sys/class/net/eth0/ifindex 
> 2
> # cat /sys/class/net/eth1/ifindex 
> 3
> # cat /sys/class/net/sit0/ifindex 
> 4
> # cat /sys/class/net/ib0/ifindex 
> 9
> # cat /sys/class/net/ib1/ifindex 
> 10
> 
> I'm not sure how this happened.

Yes, holes in the interface numbering are possible due to interface
removal and addition.

> As a result, the for loop on line 1691 exited before finding an IPoIB 
> device.
> 
> A quick reboot fixed the problem.
> 
> Is there a better way to enumerate all of the network inferaces? I 
> believe that is what this for loop is attempting to accomplish.

Yes. I think that the net_device list from dev_base could be walked
instead and that would resolve this issue.

-- Hal




More information about the general mailing list