2022-11-30 20:30:23

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH 1/2 v2] IB/qib: don't use qib_wc_x86_64 for UML

When building qib_wc_x86_64.c on ARCH=um, references to some cpuinfo
fields cause build errors since cpuinfo does not contain x86-specific
fields.

Fix the build errors by making this driver depend on !UML.

Prevents these build errors:

../drivers/infiniband/hw/qib/qib_wc_x86_64.c: In function ‘qib_unordered_wc’:
../drivers/infiniband/hw/qib/qib_wc_x86_64.c:149:29: error: ‘struct cpuinfo_um’ has no member named ‘x86_vendor’
149 | return boot_cpu_data.x86_vendor != X86_VENDOR_AMD;
../drivers/infiniband/hw/qib/qib_wc_x86_64.c:149:44: error: ‘X86_VENDOR_AMD’ undeclared (first use in this function); did you mean ‘X86_VENDOR_ANY’?
149 | return boot_cpu_data.x86_vendor != X86_VENDOR_AMD;
../drivers/infiniband/hw/qib/qib_wc_x86_64.c:149:44: note: each undeclared identifier is reported only once for each function it appears in
../drivers/infiniband/hw/qib/qib_wc_x86_64.c:150:1: error: control reaches end of non-void function [-Werror=return-type]
150 | }

Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver")
Signed-off-by: Randy Dunlap <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Cc: Leon Romanovsky <[email protected]>
Cc: Dennis Dalessandro <[email protected]>
Cc: [email protected]
Cc: Jeff Dike <[email protected]>
Cc: Richard Weinberger <[email protected]>
Cc: Anton Ivanov <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: [email protected]
---
v2: rebase & resend

drivers/infiniband/hw/qib/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff -- a/drivers/infiniband/hw/qib/Kconfig b/drivers/infiniband/hw/qib/Kconfig
--- a/drivers/infiniband/hw/qib/Kconfig
+++ b/drivers/infiniband/hw/qib/Kconfig
@@ -3,6 +3,7 @@ config INFINIBAND_QIB
tristate "Intel PCIe HCA support"
depends on 64BIT && INFINIBAND_RDMAVT
depends on PCI
+ depends on !UML
help
This is a low-level driver for Intel PCIe QLE InfiniBand host
channel adapters. This driver does not support the Intel


2022-12-01 09:43:38

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/2 v2] IB/qib: don't use qib_wc_x86_64 for UML

On Thu, 2022-12-01 at 11:22 +0200, Leon Romanovsky wrote:
>
> > +++ b/drivers/infiniband/hw/qib/Kconfig
> > @@ -3,6 +3,7 @@ config INFINIBAND_QIB
> > tristate "Intel PCIe HCA support"
> > depends on 64BIT && INFINIBAND_RDMAVT
> > depends on PCI
> > + depends on !UML
>
> I would advocate to add this line to whole drivers/infiniband.
> None of RDMA code makes sense for UML.
>

You could argue that one might want to eventually use kunit for some
bits and pieces in there, so it'd make sense to be able to build the
parts that _can_ be built, but I have no idea :)

johannes

2022-12-01 09:47:16

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH 1/2 v2] IB/qib: don't use qib_wc_x86_64 for UML

On Wed, Nov 30, 2022 at 12:09:45PM -0800, Randy Dunlap wrote:
> When building qib_wc_x86_64.c on ARCH=um, references to some cpuinfo
> fields cause build errors since cpuinfo does not contain x86-specific
> fields.
>
> Fix the build errors by making this driver depend on !UML.
>
> Prevents these build errors:
>
> ../drivers/infiniband/hw/qib/qib_wc_x86_64.c: In function ‘qib_unordered_wc’:
> ../drivers/infiniband/hw/qib/qib_wc_x86_64.c:149:29: error: ‘struct cpuinfo_um’ has no member named ‘x86_vendor’
> 149 | return boot_cpu_data.x86_vendor != X86_VENDOR_AMD;
> ../drivers/infiniband/hw/qib/qib_wc_x86_64.c:149:44: error: ‘X86_VENDOR_AMD’ undeclared (first use in this function); did you mean ‘X86_VENDOR_ANY’?
> 149 | return boot_cpu_data.x86_vendor != X86_VENDOR_AMD;
> ../drivers/infiniband/hw/qib/qib_wc_x86_64.c:149:44: note: each undeclared identifier is reported only once for each function it appears in
> ../drivers/infiniband/hw/qib/qib_wc_x86_64.c:150:1: error: control reaches end of non-void function [-Werror=return-type]
> 150 | }
>
> Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver")
> Signed-off-by: Randy Dunlap <[email protected]>
> Cc: Jason Gunthorpe <[email protected]>
> Cc: Leon Romanovsky <[email protected]>
> Cc: Dennis Dalessandro <[email protected]>
> Cc: [email protected]
> Cc: Jeff Dike <[email protected]>
> Cc: Richard Weinberger <[email protected]>
> Cc: Anton Ivanov <[email protected]>
> Cc: Johannes Berg <[email protected]>
> Cc: [email protected]
> ---
> v2: rebase & resend
>
> drivers/infiniband/hw/qib/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff -- a/drivers/infiniband/hw/qib/Kconfig b/drivers/infiniband/hw/qib/Kconfig
> --- a/drivers/infiniband/hw/qib/Kconfig
> +++ b/drivers/infiniband/hw/qib/Kconfig
> @@ -3,6 +3,7 @@ config INFINIBAND_QIB
> tristate "Intel PCIe HCA support"
> depends on 64BIT && INFINIBAND_RDMAVT
> depends on PCI
> + depends on !UML

I would advocate to add this line to whole drivers/infiniband.
None of RDMA code makes sense for UML.

Thanks

> help
> This is a low-level driver for Intel PCIe QLE InfiniBand host
> channel adapters. This driver does not support the Intel

2022-12-01 09:51:47

by Richard Weinberger

[permalink] [raw]
Subject: Re: [PATCH 1/2 v2] IB/qib: don't use qib_wc_x86_64 for UML

----- Ursprüngliche Mail -----
> I would advocate to add this line to whole drivers/infiniband.
> None of RDMA code makes sense for UML.

Yes. Makes sense.

Thanks,
//richard

2022-12-01 10:36:14

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH 1/2 v2] IB/qib: don't use qib_wc_x86_64 for UML

On Thu, Dec 01, 2022 at 10:28:18AM +0100, Johannes Berg wrote:
> On Thu, 2022-12-01 at 11:22 +0200, Leon Romanovsky wrote:
> >
> > > +++ b/drivers/infiniband/hw/qib/Kconfig
> > > @@ -3,6 +3,7 @@ config INFINIBAND_QIB
> > > tristate "Intel PCIe HCA support"
> > > depends on 64BIT && INFINIBAND_RDMAVT
> > > depends on PCI
> > > + depends on !UML
> >
> > I would advocate to add this line to whole drivers/infiniband.
> > None of RDMA code makes sense for UML.
> >
>
> You could argue that one might want to eventually use kunit for some
> bits and pieces in there, so it'd make sense to be able to build the
> parts that _can_ be built, but I have no idea :)

But now, we don't have anyone in RDMA who uses kunit. Once it will be
needed, he/she will extend drivers/infiniband to support it.

Thanks

>
> johannes

2022-12-01 17:23:22

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 1/2 v2] IB/qib: don't use qib_wc_x86_64 for UML

On Thu, Dec 01, 2022 at 11:22:04AM +0200, Leon Romanovsky wrote:
> I would advocate to add this line to whole drivers/infiniband.
> None of RDMA code makes sense for UML.

software iWarp and RoCE absolutely make sense on UML.

2022-12-01 19:10:17

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH 1/2 v2] IB/qib: don't use qib_wc_x86_64 for UML

On Thu, Dec 01, 2022 at 09:15:31AM -0800, Christoph Hellwig wrote:
> On Thu, Dec 01, 2022 at 11:22:04AM +0200, Leon Romanovsky wrote:
> > I would advocate to add this line to whole drivers/infiniband.
> > None of RDMA code makes sense for UML.
>
> software iWarp and RoCE absolutely make sense on UML.

Ok, to be more pedantic "none of RDMA HW code ...".
However does anybody use rxe or siw in UML?

Thanks