* [PATCH 1/1] virtio_pci: use common helper to configure SR-IOV
@ 2022-09-28 23:40 Max Gurtovoy
2022-09-29 6:35 ` Johannes Thumshirn
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Max Gurtovoy @ 2022-09-28 23:40 UTC (permalink / raw)
To: mst, stefanha, jasowang, virtualization; +Cc: linux-block, Max Gurtovoy
This is instead of re-writing the same logic in virtio driver.
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
drivers/virtio/virtio_pci_common.c | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
index ad258a9d3b9f..67d3970e57f2 100644
--- a/drivers/virtio/virtio_pci_common.c
+++ b/drivers/virtio/virtio_pci_common.c
@@ -607,7 +607,6 @@ static int virtio_pci_sriov_configure(struct pci_dev *pci_dev, int num_vfs)
{
struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
struct virtio_device *vdev = &vp_dev->vdev;
- int ret;
if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK))
return -EBUSY;
@@ -615,19 +614,7 @@ static int virtio_pci_sriov_configure(struct pci_dev *pci_dev, int num_vfs)
if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV))
return -EINVAL;
- if (pci_vfs_assigned(pci_dev))
- return -EPERM;
-
- if (num_vfs == 0) {
- pci_disable_sriov(pci_dev);
- return 0;
- }
-
- ret = pci_enable_sriov(pci_dev, num_vfs);
- if (ret < 0)
- return ret;
-
- return num_vfs;
+ return pci_sriov_configure_simple(pci_dev, num_vfs);
}
static struct pci_driver virtio_pci_driver = {
--
2.18.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] virtio_pci: use common helper to configure SR-IOV
2022-09-28 23:40 [PATCH 1/1] virtio_pci: use common helper to configure SR-IOV Max Gurtovoy
@ 2022-09-29 6:35 ` Johannes Thumshirn
2022-10-12 2:31 ` Jason Wang
2022-10-12 5:02 ` Michael S. Tsirkin
2 siblings, 0 replies; 9+ messages in thread
From: Johannes Thumshirn @ 2022-09-29 6:35 UTC (permalink / raw)
To: Max Gurtovoy, mst@redhat.com, stefanha@redhat.com,
jasowang@redhat.com, virtualization@lists.linux-foundation.org
Cc: linux-block@vger.kernel.org
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] virtio_pci: use common helper to configure SR-IOV
2022-09-28 23:40 [PATCH 1/1] virtio_pci: use common helper to configure SR-IOV Max Gurtovoy
2022-09-29 6:35 ` Johannes Thumshirn
@ 2022-10-12 2:31 ` Jason Wang
2022-10-12 5:02 ` Michael S. Tsirkin
2 siblings, 0 replies; 9+ messages in thread
From: Jason Wang @ 2022-10-12 2:31 UTC (permalink / raw)
To: Max Gurtovoy; +Cc: mst, stefanha, virtualization, linux-block
On Thu, Sep 29, 2022 at 7:40 AM Max Gurtovoy <mgurtovoy@nvidia.com> wrote:
>
> This is instead of re-writing the same logic in virtio driver.
>
> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Acked-by: Jason Wang <Jasowang@redhat.com>
> ---
> drivers/virtio/virtio_pci_common.c | 15 +--------------
> 1 file changed, 1 insertion(+), 14 deletions(-)
>
> diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
> index ad258a9d3b9f..67d3970e57f2 100644
> --- a/drivers/virtio/virtio_pci_common.c
> +++ b/drivers/virtio/virtio_pci_common.c
> @@ -607,7 +607,6 @@ static int virtio_pci_sriov_configure(struct pci_dev *pci_dev, int num_vfs)
> {
> struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
> struct virtio_device *vdev = &vp_dev->vdev;
> - int ret;
>
> if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK))
> return -EBUSY;
> @@ -615,19 +614,7 @@ static int virtio_pci_sriov_configure(struct pci_dev *pci_dev, int num_vfs)
> if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV))
> return -EINVAL;
>
> - if (pci_vfs_assigned(pci_dev))
> - return -EPERM;
> -
> - if (num_vfs == 0) {
> - pci_disable_sriov(pci_dev);
> - return 0;
> - }
> -
> - ret = pci_enable_sriov(pci_dev, num_vfs);
> - if (ret < 0)
> - return ret;
> -
> - return num_vfs;
> + return pci_sriov_configure_simple(pci_dev, num_vfs);
> }
>
> static struct pci_driver virtio_pci_driver = {
> --
> 2.18.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] virtio_pci: use common helper to configure SR-IOV
2022-09-28 23:40 [PATCH 1/1] virtio_pci: use common helper to configure SR-IOV Max Gurtovoy
2022-09-29 6:35 ` Johannes Thumshirn
2022-10-12 2:31 ` Jason Wang
@ 2022-10-12 5:02 ` Michael S. Tsirkin
2022-10-12 8:42 ` Max Gurtovoy
2 siblings, 1 reply; 9+ messages in thread
From: Michael S. Tsirkin @ 2022-10-12 5:02 UTC (permalink / raw)
To: Max Gurtovoy; +Cc: stefanha, jasowang, virtualization, linux-block
On Thu, Sep 29, 2022 at 02:40:08AM +0300, Max Gurtovoy wrote:
> This is instead of re-writing the same logic in virtio driver.
>
> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Dropped this as it caused build failures:
https://lore.kernel.org/r/202210080424.gSmuYfb0-lkp%40intel.com
> ---
> drivers/virtio/virtio_pci_common.c | 15 +--------------
> 1 file changed, 1 insertion(+), 14 deletions(-)
>
> diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
> index ad258a9d3b9f..67d3970e57f2 100644
> --- a/drivers/virtio/virtio_pci_common.c
> +++ b/drivers/virtio/virtio_pci_common.c
> @@ -607,7 +607,6 @@ static int virtio_pci_sriov_configure(struct pci_dev *pci_dev, int num_vfs)
> {
> struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
> struct virtio_device *vdev = &vp_dev->vdev;
> - int ret;
>
> if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK))
> return -EBUSY;
> @@ -615,19 +614,7 @@ static int virtio_pci_sriov_configure(struct pci_dev *pci_dev, int num_vfs)
> if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV))
> return -EINVAL;
>
> - if (pci_vfs_assigned(pci_dev))
> - return -EPERM;
> -
> - if (num_vfs == 0) {
> - pci_disable_sriov(pci_dev);
> - return 0;
> - }
> -
> - ret = pci_enable_sriov(pci_dev, num_vfs);
> - if (ret < 0)
> - return ret;
> -
> - return num_vfs;
> + return pci_sriov_configure_simple(pci_dev, num_vfs);
> }
>
> static struct pci_driver virtio_pci_driver = {
> --
> 2.18.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] virtio_pci: use common helper to configure SR-IOV
2022-10-12 5:02 ` Michael S. Tsirkin
@ 2022-10-12 8:42 ` Max Gurtovoy
2022-10-12 10:01 ` Max Gurtovoy
0 siblings, 1 reply; 9+ messages in thread
From: Max Gurtovoy @ 2022-10-12 8:42 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: stefanha, jasowang, virtualization, linux-block
On 10/12/2022 8:02 AM, Michael S. Tsirkin wrote:
> On Thu, Sep 29, 2022 at 02:40:08AM +0300, Max Gurtovoy wrote:
>> This is instead of re-writing the same logic in virtio driver.
>>
>> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
> Dropped this as it caused build failures:
>
> https://lore.kernel.org/r/202210080424.gSmuYfb0-lkp%40intel.com
maybe you can re-run it with:
diff --git a/drivers/virtio/Makefile b/drivers/virtio/Makefile
index 8e98d24917cc..b383326a20e2 100644
--- a/drivers/virtio/Makefile
+++ b/drivers/virtio/Makefile
@@ -5,10 +5,11 @@ obj-$(CONFIG_VIRTIO_PCI_LIB) += virtio_pci_modern_dev.o
obj-$(CONFIG_VIRTIO_PCI_LIB_LEGACY) += virtio_pci_legacy_dev.o
obj-$(CONFIG_VIRTIO_MMIO) += virtio_mmio.o
obj-$(CONFIG_VIRTIO_PCI) += virtio_pci.o
-virtio_pci-y := virtio_pci_modern.o virtio_pci_common.o
-virtio_pci-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o
obj-$(CONFIG_VIRTIO_BALLOON) += virtio_balloon.o
obj-$(CONFIG_VIRTIO_INPUT) += virtio_input.o
obj-$(CONFIG_VIRTIO_VDPA) += virtio_vdpa.o
obj-$(CONFIG_VIRTIO_MEM) += virtio_mem.o
obj-$(CONFIG_VIRTIO_DMA_SHARED_BUFFER) += virtio_dma_buf.o
+
+virtio_pci-$(CONFIG_VIRTIO_PCI) := virtio_pci_modern.o virtio_pci_common.o
+virtio_pci-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o
>
>> ---
>> drivers/virtio/virtio_pci_common.c | 15 +--------------
>> 1 file changed, 1 insertion(+), 14 deletions(-)
>>
>> diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
>> index ad258a9d3b9f..67d3970e57f2 100644
>> --- a/drivers/virtio/virtio_pci_common.c
>> +++ b/drivers/virtio/virtio_pci_common.c
>> @@ -607,7 +607,6 @@ static int virtio_pci_sriov_configure(struct pci_dev *pci_dev, int num_vfs)
>> {
>> struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
>> struct virtio_device *vdev = &vp_dev->vdev;
>> - int ret;
>>
>> if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK))
>> return -EBUSY;
>> @@ -615,19 +614,7 @@ static int virtio_pci_sriov_configure(struct pci_dev *pci_dev, int num_vfs)
>> if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV))
>> return -EINVAL;
>>
>> - if (pci_vfs_assigned(pci_dev))
>> - return -EPERM;
>> -
>> - if (num_vfs == 0) {
>> - pci_disable_sriov(pci_dev);
>> - return 0;
>> - }
>> -
>> - ret = pci_enable_sriov(pci_dev, num_vfs);
>> - if (ret < 0)
>> - return ret;
>> -
>> - return num_vfs;
>> + return pci_sriov_configure_simple(pci_dev, num_vfs);
>> }
>>
>> static struct pci_driver virtio_pci_driver = {
>> --
>> 2.18.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] virtio_pci: use common helper to configure SR-IOV
2022-10-12 8:42 ` Max Gurtovoy
@ 2022-10-12 10:01 ` Max Gurtovoy
2022-10-12 21:20 ` Bjorn Helgaas
0 siblings, 1 reply; 9+ messages in thread
From: Max Gurtovoy @ 2022-10-12 10:01 UTC (permalink / raw)
To: Michael S. Tsirkin, Bjorn Helgaas
Cc: stefanha, jasowang, virtualization, linux-block
On 10/12/2022 11:42 AM, Max Gurtovoy wrote:
>
> On 10/12/2022 8:02 AM, Michael S. Tsirkin wrote:
>> On Thu, Sep 29, 2022 at 02:40:08AM +0300, Max Gurtovoy wrote:
>>> This is instead of re-writing the same logic in virtio driver.
>>>
>>> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
>> Dropped this as it caused build failures:
>>
>> https://lore.kernel.org/r/202210080424.gSmuYfb0-lkp%40intel.com
>
> maybe you can re-run it with:
>
> diff --git a/drivers/virtio/Makefile b/drivers/virtio/Makefile
> index 8e98d24917cc..b383326a20e2 100644
> --- a/drivers/virtio/Makefile
> +++ b/drivers/virtio/Makefile
> @@ -5,10 +5,11 @@ obj-$(CONFIG_VIRTIO_PCI_LIB) += virtio_pci_modern_dev.o
> obj-$(CONFIG_VIRTIO_PCI_LIB_LEGACY) += virtio_pci_legacy_dev.o
> obj-$(CONFIG_VIRTIO_MMIO) += virtio_mmio.o
> obj-$(CONFIG_VIRTIO_PCI) += virtio_pci.o
> -virtio_pci-y := virtio_pci_modern.o virtio_pci_common.o
> -virtio_pci-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o
> obj-$(CONFIG_VIRTIO_BALLOON) += virtio_balloon.o
> obj-$(CONFIG_VIRTIO_INPUT) += virtio_input.o
> obj-$(CONFIG_VIRTIO_VDPA) += virtio_vdpa.o
> obj-$(CONFIG_VIRTIO_MEM) += virtio_mem.o
> obj-$(CONFIG_VIRTIO_DMA_SHARED_BUFFER) += virtio_dma_buf.o
> +
> +virtio_pci-$(CONFIG_VIRTIO_PCI) := virtio_pci_modern.o
> virtio_pci_common.o
> +virtio_pci-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o
>
Now I saw that CONFIG_PCI_IOV is not set in the error log so the bellow
should fix it:
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 060af91bafcd..c519220e8ff8 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2228,7 +2228,10 @@ static inline int pci_sriov_set_totalvfs(struct
pci_dev *dev, u16 numvfs)
{ return 0; }
static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)
{ return 0; }
-#define pci_sriov_configure_simple NULL
+static inline int pci_sriov_configure_simple(struct pci_dev *dev, int
nr_virtfn)
+{
+ return -ENOSYS;
+}
static inline resource_size_t pci_iov_resource_size(struct pci_dev
*dev, int resno)
{ return 0; }
static inline void pci_vf_drivers_autoprobe(struct pci_dev *dev, bool
probe) { }
Bjorn,
WDYT about the above ?
should I send it to the pci subsystem list ?
>
>>
>>> ---
>>> drivers/virtio/virtio_pci_common.c | 15 +--------------
>>> 1 file changed, 1 insertion(+), 14 deletions(-)
>>>
>>> diff --git a/drivers/virtio/virtio_pci_common.c
>>> b/drivers/virtio/virtio_pci_common.c
>>> index ad258a9d3b9f..67d3970e57f2 100644
>>> --- a/drivers/virtio/virtio_pci_common.c
>>> +++ b/drivers/virtio/virtio_pci_common.c
>>> @@ -607,7 +607,6 @@ static int virtio_pci_sriov_configure(struct
>>> pci_dev *pci_dev, int num_vfs)
>>> {
>>> struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
>>> struct virtio_device *vdev = &vp_dev->vdev;
>>> - int ret;
>>> if (!(vdev->config->get_status(vdev) &
>>> VIRTIO_CONFIG_S_DRIVER_OK))
>>> return -EBUSY;
>>> @@ -615,19 +614,7 @@ static int virtio_pci_sriov_configure(struct
>>> pci_dev *pci_dev, int num_vfs)
>>> if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV))
>>> return -EINVAL;
>>> - if (pci_vfs_assigned(pci_dev))
>>> - return -EPERM;
>>> -
>>> - if (num_vfs == 0) {
>>> - pci_disable_sriov(pci_dev);
>>> - return 0;
>>> - }
>>> -
>>> - ret = pci_enable_sriov(pci_dev, num_vfs);
>>> - if (ret < 0)
>>> - return ret;
>>> -
>>> - return num_vfs;
>>> + return pci_sriov_configure_simple(pci_dev, num_vfs);
>>> }
>>> static struct pci_driver virtio_pci_driver = {
>>> --
>>> 2.18.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] virtio_pci: use common helper to configure SR-IOV
2022-10-12 10:01 ` Max Gurtovoy
@ 2022-10-12 21:20 ` Bjorn Helgaas
2022-10-12 23:01 ` Max Gurtovoy
0 siblings, 1 reply; 9+ messages in thread
From: Bjorn Helgaas @ 2022-10-12 21:20 UTC (permalink / raw)
To: Max Gurtovoy
Cc: Michael S. Tsirkin, stefanha, jasowang, virtualization,
linux-block
On Wed, Oct 12, 2022 at 5:01 AM Max Gurtovoy <mgurtovoy@nvidia.com> wrote:
>
>
> On 10/12/2022 11:42 AM, Max Gurtovoy wrote:
> >
> > On 10/12/2022 8:02 AM, Michael S. Tsirkin wrote:
> >> On Thu, Sep 29, 2022 at 02:40:08AM +0300, Max Gurtovoy wrote:
> >>> This is instead of re-writing the same logic in virtio driver.
> >>>
> >>> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
> >> Dropped this as it caused build failures:
> >>
> >> https://lore.kernel.org/r/202210080424.gSmuYfb0-lkp%40intel.com
> >
> > maybe you can re-run it with:
> >
> > diff --git a/drivers/virtio/Makefile b/drivers/virtio/Makefile
> > index 8e98d24917cc..b383326a20e2 100644
> > --- a/drivers/virtio/Makefile
> > +++ b/drivers/virtio/Makefile
> > @@ -5,10 +5,11 @@ obj-$(CONFIG_VIRTIO_PCI_LIB) += virtio_pci_modern_dev.o
> > obj-$(CONFIG_VIRTIO_PCI_LIB_LEGACY) += virtio_pci_legacy_dev.o
> > obj-$(CONFIG_VIRTIO_MMIO) += virtio_mmio.o
> > obj-$(CONFIG_VIRTIO_PCI) += virtio_pci.o
> > -virtio_pci-y := virtio_pci_modern.o virtio_pci_common.o
> > -virtio_pci-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o
> > obj-$(CONFIG_VIRTIO_BALLOON) += virtio_balloon.o
> > obj-$(CONFIG_VIRTIO_INPUT) += virtio_input.o
> > obj-$(CONFIG_VIRTIO_VDPA) += virtio_vdpa.o
> > obj-$(CONFIG_VIRTIO_MEM) += virtio_mem.o
> > obj-$(CONFIG_VIRTIO_DMA_SHARED_BUFFER) += virtio_dma_buf.o
> > +
> > +virtio_pci-$(CONFIG_VIRTIO_PCI) := virtio_pci_modern.o
> > virtio_pci_common.o
> > +virtio_pci-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o
> >
>
> Now I saw that CONFIG_PCI_IOV is not set in the error log so the bellow
> should fix it:
>
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 060af91bafcd..c519220e8ff8 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -2228,7 +2228,10 @@ static inline int pci_sriov_set_totalvfs(struct
> pci_dev *dev, u16 numvfs)
> { return 0; }
> static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)
> { return 0; }
> -#define pci_sriov_configure_simple NULL
> +static inline int pci_sriov_configure_simple(struct pci_dev *dev, int
> nr_virtfn)
> +{
> + return -ENOSYS;
> +}
> static inline resource_size_t pci_iov_resource_size(struct pci_dev
> *dev, int resno)
> { return 0; }
> static inline void pci_vf_drivers_autoprobe(struct pci_dev *dev, bool
> probe) { }
>
> Bjorn,
>
> WDYT about the above ?
>
> should I send it to the pci subsystem list ?
Yes. I don't apply things that haven't appeared on linux-pci@vger.kernel.org.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] virtio_pci: use common helper to configure SR-IOV
2022-10-12 21:20 ` Bjorn Helgaas
@ 2022-10-12 23:01 ` Max Gurtovoy
2022-10-12 23:19 ` Michael S. Tsirkin
0 siblings, 1 reply; 9+ messages in thread
From: Max Gurtovoy @ 2022-10-12 23:01 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Michael S. Tsirkin, stefanha, jasowang, virtualization,
linux-block
On 10/13/2022 12:20 AM, Bjorn Helgaas wrote:
> On Wed, Oct 12, 2022 at 5:01 AM Max Gurtovoy <mgurtovoy@nvidia.com> wrote:
>>
>> On 10/12/2022 11:42 AM, Max Gurtovoy wrote:
>>> On 10/12/2022 8:02 AM, Michael S. Tsirkin wrote:
>>>> On Thu, Sep 29, 2022 at 02:40:08AM +0300, Max Gurtovoy wrote:
>>>>> This is instead of re-writing the same logic in virtio driver.
>>>>>
>>>>> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
>>>> Dropped this as it caused build failures:
>>>>
>>>> https://lore.kernel.org/r/202210080424.gSmuYfb0-lkp%40intel.com
>>> maybe you can re-run it with:
>>>
>>> diff --git a/drivers/virtio/Makefile b/drivers/virtio/Makefile
>>> index 8e98d24917cc..b383326a20e2 100644
>>> --- a/drivers/virtio/Makefile
>>> +++ b/drivers/virtio/Makefile
>>> @@ -5,10 +5,11 @@ obj-$(CONFIG_VIRTIO_PCI_LIB) += virtio_pci_modern_dev.o
>>> obj-$(CONFIG_VIRTIO_PCI_LIB_LEGACY) += virtio_pci_legacy_dev.o
>>> obj-$(CONFIG_VIRTIO_MMIO) += virtio_mmio.o
>>> obj-$(CONFIG_VIRTIO_PCI) += virtio_pci.o
>>> -virtio_pci-y := virtio_pci_modern.o virtio_pci_common.o
>>> -virtio_pci-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o
>>> obj-$(CONFIG_VIRTIO_BALLOON) += virtio_balloon.o
>>> obj-$(CONFIG_VIRTIO_INPUT) += virtio_input.o
>>> obj-$(CONFIG_VIRTIO_VDPA) += virtio_vdpa.o
>>> obj-$(CONFIG_VIRTIO_MEM) += virtio_mem.o
>>> obj-$(CONFIG_VIRTIO_DMA_SHARED_BUFFER) += virtio_dma_buf.o
>>> +
>>> +virtio_pci-$(CONFIG_VIRTIO_PCI) := virtio_pci_modern.o
>>> virtio_pci_common.o
>>> +virtio_pci-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o
>>>
>> Now I saw that CONFIG_PCI_IOV is not set in the error log so the bellow
>> should fix it:
>>
>> diff --git a/include/linux/pci.h b/include/linux/pci.h
>> index 060af91bafcd..c519220e8ff8 100644
>> --- a/include/linux/pci.h
>> +++ b/include/linux/pci.h
>> @@ -2228,7 +2228,10 @@ static inline int pci_sriov_set_totalvfs(struct
>> pci_dev *dev, u16 numvfs)
>> { return 0; }
>> static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)
>> { return 0; }
>> -#define pci_sriov_configure_simple NULL
>> +static inline int pci_sriov_configure_simple(struct pci_dev *dev, int
>> nr_virtfn)
>> +{
>> + return -ENOSYS;
>> +}
>> static inline resource_size_t pci_iov_resource_size(struct pci_dev
>> *dev, int resno)
>> { return 0; }
>> static inline void pci_vf_drivers_autoprobe(struct pci_dev *dev, bool
>> probe) { }
>>
>> Bjorn,
>>
>> WDYT about the above ?
>>
>> should I send it to the pci subsystem list ?
> Yes. I don't apply things that haven't appeared on linux-pci@vger.kernel.org.
Sure.
MST,
can you confirm the above fixes the build errors before I sent the v2 ?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] virtio_pci: use common helper to configure SR-IOV
2022-10-12 23:01 ` Max Gurtovoy
@ 2022-10-12 23:19 ` Michael S. Tsirkin
0 siblings, 0 replies; 9+ messages in thread
From: Michael S. Tsirkin @ 2022-10-12 23:19 UTC (permalink / raw)
To: Max Gurtovoy
Cc: Bjorn Helgaas, stefanha, jasowang, virtualization, linux-block
On Thu, Oct 13, 2022 at 02:01:04AM +0300, Max Gurtovoy wrote:
>
> On 10/13/2022 12:20 AM, Bjorn Helgaas wrote:
> > On Wed, Oct 12, 2022 at 5:01 AM Max Gurtovoy <mgurtovoy@nvidia.com> wrote:
> > >
> > > On 10/12/2022 11:42 AM, Max Gurtovoy wrote:
> > > > On 10/12/2022 8:02 AM, Michael S. Tsirkin wrote:
> > > > > On Thu, Sep 29, 2022 at 02:40:08AM +0300, Max Gurtovoy wrote:
> > > > > > This is instead of re-writing the same logic in virtio driver.
> > > > > >
> > > > > > Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
> > > > > Dropped this as it caused build failures:
> > > > >
> > > > > https://lore.kernel.org/r/202210080424.gSmuYfb0-lkp%40intel.com
> > > > maybe you can re-run it with:
> > > >
> > > > diff --git a/drivers/virtio/Makefile b/drivers/virtio/Makefile
> > > > index 8e98d24917cc..b383326a20e2 100644
> > > > --- a/drivers/virtio/Makefile
> > > > +++ b/drivers/virtio/Makefile
> > > > @@ -5,10 +5,11 @@ obj-$(CONFIG_VIRTIO_PCI_LIB) += virtio_pci_modern_dev.o
> > > > obj-$(CONFIG_VIRTIO_PCI_LIB_LEGACY) += virtio_pci_legacy_dev.o
> > > > obj-$(CONFIG_VIRTIO_MMIO) += virtio_mmio.o
> > > > obj-$(CONFIG_VIRTIO_PCI) += virtio_pci.o
> > > > -virtio_pci-y := virtio_pci_modern.o virtio_pci_common.o
> > > > -virtio_pci-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o
> > > > obj-$(CONFIG_VIRTIO_BALLOON) += virtio_balloon.o
> > > > obj-$(CONFIG_VIRTIO_INPUT) += virtio_input.o
> > > > obj-$(CONFIG_VIRTIO_VDPA) += virtio_vdpa.o
> > > > obj-$(CONFIG_VIRTIO_MEM) += virtio_mem.o
> > > > obj-$(CONFIG_VIRTIO_DMA_SHARED_BUFFER) += virtio_dma_buf.o
> > > > +
> > > > +virtio_pci-$(CONFIG_VIRTIO_PCI) := virtio_pci_modern.o
> > > > virtio_pci_common.o
> > > > +virtio_pci-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o
> > > >
> > > Now I saw that CONFIG_PCI_IOV is not set in the error log so the bellow
> > > should fix it:
> > >
> > > diff --git a/include/linux/pci.h b/include/linux/pci.h
> > > index 060af91bafcd..c519220e8ff8 100644
> > > --- a/include/linux/pci.h
> > > +++ b/include/linux/pci.h
> > > @@ -2228,7 +2228,10 @@ static inline int pci_sriov_set_totalvfs(struct
> > > pci_dev *dev, u16 numvfs)
> > > { return 0; }
> > > static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)
> > > { return 0; }
> > > -#define pci_sriov_configure_simple NULL
> > > +static inline int pci_sriov_configure_simple(struct pci_dev *dev, int
> > > nr_virtfn)
> > > +{
> > > + return -ENOSYS;
> > > +}
> > > static inline resource_size_t pci_iov_resource_size(struct pci_dev
> > > *dev, int resno)
> > > { return 0; }
> > > static inline void pci_vf_drivers_autoprobe(struct pci_dev *dev, bool
> > > probe) { }
> > >
> > > Bjorn,
> > >
> > > WDYT about the above ?
> > >
> > > should I send it to the pci subsystem list ?
> > Yes. I don't apply things that haven't appeared on linux-pci@vger.kernel.org.
>
> Sure.
>
> MST,
>
> can you confirm the above fixes the build errors before I sent the v2 ?
Max, please just use the lkp test, it's not hard.
--
MST
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-10-12 23:19 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-28 23:40 [PATCH 1/1] virtio_pci: use common helper to configure SR-IOV Max Gurtovoy
2022-09-29 6:35 ` Johannes Thumshirn
2022-10-12 2:31 ` Jason Wang
2022-10-12 5:02 ` Michael S. Tsirkin
2022-10-12 8:42 ` Max Gurtovoy
2022-10-12 10:01 ` Max Gurtovoy
2022-10-12 21:20 ` Bjorn Helgaas
2022-10-12 23:01 ` Max Gurtovoy
2022-10-12 23:19 ` Michael S. Tsirkin
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).