Linux-HyperV Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled
@ 2019-07-03 16:59 Randy Dunlap
  2019-07-03 18:06 ` Haiyang Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2019-07-03 16:59 UTC (permalink / raw)
  To: LKML, linux-pci
  Cc: Matthew Wilcox, Jake Oshins, K. Y. Srinivasan, Haiyang Zhang,
	Stephen Hemminger, Sasha Levin, Bjorn Helgaas, linux-hyperv,
	Dexuan Cui, Yuehaibing

From: Randy Dunlap <rdunlap@infradead.org>

Fix build of drivers/pci/controller/pci-hyperv.o when
CONFIG_SYSFS is not set/enabled by adding stubs for
pci_create_slot() and pci_destroy_slot().

Fixes these build errors:

ERROR: "pci_destroy_slot" [drivers/pci/controller/pci-hyperv.ko] undefined!
ERROR: "pci_create_slot" [drivers/pci/controller/pci-hyperv.ko] undefined!

Fixes: a15f2c08c708 ("PCI: hv: support reporting serial number as slot information")

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Jake Oshins <jakeo@microsoft.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Sasha Levin <sashal@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-hyperv@vger.kernel.org
Cc: Dexuan Cui <decui@microsoft.com>
Cc: Yuehaibing <yuehaibing@huawei.com>
---
v2:
- provide non-CONFIG_SYSFS stubs for pci_create_slot() and
  pci_destroy_slot() [suggested by Matthew Wilcox <willy@infradead.org>]
- use the correct Fixes: tag [Dexuan Cui <decui@microsoft.com>]

 include/linux/pci.h |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

--- lnx-52-rc7.orig/include/linux/pci.h
+++ lnx-52-rc7/include/linux/pci.h
@@ -25,6 +25,7 @@
 #include <linux/ioport.h>
 #include <linux/list.h>
 #include <linux/compiler.h>
+#include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/kobject.h>
 #include <linux/atomic.h>
@@ -947,14 +948,21 @@ int pci_scan_root_bus_bridge(struct pci_
 struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
 				int busnr);
 void pcie_update_link_speed(struct pci_bus *bus, u16 link_status);
+#ifdef CONFIG_SYSFS
+void pci_dev_assign_slot(struct pci_dev *dev);
 struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
 				 const char *name,
 				 struct hotplug_slot *hotplug);
 void pci_destroy_slot(struct pci_slot *slot);
-#ifdef CONFIG_SYSFS
-void pci_dev_assign_slot(struct pci_dev *dev);
 #else
 static inline void pci_dev_assign_slot(struct pci_dev *dev) { }
+static inline struct pci_slot *pci_create_slot(struct pci_bus *parent,
+					       int slot_nr,
+					       const char *name,
+					       struct hotplug_slot *hotplug) {
+	return ERR_PTR(-EINVAL);
+}
+static inline void pci_destroy_slot(struct pci_slot *slot) { }
 #endif
 int pci_scan_slot(struct pci_bus *bus, int devfn);
 struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);



^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled
  2019-07-03 16:59 [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled Randy Dunlap
@ 2019-07-03 18:06 ` Haiyang Zhang
  2019-07-07 17:46   ` Randy Dunlap
  0 siblings, 1 reply; 5+ messages in thread
From: Haiyang Zhang @ 2019-07-03 18:06 UTC (permalink / raw)
  To: Randy Dunlap, LKML, linux-pci, Stephen Hemminger
  Cc: Matthew Wilcox, Jake Oshins, KY Srinivasan, Sasha Levin,
	Bjorn Helgaas, linux-hyperv, Dexuan Cui, Yuehaibing



> -----Original Message-----
> From: Randy Dunlap <rdunlap@infradead.org>
> Sent: Wednesday, July 3, 2019 12:59 PM
> To: LKML <linux-kernel@vger.kernel.org>; linux-pci <linux-
> pci@vger.kernel.org>
> Cc: Matthew Wilcox <willy@infradead.org>; Jake Oshins
> <jakeo@microsoft.com>; KY Srinivasan <kys@microsoft.com>; Haiyang
> Zhang <haiyangz@microsoft.com>; Stephen Hemminger
> <sthemmin@microsoft.com>; Sasha Levin <sashal@kernel.org>; Bjorn
> Helgaas <bhelgaas@google.com>; linux-hyperv@vger.kernel.org; Dexuan
> Cui <decui@microsoft.com>; Yuehaibing <yuehaibing@huawei.com>
> Subject: [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled
> 
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Fix build of drivers/pci/controller/pci-hyperv.o when
> CONFIG_SYSFS is not set/enabled by adding stubs for
> pci_create_slot() and pci_destroy_slot().
> 
> Fixes these build errors:
> 
> ERROR: "pci_destroy_slot" [drivers/pci/controller/pci-hyperv.ko] undefined!
> ERROR: "pci_create_slot" [drivers/pci/controller/pci-hyperv.ko] undefined!
> 
> Fixes: a15f2c08c708 ("PCI: hv: support reporting serial number as slot
> information")
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Matthew Wilcox <willy@infradead.org>
> Cc: Jake Oshins <jakeo@microsoft.com>
> Cc: "K. Y. Srinivasan" <kys@microsoft.com>
> Cc: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: Stephen Hemminger <sthemmin@microsoft.com>
> Cc: Sasha Levin <sashal@kernel.org>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-hyperv@vger.kernel.org
> Cc: Dexuan Cui <decui@microsoft.com>
> Cc: Yuehaibing <yuehaibing@huawei.com>
> ---
> v2:
> - provide non-CONFIG_SYSFS stubs for pci_create_slot() and
>   pci_destroy_slot() [suggested by Matthew Wilcox <willy@infradead.org>]
> - use the correct Fixes: tag [Dexuan Cui <decui@microsoft.com>]
> 
>  include/linux/pci.h |   12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> --- lnx-52-rc7.orig/include/linux/pci.h
> +++ lnx-52-rc7/include/linux/pci.h
> @@ -25,6 +25,7 @@
>  #include <linux/ioport.h>
>  #include <linux/list.h>
>  #include <linux/compiler.h>
> +#include <linux/err.h>
>  #include <linux/errno.h>
>  #include <linux/kobject.h>
>  #include <linux/atomic.h>
> @@ -947,14 +948,21 @@ int pci_scan_root_bus_bridge(struct pci_
>  struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev
> *dev,
>  				int busnr);
>  void pcie_update_link_speed(struct pci_bus *bus, u16 link_status);
> +#ifdef CONFIG_SYSFS
> +void pci_dev_assign_slot(struct pci_dev *dev);
>  struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
>  				 const char *name,
>  				 struct hotplug_slot *hotplug);
>  void pci_destroy_slot(struct pci_slot *slot);
> -#ifdef CONFIG_SYSFS
> -void pci_dev_assign_slot(struct pci_dev *dev);
>  #else
>  static inline void pci_dev_assign_slot(struct pci_dev *dev) { }
> +static inline struct pci_slot *pci_create_slot(struct pci_bus *parent,
> +					       int slot_nr,
> +					       const char *name,
> +					       struct hotplug_slot *hotplug) {
> +	return ERR_PTR(-EINVAL);
> +}
> +static inline void pci_destroy_slot(struct pci_slot *slot) { }
>  #endif
>  int pci_scan_slot(struct pci_bus *bus, int devfn);
>  struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);
> 

The serial number in slot info is used to match VF NIC with Synthetic NIC.
Without selecting SYSFS, the SRIOV feature will fail on VM on Hyper-V and
Azure. The first version of this patch should be used.

@Stephen Hemminger how do you think?

Thanks,
- Haiyang

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled
  2019-07-03 18:06 ` Haiyang Zhang
@ 2019-07-07 17:46   ` Randy Dunlap
  2019-07-08 15:05     ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2019-07-07 17:46 UTC (permalink / raw)
  To: Haiyang Zhang, LKML, linux-pci, Stephen Hemminger
  Cc: Matthew Wilcox, Jake Oshins, KY Srinivasan, Sasha Levin,
	Bjorn Helgaas, linux-hyperv, Dexuan Cui, Yuehaibing,
	Stephen Hemminger

On 7/3/19 11:06 AM, Haiyang Zhang wrote:
> 
> 
>> -----Original Message-----
>> From: Randy Dunlap <rdunlap@infradead.org>
>> Sent: Wednesday, July 3, 2019 12:59 PM
>> To: LKML <linux-kernel@vger.kernel.org>; linux-pci <linux-
>> pci@vger.kernel.org>
>> Cc: Matthew Wilcox <willy@infradead.org>; Jake Oshins
>> <jakeo@microsoft.com>; KY Srinivasan <kys@microsoft.com>; Haiyang
>> Zhang <haiyangz@microsoft.com>; Stephen Hemminger
>> <sthemmin@microsoft.com>; Sasha Levin <sashal@kernel.org>; Bjorn
>> Helgaas <bhelgaas@google.com>; linux-hyperv@vger.kernel.org; Dexuan
>> Cui <decui@microsoft.com>; Yuehaibing <yuehaibing@huawei.com>
>> Subject: [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled
>>
>> From: Randy Dunlap <rdunlap@infradead.org>
>>
>> Fix build of drivers/pci/controller/pci-hyperv.o when
>> CONFIG_SYSFS is not set/enabled by adding stubs for
>> pci_create_slot() and pci_destroy_slot().
>>
>> Fixes these build errors:
>>
>> ERROR: "pci_destroy_slot" [drivers/pci/controller/pci-hyperv.ko] undefined!
>> ERROR: "pci_create_slot" [drivers/pci/controller/pci-hyperv.ko] undefined!
>>
>> Fixes: a15f2c08c708 ("PCI: hv: support reporting serial number as slot
>> information")
>>
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Matthew Wilcox <willy@infradead.org>
>> Cc: Jake Oshins <jakeo@microsoft.com>
>> Cc: "K. Y. Srinivasan" <kys@microsoft.com>
>> Cc: Haiyang Zhang <haiyangz@microsoft.com>
>> Cc: Stephen Hemminger <sthemmin@microsoft.com>
>> Cc: Sasha Levin <sashal@kernel.org>
>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>> Cc: linux-pci@vger.kernel.org
>> Cc: linux-hyperv@vger.kernel.org
>> Cc: Dexuan Cui <decui@microsoft.com>
>> Cc: Yuehaibing <yuehaibing@huawei.com>
>> ---
>> v2:
>> - provide non-CONFIG_SYSFS stubs for pci_create_slot() and
>>   pci_destroy_slot() [suggested by Matthew Wilcox <willy@infradead.org>]
>> - use the correct Fixes: tag [Dexuan Cui <decui@microsoft.com>]
>>
>>  include/linux/pci.h |   12 ++++++++++--
>>  1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> --- lnx-52-rc7.orig/include/linux/pci.h
>> +++ lnx-52-rc7/include/linux/pci.h
>> @@ -25,6 +25,7 @@
>>  #include <linux/ioport.h>
>>  #include <linux/list.h>
>>  #include <linux/compiler.h>
>> +#include <linux/err.h>
>>  #include <linux/errno.h>
>>  #include <linux/kobject.h>
>>  #include <linux/atomic.h>
>> @@ -947,14 +948,21 @@ int pci_scan_root_bus_bridge(struct pci_
>>  struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev
>> *dev,
>>  				int busnr);
>>  void pcie_update_link_speed(struct pci_bus *bus, u16 link_status);
>> +#ifdef CONFIG_SYSFS
>> +void pci_dev_assign_slot(struct pci_dev *dev);
>>  struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
>>  				 const char *name,
>>  				 struct hotplug_slot *hotplug);
>>  void pci_destroy_slot(struct pci_slot *slot);
>> -#ifdef CONFIG_SYSFS
>> -void pci_dev_assign_slot(struct pci_dev *dev);
>>  #else
>>  static inline void pci_dev_assign_slot(struct pci_dev *dev) { }
>> +static inline struct pci_slot *pci_create_slot(struct pci_bus *parent,
>> +					       int slot_nr,
>> +					       const char *name,
>> +					       struct hotplug_slot *hotplug) {
>> +	return ERR_PTR(-EINVAL);
>> +}
>> +static inline void pci_destroy_slot(struct pci_slot *slot) { }
>>  #endif
>>  int pci_scan_slot(struct pci_bus *bus, int devfn);
>>  struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);
>>
> 
> The serial number in slot info is used to match VF NIC with Synthetic NIC.
> Without selecting SYSFS, the SRIOV feature will fail on VM on Hyper-V and
> Azure. The first version of this patch should be used.
> 
> @Stephen Hemminger how do you think?
> 
> Thanks,
> - Haiyang


Hi Stephen,

Please comment on this patch or v1.
v1:  https://lore.kernel.org/lkml/69c25bc3-da00-2758-92ee-13c82b51fc45@infradead.org/


thanks.
-- 
~Randy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled
  2019-07-07 17:46   ` Randy Dunlap
@ 2019-07-08 15:05     ` Stephen Hemminger
  2019-07-09  0:38       ` Randy Dunlap
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2019-07-08 15:05 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Haiyang Zhang, LKML, linux-pci, Stephen Hemminger,
	Matthew Wilcox, Jake Oshins, KY Srinivasan, Sasha Levin,
	Bjorn Helgaas, linux-hyperv, Dexuan Cui, Yuehaibing

On Sun, 7 Jul 2019 10:46:22 -0700
Randy Dunlap <rdunlap@infradead.org> wrote:

> On 7/3/19 11:06 AM, Haiyang Zhang wrote:
> > 
> >   
> >> -----Original Message-----
> >> From: Randy Dunlap <rdunlap@infradead.org>
> >> Sent: Wednesday, July 3, 2019 12:59 PM
> >> To: LKML <linux-kernel@vger.kernel.org>; linux-pci <linux-  
> >> pci@vger.kernel.org>  
> >> Cc: Matthew Wilcox <willy@infradead.org>; Jake Oshins
> >> <jakeo@microsoft.com>; KY Srinivasan <kys@microsoft.com>; Haiyang
> >> Zhang <haiyangz@microsoft.com>; Stephen Hemminger
> >> <sthemmin@microsoft.com>; Sasha Levin <sashal@kernel.org>; Bjorn
> >> Helgaas <bhelgaas@google.com>; linux-hyperv@vger.kernel.org; Dexuan
> >> Cui <decui@microsoft.com>; Yuehaibing <yuehaibing@huawei.com>
> >> Subject: [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled
> >>
> >> From: Randy Dunlap <rdunlap@infradead.org>
> >>
> >> Fix build of drivers/pci/controller/pci-hyperv.o when
> >> CONFIG_SYSFS is not set/enabled by adding stubs for
> >> pci_create_slot() and pci_destroy_slot().
> >>
> >> Fixes these build errors:
> >>
> >> ERROR: "pci_destroy_slot" [drivers/pci/controller/pci-hyperv.ko] undefined!
> >> ERROR: "pci_create_slot" [drivers/pci/controller/pci-hyperv.ko] undefined!
> >>
> >> Fixes: a15f2c08c708 ("PCI: hv: support reporting serial number as slot
> >> information")
> >>
> >> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> >> Cc: Matthew Wilcox <willy@infradead.org>
> >> Cc: Jake Oshins <jakeo@microsoft.com>
> >> Cc: "K. Y. Srinivasan" <kys@microsoft.com>
> >> Cc: Haiyang Zhang <haiyangz@microsoft.com>
> >> Cc: Stephen Hemminger <sthemmin@microsoft.com>
> >> Cc: Sasha Levin <sashal@kernel.org>
> >> Cc: Bjorn Helgaas <bhelgaas@google.com>
> >> Cc: linux-pci@vger.kernel.org
> >> Cc: linux-hyperv@vger.kernel.org
> >> Cc: Dexuan Cui <decui@microsoft.com>
> >> Cc: Yuehaibing <yuehaibing@huawei.com>
> >> ---
> >> v2:
> >> - provide non-CONFIG_SYSFS stubs for pci_create_slot() and
> >>   pci_destroy_slot() [suggested by Matthew Wilcox <willy@infradead.org>]
> >> - use the correct Fixes: tag [Dexuan Cui <decui@microsoft.com>]
> >>
> >>  include/linux/pci.h |   12 ++++++++++--
> >>  1 file changed, 10 insertions(+), 2 deletions(-)
> >>
> >> --- lnx-52-rc7.orig/include/linux/pci.h
> >> +++ lnx-52-rc7/include/linux/pci.h
> >> @@ -25,6 +25,7 @@
> >>  #include <linux/ioport.h>
> >>  #include <linux/list.h>
> >>  #include <linux/compiler.h>
> >> +#include <linux/err.h>
> >>  #include <linux/errno.h>
> >>  #include <linux/kobject.h>
> >>  #include <linux/atomic.h>
> >> @@ -947,14 +948,21 @@ int pci_scan_root_bus_bridge(struct pci_
> >>  struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev
> >> *dev,
> >>  				int busnr);
> >>  void pcie_update_link_speed(struct pci_bus *bus, u16 link_status);
> >> +#ifdef CONFIG_SYSFS
> >> +void pci_dev_assign_slot(struct pci_dev *dev);
> >>  struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
> >>  				 const char *name,
> >>  				 struct hotplug_slot *hotplug);
> >>  void pci_destroy_slot(struct pci_slot *slot);
> >> -#ifdef CONFIG_SYSFS
> >> -void pci_dev_assign_slot(struct pci_dev *dev);
> >>  #else
> >>  static inline void pci_dev_assign_slot(struct pci_dev *dev) { }
> >> +static inline struct pci_slot *pci_create_slot(struct pci_bus *parent,
> >> +					       int slot_nr,
> >> +					       const char *name,
> >> +					       struct hotplug_slot *hotplug) {
> >> +	return ERR_PTR(-EINVAL);
> >> +}
> >> +static inline void pci_destroy_slot(struct pci_slot *slot) { }
> >>  #endif
> >>  int pci_scan_slot(struct pci_bus *bus, int devfn);
> >>  struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);
> >>  
> > 
> > The serial number in slot info is used to match VF NIC with Synthetic NIC.
> > Without selecting SYSFS, the SRIOV feature will fail on VM on Hyper-V and
> > Azure. The first version of this patch should be used.
> > 
> > @Stephen Hemminger how do you think?

Haiyang is right, accelerated networking won't work if slot is not recorded.

So the original patch (to depend on SYSFS) or using "select SYSFS" is
are necessary.

The whole thing is a bit of "angels dancing on the head of a pin" because
there is no good reason to build kernel without SYSFS in real world.
It would just be looking for trouble. As far as I can tell it is all
about getting "make randconfig" to work in more cases.

 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled
  2019-07-08 15:05     ` Stephen Hemminger
@ 2019-07-09  0:38       ` Randy Dunlap
  0 siblings, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2019-07-09  0:38 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Haiyang Zhang, LKML, linux-pci, Stephen Hemminger,
	Matthew Wilcox, Jake Oshins, KY Srinivasan, Sasha Levin,
	Bjorn Helgaas, linux-hyperv, Dexuan Cui, Yuehaibing

On 7/8/19 8:05 AM, Stephen Hemminger wrote:
> On Sun, 7 Jul 2019 10:46:22 -0700
> Randy Dunlap <rdunlap@infradead.org> wrote:
> 
>> On 7/3/19 11:06 AM, Haiyang Zhang wrote:
>>>
>>>   
>>>> -----Original Message-----
>>>> From: Randy Dunlap <rdunlap@infradead.org>
>>>> Sent: Wednesday, July 3, 2019 12:59 PM
>>>> To: LKML <linux-kernel@vger.kernel.org>; linux-pci <linux-  
>>>> pci@vger.kernel.org>  
>>>> Cc: Matthew Wilcox <willy@infradead.org>; Jake Oshins
>>>> <jakeo@microsoft.com>; KY Srinivasan <kys@microsoft.com>; Haiyang
>>>> Zhang <haiyangz@microsoft.com>; Stephen Hemminger
>>>> <sthemmin@microsoft.com>; Sasha Levin <sashal@kernel.org>; Bjorn
>>>> Helgaas <bhelgaas@google.com>; linux-hyperv@vger.kernel.org; Dexuan
>>>> Cui <decui@microsoft.com>; Yuehaibing <yuehaibing@huawei.com>
>>>> Subject: [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled
>>>>
>>>> From: Randy Dunlap <rdunlap@infradead.org>
>>>>
>>>> Fix build of drivers/pci/controller/pci-hyperv.o when
>>>> CONFIG_SYSFS is not set/enabled by adding stubs for
>>>> pci_create_slot() and pci_destroy_slot().
>>>>
>>>> Fixes these build errors:
>>>>
>>>> ERROR: "pci_destroy_slot" [drivers/pci/controller/pci-hyperv.ko] undefined!
>>>> ERROR: "pci_create_slot" [drivers/pci/controller/pci-hyperv.ko] undefined!
>>>>
>>>> Fixes: a15f2c08c708 ("PCI: hv: support reporting serial number as slot
>>>> information")
>>>>
>>>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>>>> Cc: Matthew Wilcox <willy@infradead.org>
>>>> Cc: Jake Oshins <jakeo@microsoft.com>
>>>> Cc: "K. Y. Srinivasan" <kys@microsoft.com>
>>>> Cc: Haiyang Zhang <haiyangz@microsoft.com>
>>>> Cc: Stephen Hemminger <sthemmin@microsoft.com>
>>>> Cc: Sasha Levin <sashal@kernel.org>
>>>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>>>> Cc: linux-pci@vger.kernel.org
>>>> Cc: linux-hyperv@vger.kernel.org
>>>> Cc: Dexuan Cui <decui@microsoft.com>
>>>> Cc: Yuehaibing <yuehaibing@huawei.com>
>>>> ---
>>>> v2:
>>>> - provide non-CONFIG_SYSFS stubs for pci_create_slot() and
>>>>   pci_destroy_slot() [suggested by Matthew Wilcox <willy@infradead.org>]
>>>> - use the correct Fixes: tag [Dexuan Cui <decui@microsoft.com>]
>>>>
>>>>  include/linux/pci.h |   12 ++++++++++--
>>>>  1 file changed, 10 insertions(+), 2 deletions(-)
>>>>
>>>> --- lnx-52-rc7.orig/include/linux/pci.h
>>>> +++ lnx-52-rc7/include/linux/pci.h
>>>> @@ -25,6 +25,7 @@
>>>>  #include <linux/ioport.h>
>>>>  #include <linux/list.h>
>>>>  #include <linux/compiler.h>
>>>> +#include <linux/err.h>
>>>>  #include <linux/errno.h>
>>>>  #include <linux/kobject.h>
>>>>  #include <linux/atomic.h>
>>>> @@ -947,14 +948,21 @@ int pci_scan_root_bus_bridge(struct pci_
>>>>  struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev
>>>> *dev,
>>>>  				int busnr);
>>>>  void pcie_update_link_speed(struct pci_bus *bus, u16 link_status);
>>>> +#ifdef CONFIG_SYSFS
>>>> +void pci_dev_assign_slot(struct pci_dev *dev);
>>>>  struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
>>>>  				 const char *name,
>>>>  				 struct hotplug_slot *hotplug);
>>>>  void pci_destroy_slot(struct pci_slot *slot);
>>>> -#ifdef CONFIG_SYSFS
>>>> -void pci_dev_assign_slot(struct pci_dev *dev);
>>>>  #else
>>>>  static inline void pci_dev_assign_slot(struct pci_dev *dev) { }
>>>> +static inline struct pci_slot *pci_create_slot(struct pci_bus *parent,
>>>> +					       int slot_nr,
>>>> +					       const char *name,
>>>> +					       struct hotplug_slot *hotplug) {
>>>> +	return ERR_PTR(-EINVAL);
>>>> +}
>>>> +static inline void pci_destroy_slot(struct pci_slot *slot) { }
>>>>  #endif
>>>>  int pci_scan_slot(struct pci_bus *bus, int devfn);
>>>>  struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);
>>>>  
>>>
>>> The serial number in slot info is used to match VF NIC with Synthetic NIC.
>>> Without selecting SYSFS, the SRIOV feature will fail on VM on Hyper-V and
>>> Azure. The first version of this patch should be used.
>>>
>>> @Stephen Hemminger how do you think?
> 
> Haiyang is right, accelerated networking won't work if slot is not recorded.
> 
> So the original patch (to depend on SYSFS) or using "select SYSFS" is
> are necessary.

Thanks, I'll resend that one with the corrected Fixes: tag.

> The whole thing is a bit of "angels dancing on the head of a pin" because
> there is no good reason to build kernel without SYSFS in real world.
> It would just be looking for trouble. As far as I can tell it is all
> about getting "make randconfig" to work in more cases.

You could submit a patch to remove the SYSFS kconfig entry.  :)

cheers.

-- 
~Randy

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-03 16:59 [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled Randy Dunlap
2019-07-03 18:06 ` Haiyang Zhang
2019-07-07 17:46   ` Randy Dunlap
2019-07-08 15:05     ` Stephen Hemminger
2019-07-09  0:38       ` Randy Dunlap

Linux-HyperV Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hyperv/0 linux-hyperv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hyperv linux-hyperv/ https://lore.kernel.org/linux-hyperv \
		linux-hyperv@vger.kernel.org linux-hyperv@archiver.kernel.org
	public-inbox-index linux-hyperv


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hyperv


AGPL code for this site: git clone https://public-inbox.org/ public-inbox