lkml.org 
[lkml]   [2010]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] PCI: create function symlinks in /sys/bus/pci/slots/N/
Hello Kenji-san,

* Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>:
> Alex Chiang wrote:
>> Create convenience symlinks in sysfs, linking slots to device
>> functions, and vice versa. These links make it easier for users to
>> figure out which devices actually live in what slots.
>>
>> For example:
>>
>> sapphire:/sys/bus/pci/slots # ls
>> 1 10 2 3 4 5 6 7 8 9
>>
>> sapphire:/sys/bus/pci/slots # ls -l 3
>> total 0
>> -r--r--r-- 1 root root 65536 Aug 18 14:10 address
>> lrwxrwxrwx 1 root root 0 Aug 18 14:10 function0 ->
>> ../../../../devices/pci0000:23/0000:23:01.0
>> lrwxrwxrwx 1 root root 0 Aug 18 14:10 function1 ->
>> ../../../../devices/pci0000:23/0000:23:01.1
>>
>
> I usually get the similar information like the followings. Is
> it not enough for you?
>
> # /sbin/lspci -s `cat /sys/bus/pci/slots/1/address`
> 40:00.0 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06)
> 40:00.1 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06)
>
>> sapphire:/sys/bus/pci/slots # ls -l 3/function0/slot
>> lrwxrwxrwx 1 root root 0 Aug 18 14:13 3/function0/slot ->
>> ../../../bus/pci/slots/3
>
> IIRC, the latest 'lspci' command shows physical slot
> information (you added this useful feature, didn't you?). Is it
> not enough for you?

You're right, it's certainly possible to get all that information
using lspci (and yes, I did add the physical slot information ;).

I just thought that these symlinks would be quite convenient, so
that you don't have to traverse around in the sysfs tree quite so
much if you want to find other properties of your physical
device, such as net:ethX, etc.

However, I talked with my manageability userspace team and they
do not really need the links either.

I'll leave it up to Jesse. I think this is a useful feature, I
don't think it's too hard to support as a kernel ABI, but I also
agree that it's not entirely necessary.

Thanks.
/ac



\
 
 \ /
  Last update: 2010-03-10 19:19    [W:0.067 / U:11.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site