* network interface to driver and pci slot mapping
@ 2004-11-11 21:28 Anthony Samsung
2004-11-11 21:48 ` linux-os
2004-11-12 0:56 ` Greg KH
0 siblings, 2 replies; 7+ messages in thread
From: Anthony Samsung @ 2004-11-11 21:28 UTC (permalink / raw)
To: linux-kernel
Given an interface name (like eth0), how do I determine:
The name of the driver (module) for this interface.
The PCI address for this interface, if relevant.
?
I need something that works non-destructively on a live system, that
isn't broken by nameif, and has a strong chance of producing a correct
result. In particular, parsing syslog is out. There's no consistency
in the format of messages and there's no guarantee the logs from
bootup will still be around. And the interface may have been renamed
since then.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: network interface to driver and pci slot mapping
2004-11-11 21:28 network interface to driver and pci slot mapping Anthony Samsung
@ 2004-11-11 21:48 ` linux-os
2004-11-11 22:34 ` Måns Rullgård
2004-11-12 0:56 ` Greg KH
1 sibling, 1 reply; 7+ messages in thread
From: linux-os @ 2004-11-11 21:48 UTC (permalink / raw)
To: Anthony Samsung; +Cc: linux-kernel
On Thu, 11 Nov 2004, Anthony Samsung wrote:
> Given an interface name (like eth0), how do I determine:
> The name of the driver (module) for this interface.
> The PCI address for this interface, if relevant.
>
> ?
>
> I need something that works non-destructively on a live system, that
> isn't broken by nameif, and has a strong chance of producing a correct
> result. In particular, parsing syslog is out. There's no consistency
> in the format of messages and there's no guarantee the logs from
> bootup will still be around. And the interface may have been renamed
> since then.
If the eth0 device is a module, it's in /etc/modprobe.conf, previous
versions used /etc/modules.conf.
Once you have its module name you can use other resources like
/sys/bus/pci/drivers/MODULENAME
Cheers,
Dick Johnson
Penguin : Linux version 2.6.9 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by John Ashcroft.
98.36% of all statistics are fiction.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: network interface to driver and pci slot mapping
@ 2004-11-11 21:49 Jean Tourrilhes
0 siblings, 0 replies; 7+ messages in thread
From: Jean Tourrilhes @ 2004-11-11 21:49 UTC (permalink / raw)
To: Linux kernel mailing list, Anthony Samsung
Anthony Samsung wrote :
>
> Given an interface name (like eth0), how do I determine:
> The name of the driver (module) for this interface.
> The PCI address for this interface, if relevant.
>
> ?
ethtool -i. Unfortunately, not yet implemented in all driver,
but Jeff is on the case.
There might also be a sysfs way to do it, but it probably
involve lot's a grep or similar magic.
> I need something that works non-destructively on a live system, that
> isn't broken by nameif, and has a strong chance of producing a correct
> result. In particular, parsing syslog is out. There's no consistency
> in the format of messages and there's no guarantee the logs from
> bootup will still be around. And the interface may have been renamed
> since then.
ifrename allow you to rename interfaces based on both driver
name and PCI address, so another option is to make sure interface
names are consistent and meaningful.
Have fun...
Jean
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: network interface to driver and pci slot mapping
2004-11-11 21:48 ` linux-os
@ 2004-11-11 22:34 ` Måns Rullgård
2004-11-11 22:51 ` Jeff Garzik
0 siblings, 1 reply; 7+ messages in thread
From: Måns Rullgård @ 2004-11-11 22:34 UTC (permalink / raw)
To: linux-kernel
linux-os <linux-os@chaos.analogic.com> writes:
> If the eth0 device is a module, it's in /etc/modprobe.conf, previous
> versions used /etc/modules.conf.
> Once you have its module name you can use other resources like
>
> /sys/bus/pci/drivers/MODULENAME
On my systems, hotplug loads the modules automatically, so there is
no mention of them anywhere.
--
Måns Rullgård
mru@inprovide.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: network interface to driver and pci slot mapping
2004-11-11 22:34 ` Måns Rullgård
@ 2004-11-11 22:51 ` Jeff Garzik
0 siblings, 0 replies; 7+ messages in thread
From: Jeff Garzik @ 2004-11-11 22:51 UTC (permalink / raw)
To: Måns Rullgård; +Cc: linux-kernel
Måns Rullgård wrote:
> linux-os <linux-os@chaos.analogic.com> writes:
>
>
>>If the eth0 device is a module, it's in /etc/modprobe.conf, previous
>>versions used /etc/modules.conf.
>>Once you have its module name you can use other resources like
>>
>>/sys/bus/pci/drivers/MODULENAME
>
>
> On my systems, hotplug loads the modules automatically, so there is
> no mention of them anywhere.
Use ethtool.
Jeff
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: network interface to driver and pci slot mapping
2004-11-11 21:28 network interface to driver and pci slot mapping Anthony Samsung
2004-11-11 21:48 ` linux-os
@ 2004-11-12 0:56 ` Greg KH
2004-11-12 3:43 ` Daniel Stekloff
1 sibling, 1 reply; 7+ messages in thread
From: Greg KH @ 2004-11-12 0:56 UTC (permalink / raw)
To: Anthony Samsung; +Cc: linux-kernel
On Thu, Nov 11, 2004 at 04:28:35PM -0500, Anthony Samsung wrote:
> Given an interface name (like eth0), how do I determine:
> The name of the driver (module) for this interface.
> The PCI address for this interface, if relevant.
Use sysfs. All of this information is there (well, the driver link back
to the module isn't there for most PCI drivers, but the functionality is
there if the drivers are modified to support it...)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: network interface to driver and pci slot mapping
2004-11-12 0:56 ` Greg KH
@ 2004-11-12 3:43 ` Daniel Stekloff
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Stekloff @ 2004-11-12 3:43 UTC (permalink / raw)
To: Greg KH; +Cc: Anthony Samsung, linux-kernel
On Thu, 2004-11-11 at 16:56, Greg KH wrote:
> On Thu, Nov 11, 2004 at 04:28:35PM -0500, Anthony Samsung wrote:
> > Given an interface name (like eth0), how do I determine:
> > The name of the driver (module) for this interface.
> > The PCI address for this interface, if relevant.
>
> Use sysfs. All of this information is there (well, the driver link back
> to the module isn't there for most PCI drivers, but the functionality is
> there if the drivers are modified to support it...)
If you're going to use sysfs, libsysfs can help. It can be found in the
sysfsutils package here:
http://linux-diag.sourceforge.net/Sysfsutils.html
[stekloff@... stekloff]$ systool -c net eth0 -D
Class = "net"
Class Device = "eth0"
Device = "0000:02:01.0"
Driver = "e1000"
Devices using "e1000" are:
Device = "0000:02:01.0"
And more extended output:
[stekloff@... stekloff]$ systool -c net eth0 -v
Class = "net"
Class Device = "eth0"
Class Device path = "/sys/class/net/eth0"
addr_len = "6"
address = "00:0d:60:c9:42:06"
broadcast = "ff:ff:ff:ff:ff:ff"
features = "0x3a9"
flags = "0x1002"
ifindex = "6"
iflink = "6"
mtu = "1500"
tx_queue_len = "1000"
type = "1"
Device = "0000:02:01.0"
Device path = "/sys/devices/pci0000:00/0000:00:1e.0/0000:02:01.0"
class = "0x020000"
config = 86 80 1e 10 17 01 30 02 03 00 00 02 08 40
00 00
00 00 24 c0 00 00 20 c0 01 80 00 00 00 00
00 00
00 00 00 00 00 00 00 00 22 00 00 00 14 10
49 05
00 00 00 00 dc 00 00 00 00 00 00 00 0b 01
ff 00
detach_state = "0"
device = "0x101e"
irq = "11"
resource = "0x00000000c0240000 0x00000000c025ffff
0x0000000000000200
0x00000000c0200000 0x00000000c020ffff 0x0000000000000200
0x0000000000008000 0x000000000000803f 0x0000000000000101
0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000 0x000000000000ffff 0x0000000000007200"
subsystem_device = "0x0549"
subsystem_vendor = "0x1014"
vendor = "0x8086"
Driver = "e1000"
Driver path = "/sys/bus/pci/drivers/e1000"
new_id = <store method only>
Devices using "e1000" are:
"0000:02:01.0"
Thanks,
Dan
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-11-12 3:41 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-11 21:28 network interface to driver and pci slot mapping Anthony Samsung
2004-11-11 21:48 ` linux-os
2004-11-11 22:34 ` Måns Rullgård
2004-11-11 22:51 ` Jeff Garzik
2004-11-12 0:56 ` Greg KH
2004-11-12 3:43 ` Daniel Stekloff
-- strict thread matches above, loose matches on Subject: below --
2004-11-11 21:49 Jean Tourrilhes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox