Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1253053 > unrolled thread
| Started by | Lan Tianyu <tianyu.lan@intel.com> |
|---|---|
| First post | 2015-10-21 18:50 +0200 |
| Last post | 2015-10-24 16:50 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[RFC Patch 01/12] PCI: Add virtfn_index for struct pci_device Lan Tianyu <tianyu.lan@intel.com> - 2015-10-21 18:50 +0200
Re: [RFC Patch 01/12] PCI: Add virtfn_index for struct pci_device Alexander Duyck <alexander.duyck@gmail.com> - 2015-10-21 20:10 +0200
Re: [RFC Patch 01/12] PCI: Add virtfn_index for struct pci_device "Lan, Tianyu" <tianyu.lan@intel.com> - 2015-10-24 16:50 +0200
| From | Lan Tianyu <tianyu.lan@intel.com> |
|---|---|
| Date | 2015-10-21 18:50 +0200 |
| Subject | [RFC Patch 01/12] PCI: Add virtfn_index for struct pci_device |
| Message-ID | <qm4Km-nt-23@gated-at.bofh.it> |
Add "virtfn_index" member in the struct pci_device to record VF sequence
of PF. This will be used in the VF sysfs node handle.
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
drivers/pci/iov.c | 1 +
include/linux/pci.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index ee0ebff..065b6bb 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -136,6 +136,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset)
virtfn->physfn = pci_dev_get(dev);
virtfn->is_virtfn = 1;
virtfn->multifunction = 0;
+ virtfn->virtfn_index = id;
for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
res = &dev->resource[i + PCI_IOV_RESOURCES];
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 353db8d..85c5531 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -356,6 +356,7 @@ struct pci_dev {
unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O windows */
unsigned int irq_managed:1;
pci_dev_flags_t dev_flags;
+ unsigned int virtfn_index;
atomic_t enable_cnt; /* pci_enable_device has been called */
u32 saved_config_space[16]; /* config space saved at suspend time */
--
1.8.4.rc0.1.g8f6a3e5.dirty
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Alexander Duyck <alexander.duyck@gmail.com> |
|---|---|
| Date | 2015-10-21 20:10 +0200 |
| Message-ID | <qm5ZM-2ld-25@gated-at.bofh.it> |
| In reply to | #1253053 |
On 10/21/2015 09:37 AM, Lan Tianyu wrote:
> Add "virtfn_index" member in the struct pci_device to record VF sequence
> of PF. This will be used in the VF sysfs node handle.
>
> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
> ---
> drivers/pci/iov.c | 1 +
> include/linux/pci.h | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
> index ee0ebff..065b6bb 100644
> --- a/drivers/pci/iov.c
> +++ b/drivers/pci/iov.c
> @@ -136,6 +136,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset)
> virtfn->physfn = pci_dev_get(dev);
> virtfn->is_virtfn = 1;
> virtfn->multifunction = 0;
> + virtfn->virtfn_index = id;
>
> for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
> res = &dev->resource[i + PCI_IOV_RESOURCES];
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 353db8d..85c5531 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -356,6 +356,7 @@ struct pci_dev {
> unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O windows */
> unsigned int irq_managed:1;
> pci_dev_flags_t dev_flags;
> + unsigned int virtfn_index;
> atomic_t enable_cnt; /* pci_enable_device has been called */
>
> u32 saved_config_space[16]; /* config space saved at suspend time */
>
Can't you just calculate the VF index based on the VF BDF number
combined with the information in the PF BDF number and VF
offset/stride? Seems kind of pointless to add a variable that is only
used by one driver and is in a slowpath when you can just calculate it
pretty quickly.
- Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | "Lan, Tianyu" <tianyu.lan@intel.com> |
|---|---|
| Date | 2015-10-24 16:50 +0200 |
| Message-ID | <qn8iR-3eL-5@gated-at.bofh.it> |
| In reply to | #1253099 |
On 10/22/2015 2:07 AM, Alexander Duyck wrote:
> On 10/21/2015 09:37 AM, Lan Tianyu wrote:
>> Add "virtfn_index" member in the struct pci_device to record VF sequence
>> of PF. This will be used in the VF sysfs node handle.
>>
>> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
>> ---
>> drivers/pci/iov.c | 1 +
>> include/linux/pci.h | 1 +
>> 2 files changed, 2 insertions(+)
>>
>> diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
>> index ee0ebff..065b6bb 100644
>> --- a/drivers/pci/iov.c
>> +++ b/drivers/pci/iov.c
>> @@ -136,6 +136,7 @@ static int virtfn_add(struct pci_dev *dev, int id,
>> int reset)
>> virtfn->physfn = pci_dev_get(dev);
>> virtfn->is_virtfn = 1;
>> virtfn->multifunction = 0;
>> + virtfn->virtfn_index = id;
>> for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
>> res = &dev->resource[i + PCI_IOV_RESOURCES];
>> diff --git a/include/linux/pci.h b/include/linux/pci.h
>> index 353db8d..85c5531 100644
>> --- a/include/linux/pci.h
>> +++ b/include/linux/pci.h
>> @@ -356,6 +356,7 @@ struct pci_dev {
>> unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O
>> windows */
>> unsigned int irq_managed:1;
>> pci_dev_flags_t dev_flags;
>> + unsigned int virtfn_index;
>> atomic_t enable_cnt; /* pci_enable_device has been called */
>> u32 saved_config_space[16]; /* config space saved at
>> suspend time */
>>
>
> Can't you just calculate the VF index based on the VF BDF number
> combined with the information in the PF BDF number and VF
> offset/stride? Seems kind of pointless to add a variable that is only
> used by one driver and is in a slowpath when you can just calculate it
> pretty quickly.
Good suggestion. Will try it.
>
> - Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web