* Linking interfaces to slots
@ 2003-10-03 12:11 Steve Modica
2003-10-03 13:37 ` David Brownell
0 siblings, 1 reply; 3+ messages in thread
From: Steve Modica @ 2003-10-03 12:11 UTC (permalink / raw)
To: netdev
Hi All,
If one wanted to figure out which ethX was in which PCI slot on which
bus, what would be the most acceptable mechanism? The drivers have
access to all this info, but then each driver would need some ioctl
added. Is there some more generic place in the kernel that could be
modified such that /proc/net/dev could hold this information?
Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Linking interfaces to slots
2003-10-03 12:11 Linking interfaces to slots Steve Modica
@ 2003-10-03 13:37 ` David Brownell
0 siblings, 0 replies; 3+ messages in thread
From: David Brownell @ 2003-10-03 13:37 UTC (permalink / raw)
To: Steve Modica; +Cc: netdev
Steve Modica wrote:
>
> If one wanted to figure out which ethX was in which PCI slot on which
> bus, what would be the most acceptable mechanism? The drivers have
> access to all this info, but then each driver would need some ioctl
> added. Is there some more generic place in the kernel that could be
> modified such that /proc/net/dev could hold this information?
On 2.6 there's /sys/class/net/ethX/device,
and ethtool_drvinfo.bus_info support should exist too...
- Dave
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Linking interfaces to slots
@ 2003-10-03 13:39 Linda Xie
0 siblings, 0 replies; 3+ messages in thread
From: Linda Xie @ 2003-10-03 13:39 UTC (permalink / raw)
To: Steve Modica; +Cc: netdev, netdev-bounce
Those information can be obtained by ls -l /sys/class/net/ethX. Here is a
example:
bigboylp4:/home/linda # ls -l /sys/class/net/eth*
/sys/class/net/eth0:
total 0
drwxr-xr-x 3 root root 0 2003-10-02 18:52 .
drwxr-xr-x 6 root root 0 2003-10-02 18:52 ..
-r--r--r-- 1 root root 4096 2003-10-02 18:52 addr_len
-r--r--r-- 1 root root 4096 2003-10-02 18:52 address
-r--r--r-- 1 root root 4096 2003-10-02 18:52 broadcast
lrwxrwxrwx 1 root root 53 2003-10-02 18:52 device ->
../../../devices/pci0005:00/0005:00:0b.2/0005:21:01.0 <-- pci dev
lrwxrwxrwx 1 root root 29 2003-10-02 18:52 driver ->
../../../bus/pci/drivers/e100
-r--r--r-- 1 root root 4096 2003-10-02 18:52 features
-rw-r--r-- 1 root root 4096 2003-10-02 18:52 flags
-r--r--r-- 1 root root 4096 2003-10-02 18:52 ifindex
-r--r--r-- 1 root root 4096 2003-10-02 18:52 iflink
-rw-r--r-- 1 root root 4096 2003-10-02 18:52 mtu
drwxr-xr-x 2 root root 0 2003-10-02 18:52 statistics
-rw-r--r-- 1 root root 4096 2003-10-02 18:52 tx_queue_len
-r--r--r-- 1 root root 4096 2003-10-02 18:52 type
/sys/class/net/eth1:
total 0
drwxr-xr-x 3 root root 0 2003-10-02 19:51 .
drwxr-xr-x 6 root root 0 2003-10-02 18:52 ..
-r--r--r-- 1 root root 4096 2003-10-02 19:51 addr_len
-r--r--r-- 1 root root 4096 2003-10-02 19:51 address
-r--r--r-- 1 root root 4096 2003-10-02 19:51 broadcast
lrwxrwxrwx 1 root root 53 2003-10-02 19:51 device ->
../../../devices/pci0005:00/0005:00:0b.6/0005:61:01.0 <-- pci dev
lrwxrwxrwx 1 root root 29 2003-10-02 19:51 driver ->
../../../bus/pci/drivers/e100
-r--r--r-- 1 root root 4096 2003-10-02 19:51 features
-rw-r--r-- 1 root root 4096 2003-10-02 19:51 flags
-r--r--r-- 1 root root 4096 2003-10-02 19:51 ifindex
-r--r--r-- 1 root root 4096 2003-10-02 19:51 iflink
-rw-r--r-- 1 root root 4096 2003-10-02 19:51 mtu
drwxr-xr-x 2 root root 0 2003-10-02 19:51 statistics
-rw-r--r-- 1 root root 4096 2003-10-02 19:51 tx_queue_len
-r--r--r-- 1 root root 4096 2003-10-02 19:51 type
bigboylp4:/home/linda #
There are two ethernet adapters, eth0 and eth1, in the system. In PCI
world, eth0 is 0005:21:01.0 and eth1 is pci_dev 0005:61:01.0.
A shell script can be used for greping ethX info, then parsing the info
and generating a nice formatted output.
Linda
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-10-03 13:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-03 12:11 Linking interfaces to slots Steve Modica
2003-10-03 13:37 ` David Brownell
-- strict thread matches above, loose matches on Subject: below --
2003-10-03 13:39 Linda Xie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).