Re: [PATCH v9 6/7] PCI: document SR-IOV sysfs entries

From: Yu Zhao
Date: Tue Feb 17 2009 - 21:51:21 EST


Hi Greg,

The `struct device' is preferred over the `struct kobject' in all cases
that create subdirectory in sysfs, is this true?

I'd like to create a subdirectory under PCI device sysfs directory and
put some symbol links into that directory (only symbol links). Should I
use `device' or `kobject'? Currently I use `device' and get two extra
file/directory (uevent and power) which look like useless for my case
because this subdirectory doesn't reflect a real device.

I checked some code and found they use kobject_init_and_add(). Should
I use it instead, or keep using the `device'?

Please advise.

Regards,
Yu

On Mon, Feb 16, 2009 at 09:28:39PM +0800, Zhao, Yu wrote:
> Signed-off-by: Yu Zhao <yu.zhao@xxxxxxxxx>
> ---
> Documentation/ABI/testing/sysfs-bus-pci | 27 +++++++++++++++++++++++++++
> 1 files changed, 27 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci
> index ceddcff..84dc100 100644
> --- a/Documentation/ABI/testing/sysfs-bus-pci
> +++ b/Documentation/ABI/testing/sysfs-bus-pci
> @@ -9,3 +9,30 @@ Description:
> that some devices may have malformatted data. If the
> underlying VPD has a writable section then the
> corresponding section of this file will be writable.
> +
> +What: /sys/bus/pci/devices/.../virtfn/N
> +Date: February 2009
> +Contact: Yu Zhao <yu.zhao@xxxxxxxxx>
> +Description:
> + This symbol link appears when hardware supports SR-IOV
> + capability and Physical Function driver has enabled it.
> + The symbol link points to the PCI device sysfs entry of
> + Virtual Function whose index is N (0...MaxVFs-1).
> +
> +What: /sys/bus/pci/devices/.../virtfn/dep_link
> +Date: February 2009
> +Contact: Yu Zhao <yu.zhao@xxxxxxxxx>
> +Description:
> + This symbol link appears when hardware supports SR-IOV
> + capability and Physical Function driver has enabled it,
> + and this device has vendor specific dependencies with
> + others. The symbol link points to the PCI device sysfs
> + entry of Physical Function this device depends on.
> +
> +What: /sys/bus/pci/devices/.../physfn
> +Date: February 2009
> +Contact: Yu Zhao <yu.zhao@xxxxxxxxx>
> +Description:
> + This symbol link appears when a device is Virtual Function.
> + The symbol link points to the PCI device sysfs entry of
> + Physical Function this device associates with.
> --
> 1.5.6.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/