From: Don Dutile <ddutile@redhat.com>
To: Yuval Mintz <yuvalmin@broadcom.com>
Cc: linux-pci@vger.kernel.org, bhelgaas@google.com,
bhutchings@solarflare.com, gregory.v.rose@intel.com,
davem@davemloft.net
Subject: Re: [RFC] PCI: enable and disable sriov support via sysfs at per device level
Date: Tue, 02 Oct 2012 13:38:42 -0400 [thread overview]
Message-ID: <506B26A2.2070603@redhat.com> (raw)
In-Reply-To: <506A9892.5090707@broadcom.com>
On 10/02/2012 03:32 AM, Yuval Mintz wrote:
>> +static void pci_sriov_remove_sysfs_dev_files(struct pci_dev *dev)
>> +{
>> + int pos;
>> +
>> + if ((dev->is_physfn)&& pci_is_pcie(dev)) {
>> + pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_SRIOV);
>> + if (pos)
>> + device_remove_file(&dev->dev, pci_dev_sriov_attrs);
>
> Shouldn't it iterate over the attributes when removing them?
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
good catch; that should be:
+ int pos, i;
....
+ for (i = 0; attr_name(pci_dev_sriov_attrs[i]); i++)
+ device_remove_file(&dev->dev, &pci_dev_sriov_attrs);
it doesn't remove the files in reverse order, but neither does
the device-generic code for dev-attrs.
Another question for RFC:
-- above shows I didn't test with hot-plug
-- which makes me wonder/think if [get,put]_device([dev,parent]) needed
during [create,remove]_file() calls.
next prev parent reply other threads:[~2012-10-02 17:38 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-01 23:27 [RFC] PCI: enable and disable sriov support via sysfs at per device level Donald Dutile
2012-10-02 7:32 ` Yuval Mintz
2012-10-02 17:38 ` Don Dutile [this message]
2012-10-02 20:01 ` Yinghai Lu
2012-10-02 20:23 ` Don Dutile
2012-10-02 20:33 ` Yinghai Lu
2012-10-02 20:39 ` Greg Kroah-Hartman
2012-10-02 21:06 ` Don Dutile
2012-10-03 3:10 ` Greg Kroah-Hartman
2012-10-03 4:58 ` Yinghai Lu
2012-10-03 5:07 ` [PATCH 1/2] PCI: Add pci_dev_type Yinghai Lu
2012-10-03 5:07 ` [PATCH 2/2] PCI, sys: Use is_visable() with boot_vga attribute for pci_dev Yinghai Lu
2012-10-03 13:18 ` [RFC] PCI: enable and disable sriov support via sysfs at per device level Don Dutile
2012-10-03 17:51 ` [PATCH 0/5] PCI: per pci device sysfs set_max_vfs support Yinghai Lu
2012-10-03 17:51 ` [PATCH 1/5] PCI: Add pci_dev_type Yinghai Lu
2012-10-04 14:10 ` Konrad Rzeszutek Wilk
2012-10-03 17:51 ` [PATCH 2/5] PCI, sys: Use is_visable() with boot_vga attribute for pci_dev Yinghai Lu
2012-10-03 19:28 ` Greg Kroah-Hartman
2012-10-03 17:51 ` [PATCH 3/5] PCI: add set_max_vfs in pci_driver ops Yinghai Lu
2012-10-03 18:55 ` Don Dutile
2012-10-03 20:41 ` Yinghai Lu
2012-10-03 21:02 ` Don Dutile
2012-10-03 17:51 ` [PATCH 4/5] PCI: Add max_vfs in sysfs per pci device where supports Yinghai Lu
2012-10-04 14:15 ` Konrad Rzeszutek Wilk
2012-10-04 15:13 ` Yinghai Lu
2012-10-03 17:51 ` [PATCH 5/5] ixgbe: add driver set_max_vfs support Yinghai Lu
2012-10-03 17:57 ` Yinghai Lu
2012-10-03 18:45 ` Dan Carpenter
2012-10-03 18:47 ` Alexander Duyck
2012-10-03 19:02 ` Don Dutile
2012-10-03 19:16 ` Rose, Gregory V
2012-10-03 20:37 ` Yinghai Lu
2012-10-03 17:55 ` [RFC] PCI: enable and disable sriov support via sysfs at per device level Yinghai Lu
2012-10-03 18:16 ` Rose, Gregory V
2012-10-03 18:28 ` Yinghai Lu
2012-10-03 13:00 ` Konrad Rzeszutek Wilk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=506B26A2.2070603@redhat.com \
--to=ddutile@redhat.com \
--cc=bhelgaas@google.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=gregory.v.rose@intel.com \
--cc=linux-pci@vger.kernel.org \
--cc=yuvalmin@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).