2001-12-31 16:06:57

by Girish Hilage

[permalink] [raw]
Subject: how to map network cards ?

Hello everybody,

This is my first mail to the list. I want to know, what /sbin/lspci outputs are nothing but the contents of '/proc/bus/pci/devices' in a readable form?

And if so how do I know which entry implies which network interface (e.g. eth0, eth1 etc.)?

Thanks,
girish


2001-12-31 16:21:07

by Jeff Garzik

[permalink] [raw]
Subject: Re: how to map network cards ?

Girish Hilage wrote:
>
> Hello everybody,
>
> This is my first mail to the list. I want to know, what /sbin/lspci outputs are nothing but the contents of '/proc/bus/pci/devices' in a readable form?
>
> And if so how do I know which entry implies which network interface (e.g. eth0, eth1 etc.)?


You can only figure out a network card<->PCI bus mapping using
ETHTOOL_GDRVINFO ioctl.

--
Jeff Garzik | Only so many songs can be sung
Building 1024 | with two lips, two lungs, and one tongue.
MandrakeSoft | - nomeansno

2001-12-31 16:32:37

by Jesse Pollard

[permalink] [raw]
Subject: Re: how to map network cards ?

Girish Hilage <[email protected]>:
>
> Hello everybody,
>
> This is my first mail to the list. I want to know, what /sbin/lspci outputs are nothing but the contents of '/proc/bus/pci/devices' in a readable form?
>
> And if so how do I know which entry implies which network interface (e.g. eth0, eth1 etc.)?

You don't.

There is no fixed method, though the following may help:

1. eth0 is assigned to the first device identified. This works if you have
multiple interfaces (using different drivers), then the order the drivers
are loaded will define which is eth0 - I do this for a system with
mixed 3c509 (ISA), and 3c905 (PCI) interfaces.
2. In a muli-interface environment with (say) two 3c509 - the order happens
to be in bus order. This has implied that the slot number it is plugged
in determines which is eth0. In my case a system has two PCI 3c905C
interfaces, the first at 00:0e.0, and the second at 00:0f.0. The 0e.0
interface appears as eth0.

Note: if one of the interfaces is unplugged/fails dramatically , the bus scan
will assign the FIRST interface located as eth0. The only way to determine
the ACTUAL eth0 is via mac number and trial and error.

I configure ONE interface (all others are down), then plug in to a working
network.

If I can ping the other machine then I know which network a given
interface is on - label it.

Now down that interface, and initialize another one. Repeat until all
interfaces are identified.
-------------------------------------------------------------------------
Jesse I Pollard, II
Email: [email protected]

Any opinions expressed are solely my own.

2001-12-31 16:41:08

by Jeff Garzik

[permalink] [raw]
Subject: Re: how to map network cards ?

Jesse Pollard wrote:
> The only way to determine
> the ACTUAL eth0 is via mac number and trial and error.

not correct, as noted in other e-mail.

> I configure ONE interface (all others are down), then plug in to a working
> network.
>
> If I can ping the other machine then I know which network a given
> interface is on - label it.
>
> Now down that interface, and initialize another one. Repeat until all
> interfaces are identified.

also note that one can rename interfaces, or in the future they might
appear out-of-order. To only way to be obsolutely certain where a
network device is on the PCI bus is ETHTOOL_GDRVINFO.

Jeff


--
Jeff Garzik | Only so many songs can be sung
Building 1024 | with two lips, two lungs, and one tongue.
MandrakeSoft | - nomeansno

2001-12-31 17:34:41

by Jesse Pollard

[permalink] [raw]
Subject: Re: how to map network cards ?

--------- Received message begins Here ---------

>
> Jesse Pollard wrote:
> > The only way to determine
> > the ACTUAL eth0 is via mac number and trial and error.
>
> not correct, as noted in other e-mail.
>
> > I configure ONE interface (all others are down), then plug in to a working
> > network.
> >
> > If I can ping the other machine then I know which network a given
> > interface is on - label it.
> >
> > Now down that interface, and initialize another one. Repeat until all
> > interfaces are identified.
>
> also note that one can rename interfaces, or in the future they might
> appear out-of-order. To only way to be obsolutely certain where a
> network device is on the PCI bus is ETHTOOL_GDRVINFO.
>
> Jeff

Does ETHTOOL_GDRVINFO work on ISA devices too? Last I knew it didn't. And
I do run a system with both PCI and ISA network cards.

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: [email protected]

Any opinions expressed are solely my own.

2001-12-31 17:42:01

by Jeff Garzik

[permalink] [raw]
Subject: Re: how to map network cards ?

Jesse Pollard wrote:
>
> --------- Received message begins Here ---------
>
> >
> > Jesse Pollard wrote:
> > > The only way to determine
> > > the ACTUAL eth0 is via mac number and trial and error.
> >
> > not correct, as noted in other e-mail.
> >
> > > I configure ONE interface (all others are down), then plug in to a working
> > > network.
> > >
> > > If I can ping the other machine then I know which network a given
> > > interface is on - label it.
> > >
> > > Now down that interface, and initialize another one. Repeat until all
> > > interfaces are identified.
> >
> > also note that one can rename interfaces, or in the future they might
> > appear out-of-order. To only way to be obsolutely certain where a
> > network device is on the PCI bus is ETHTOOL_GDRVINFO.
> >
> > Jeff
>
> Does ETHTOOL_GDRVINFO work on ISA devices too? Last I knew it didn't. And
> I do run a system with both PCI and ISA network cards.

The interface works fine with ISA, but it might not be implemented in
one particular driver or another. 2.4.18-pre1 supports some but not all
ISA drivers.

Jeff


--
Jeff Garzik | Only so many songs can be sung
Building 1024 | with two lips, two lungs, and one tongue.
MandrakeSoft | - nomeansno