linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RDMA/hns: Fix build error for hip08
@ 2019-07-23  2:49 YueHaibing
  2019-07-23  7:43 ` Leon Romanovsky
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: YueHaibing @ 2019-07-23  2:49 UTC (permalink / raw)
  To: oulijun, xavier.huwei, dledford, jgg; +Cc: linux-kernel, linux-rdma, YueHaibing

If INFINIBAND_HNS_HIP08 is selected and HNS3 is m,
but INFINIBAND_HNS is y, building fails:

drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_exit':
hns_roce_hw_v2.c:(.exit.text+0xd): undefined reference to `hnae3_unregister_client'
drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_init':
hns_roce_hw_v2.c:(.init.text+0xd): undefined reference to `hnae3_register_client'

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: dd74282df573 ("RDMA/hns: Initialize the PCI device for hip08 RoCE")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/infiniband/hw/hns/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/Kconfig b/drivers/infiniband/hw/hns/Kconfig
index b59da5d..4371c80 100644
--- a/drivers/infiniband/hw/hns/Kconfig
+++ b/drivers/infiniband/hw/hns/Kconfig
@@ -23,7 +23,8 @@ config INFINIBAND_HNS_HIP06
 
 config INFINIBAND_HNS_HIP08
 	bool "Hisilicon Hip08 Family RoCE support"
-	depends on INFINIBAND_HNS && PCI && HNS3
+	depends on INFINIBAND_HNS && (INFINIBAND_HNS = HNS3)
+	depends on PCI
 	---help---
 	  RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip08 SoC.
 	  The RoCE engine is a PCI device.
-- 
2.7.4



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

* Re: [PATCH] RDMA/hns: Fix build error for hip08
  2019-07-23  2:49 [PATCH] RDMA/hns: Fix build error for hip08 YueHaibing
@ 2019-07-23  7:43 ` Leon Romanovsky
  2019-07-23 10:06   ` Yuehaibing
  2019-07-23 12:34   ` Jason Gunthorpe
  2019-07-24  3:40 ` [PATCH v2] " YueHaibing
  2019-07-24  6:54 ` [PATCH] RDMA/hns: Fix build error YueHaibing
  2 siblings, 2 replies; 14+ messages in thread
From: Leon Romanovsky @ 2019-07-23  7:43 UTC (permalink / raw)
  To: YueHaibing; +Cc: oulijun, xavier.huwei, dledford, jgg, linux-kernel, linux-rdma

On Tue, Jul 23, 2019 at 10:49:08AM +0800, YueHaibing wrote:
> If INFINIBAND_HNS_HIP08 is selected and HNS3 is m,
> but INFINIBAND_HNS is y, building fails:
>
> drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_exit':
> hns_roce_hw_v2.c:(.exit.text+0xd): undefined reference to `hnae3_unregister_client'
> drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_init':
> hns_roce_hw_v2.c:(.init.text+0xd): undefined reference to `hnae3_register_client'

It means that you have a problem with header files of your hns3.

>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: dd74282df573 ("RDMA/hns: Initialize the PCI device for hip08 RoCE")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/infiniband/hw/hns/Kconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/hns/Kconfig b/drivers/infiniband/hw/hns/Kconfig
> index b59da5d..4371c80 100644
> --- a/drivers/infiniband/hw/hns/Kconfig
> +++ b/drivers/infiniband/hw/hns/Kconfig
> @@ -23,7 +23,8 @@ config INFINIBAND_HNS_HIP06
>
>  config INFINIBAND_HNS_HIP08
>  	bool "Hisilicon Hip08 Family RoCE support"
> -	depends on INFINIBAND_HNS && PCI && HNS3
> +	depends on INFINIBAND_HNS && (INFINIBAND_HNS = HNS3)

This is wrong.

> +	depends on PCI
>  	---help---
>  	  RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip08 SoC.
>  	  The RoCE engine is a PCI device.
> --
> 2.7.4
>
>

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

* Re: [PATCH] RDMA/hns: Fix build error for hip08
  2019-07-23  7:43 ` Leon Romanovsky
@ 2019-07-23 10:06   ` Yuehaibing
  2019-07-23 10:17     ` Leon Romanovsky
  2019-07-23 12:34   ` Jason Gunthorpe
  1 sibling, 1 reply; 14+ messages in thread
From: Yuehaibing @ 2019-07-23 10:06 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: oulijun, xavier.huwei, dledford, jgg, linux-kernel, linux-rdma


On 2019/7/23 15:43, Leon Romanovsky wrote:
> On Tue, Jul 23, 2019 at 10:49:08AM +0800, YueHaibing wrote:
>> If INFINIBAND_HNS_HIP08 is selected and HNS3 is m,
>> but INFINIBAND_HNS is y, building fails:
>>
>> drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_exit':
>> hns_roce_hw_v2.c:(.exit.text+0xd): undefined reference to `hnae3_unregister_client'
>> drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_init':
>> hns_roce_hw_v2.c:(.init.text+0xd): undefined reference to `hnae3_register_client'
> 
> It means that you have a problem with header files of your hns3.

hnae3_unregister_client is a EXPORT_SYMBOL. If INFINIBAND_HNS is y,
hns-roce-hw-v2 will be built-in, but as HNS3 is set to m, linking will failed.

I can't see how to fix this in header files of hns3, or am I missing something?

> 
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Fixes: dd74282df573 ("RDMA/hns: Initialize the PCI device for hip08 RoCE")
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>>  drivers/infiniband/hw/hns/Kconfig | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/infiniband/hw/hns/Kconfig b/drivers/infiniband/hw/hns/Kconfig
>> index b59da5d..4371c80 100644
>> --- a/drivers/infiniband/hw/hns/Kconfig
>> +++ b/drivers/infiniband/hw/hns/Kconfig
>> @@ -23,7 +23,8 @@ config INFINIBAND_HNS_HIP06
>>
>>  config INFINIBAND_HNS_HIP08
>>  	bool "Hisilicon Hip08 Family RoCE support"
>> -	depends on INFINIBAND_HNS && PCI && HNS3
>> +	depends on INFINIBAND_HNS && (INFINIBAND_HNS = HNS3)
> 
> This is wrong.
> 
>> +	depends on PCI
>>  	---help---
>>  	  RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip08 SoC.
>>  	  The RoCE engine is a PCI device.
>> --
>> 2.7.4
>>
>>
> 
> .
> 


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

* Re: [PATCH] RDMA/hns: Fix build error for hip08
  2019-07-23 10:06   ` Yuehaibing
@ 2019-07-23 10:17     ` Leon Romanovsky
  0 siblings, 0 replies; 14+ messages in thread
From: Leon Romanovsky @ 2019-07-23 10:17 UTC (permalink / raw)
  To: Yuehaibing; +Cc: oulijun, xavier.huwei, dledford, jgg, linux-kernel, linux-rdma

On Tue, Jul 23, 2019 at 06:06:22PM +0800, Yuehaibing wrote:
>
> On 2019/7/23 15:43, Leon Romanovsky wrote:
> > On Tue, Jul 23, 2019 at 10:49:08AM +0800, YueHaibing wrote:
> >> If INFINIBAND_HNS_HIP08 is selected and HNS3 is m,
> >> but INFINIBAND_HNS is y, building fails:
> >>
> >> drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_exit':
> >> hns_roce_hw_v2.c:(.exit.text+0xd): undefined reference to `hnae3_unregister_client'
> >> drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_init':
> >> hns_roce_hw_v2.c:(.init.text+0xd): undefined reference to `hnae3_register_client'
> >
> > It means that you have a problem with header files of your hns3.
>
> hnae3_unregister_client is a EXPORT_SYMBOL. If INFINIBAND_HNS is y,
> hns-roce-hw-v2 will be built-in, but as HNS3 is set to m, linking will failed.

One of the possible solution is to add "select" identifier to your
Kconfig, it will ensure that HNS3 will be set to "y" too.

Thanks

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

* Re: [PATCH] RDMA/hns: Fix build error for hip08
  2019-07-23  7:43 ` Leon Romanovsky
  2019-07-23 10:06   ` Yuehaibing
@ 2019-07-23 12:34   ` Jason Gunthorpe
  2019-07-23 13:35     ` Leon Romanovsky
  1 sibling, 1 reply; 14+ messages in thread
From: Jason Gunthorpe @ 2019-07-23 12:34 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: YueHaibing, oulijun, xavier.huwei, dledford, linux-kernel, linux-rdma

On Tue, Jul 23, 2019 at 10:43:39AM +0300, Leon Romanovsky wrote:
> On Tue, Jul 23, 2019 at 10:49:08AM +0800, YueHaibing wrote:
> > If INFINIBAND_HNS_HIP08 is selected and HNS3 is m,
> > but INFINIBAND_HNS is y, building fails:
> >
> > drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_exit':
> > hns_roce_hw_v2.c:(.exit.text+0xd): undefined reference to `hnae3_unregister_client'
> > drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_init':
> > hns_roce_hw_v2.c:(.init.text+0xd): undefined reference to `hnae3_register_client'
> 
> It means that you have a problem with header files of your hns3.
> 
> >
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Fixes: dd74282df573 ("RDMA/hns: Initialize the PCI device for hip08 RoCE")
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> >  drivers/infiniband/hw/hns/Kconfig | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/infiniband/hw/hns/Kconfig b/drivers/infiniband/hw/hns/Kconfig
> > index b59da5d..4371c80 100644
> > +++ b/drivers/infiniband/hw/hns/Kconfig
> > @@ -23,7 +23,8 @@ config INFINIBAND_HNS_HIP06
> >
> >  config INFINIBAND_HNS_HIP08
> >  	bool "Hisilicon Hip08 Family RoCE support"
> > -	depends on INFINIBAND_HNS && PCI && HNS3
> > +	depends on INFINIBAND_HNS && (INFINIBAND_HNS = HNS3)
> 
> This is wrong.

It is tricky. It is asserting that the IB side is built as a module if
the ethernet side is a module..

It is kind of a weird pattern as the module config is INFINIBAND_HNS
and these others are just bool opens what to include, but I think it
is OK..

Jason

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

* Re: [PATCH] RDMA/hns: Fix build error for hip08
  2019-07-23 12:34   ` Jason Gunthorpe
@ 2019-07-23 13:35     ` Leon Romanovsky
  2019-07-23 13:37       ` Jason Gunthorpe
  0 siblings, 1 reply; 14+ messages in thread
From: Leon Romanovsky @ 2019-07-23 13:35 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: YueHaibing, oulijun, xavier.huwei, dledford, linux-kernel, linux-rdma

On Tue, Jul 23, 2019 at 09:34:02AM -0300, Jason Gunthorpe wrote:
> On Tue, Jul 23, 2019 at 10:43:39AM +0300, Leon Romanovsky wrote:
> > On Tue, Jul 23, 2019 at 10:49:08AM +0800, YueHaibing wrote:
> > > If INFINIBAND_HNS_HIP08 is selected and HNS3 is m,
> > > but INFINIBAND_HNS is y, building fails:
> > >
> > > drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_exit':
> > > hns_roce_hw_v2.c:(.exit.text+0xd): undefined reference to `hnae3_unregister_client'
> > > drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_init':
> > > hns_roce_hw_v2.c:(.init.text+0xd): undefined reference to `hnae3_register_client'
> >
> > It means that you have a problem with header files of your hns3.
> >
> > >
> > > Reported-by: Hulk Robot <hulkci@huawei.com>
> > > Fixes: dd74282df573 ("RDMA/hns: Initialize the PCI device for hip08 RoCE")
> > > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> > >  drivers/infiniband/hw/hns/Kconfig | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/infiniband/hw/hns/Kconfig b/drivers/infiniband/hw/hns/Kconfig
> > > index b59da5d..4371c80 100644
> > > +++ b/drivers/infiniband/hw/hns/Kconfig
> > > @@ -23,7 +23,8 @@ config INFINIBAND_HNS_HIP06
> > >
> > >  config INFINIBAND_HNS_HIP08
> > >  	bool "Hisilicon Hip08 Family RoCE support"
> > > -	depends on INFINIBAND_HNS && PCI && HNS3
> > > +	depends on INFINIBAND_HNS && (INFINIBAND_HNS = HNS3)
> >
> > This is wrong.
>
> It is tricky. It is asserting that the IB side is built as a module if
> the ethernet side is a module..
>
> It is kind of a weird pattern as the module config is INFINIBAND_HNS
> and these others are just bool opens what to include, but I think it
> is OK..

select ???

>
> Jason

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

* Re: [PATCH] RDMA/hns: Fix build error for hip08
  2019-07-23 13:35     ` Leon Romanovsky
@ 2019-07-23 13:37       ` Jason Gunthorpe
  2019-07-24  3:10         ` Yuehaibing
  0 siblings, 1 reply; 14+ messages in thread
From: Jason Gunthorpe @ 2019-07-23 13:37 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: YueHaibing, oulijun, xavier.huwei, dledford, linux-kernel, linux-rdma

On Tue, Jul 23, 2019 at 04:35:40PM +0300, Leon Romanovsky wrote:
> On Tue, Jul 23, 2019 at 09:34:02AM -0300, Jason Gunthorpe wrote:
> > On Tue, Jul 23, 2019 at 10:43:39AM +0300, Leon Romanovsky wrote:
> > > On Tue, Jul 23, 2019 at 10:49:08AM +0800, YueHaibing wrote:
> > > > If INFINIBAND_HNS_HIP08 is selected and HNS3 is m,
> > > > but INFINIBAND_HNS is y, building fails:
> > > >
> > > > drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_exit':
> > > > hns_roce_hw_v2.c:(.exit.text+0xd): undefined reference to `hnae3_unregister_client'
> > > > drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_init':
> > > > hns_roce_hw_v2.c:(.init.text+0xd): undefined reference to `hnae3_register_client'
> > >
> > > It means that you have a problem with header files of your hns3.
> > >
> > > >
> > > > Reported-by: Hulk Robot <hulkci@huawei.com>
> > > > Fixes: dd74282df573 ("RDMA/hns: Initialize the PCI device for hip08 RoCE")
> > > > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> > > >  drivers/infiniband/hw/hns/Kconfig | 3 ++-
> > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/infiniband/hw/hns/Kconfig b/drivers/infiniband/hw/hns/Kconfig
> > > > index b59da5d..4371c80 100644
> > > > +++ b/drivers/infiniband/hw/hns/Kconfig
> > > > @@ -23,7 +23,8 @@ config INFINIBAND_HNS_HIP06
> > > >
> > > >  config INFINIBAND_HNS_HIP08
> > > >  	bool "Hisilicon Hip08 Family RoCE support"
> > > > -	depends on INFINIBAND_HNS && PCI && HNS3
> > > > +	depends on INFINIBAND_HNS && (INFINIBAND_HNS = HNS3)
> > >
> > > This is wrong.
> >
> > It is tricky. It is asserting that the IB side is built as a module if
> > the ethernet side is a module..
> >
> > It is kind of a weird pattern as the module config is INFINIBAND_HNS
> > and these others are just bool opens what to include, but I think it
> > is OK..
> 
> select ???

select doesn't influence module or not any different from depeends

Jason

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

* Re: [PATCH] RDMA/hns: Fix build error for hip08
  2019-07-23 13:37       ` Jason Gunthorpe
@ 2019-07-24  3:10         ` Yuehaibing
  0 siblings, 0 replies; 14+ messages in thread
From: Yuehaibing @ 2019-07-24  3:10 UTC (permalink / raw)
  To: Jason Gunthorpe, Leon Romanovsky
  Cc: oulijun, xavier.huwei, dledford, linux-kernel, linux-rdma

On 2019/7/23 21:37, Jason Gunthorpe wrote:
> On Tue, Jul 23, 2019 at 04:35:40PM +0300, Leon Romanovsky wrote:
>> On Tue, Jul 23, 2019 at 09:34:02AM -0300, Jason Gunthorpe wrote:
>>> On Tue, Jul 23, 2019 at 10:43:39AM +0300, Leon Romanovsky wrote:
>>>> On Tue, Jul 23, 2019 at 10:49:08AM +0800, YueHaibing wrote:
>>>>> If INFINIBAND_HNS_HIP08 is selected and HNS3 is m,
>>>>> but INFINIBAND_HNS is y, building fails:
>>>>>
>>>>> drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_exit':
>>>>> hns_roce_hw_v2.c:(.exit.text+0xd): undefined reference to `hnae3_unregister_client'
>>>>> drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_init':
>>>>> hns_roce_hw_v2.c:(.init.text+0xd): undefined reference to `hnae3_register_client'
>>>>
>>>> It means that you have a problem with header files of your hns3.
>>>>
>>>>>
>>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>>>> Fixes: dd74282df573 ("RDMA/hns: Initialize the PCI device for hip08 RoCE")
>>>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>>>>  drivers/infiniband/hw/hns/Kconfig | 3 ++-
>>>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/infiniband/hw/hns/Kconfig b/drivers/infiniband/hw/hns/Kconfig
>>>>> index b59da5d..4371c80 100644
>>>>> +++ b/drivers/infiniband/hw/hns/Kconfig
>>>>> @@ -23,7 +23,8 @@ config INFINIBAND_HNS_HIP06
>>>>>
>>>>>  config INFINIBAND_HNS_HIP08
>>>>>  	bool "Hisilicon Hip08 Family RoCE support"
>>>>> -	depends on INFINIBAND_HNS && PCI && HNS3
>>>>> +	depends on INFINIBAND_HNS && (INFINIBAND_HNS = HNS3)
>>>>
>>>> This is wrong.
>>>
>>> It is tricky. It is asserting that the IB side is built as a module if
>>> the ethernet side is a module..
>>>
>>> It is kind of a weird pattern as the module config is INFINIBAND_HNS
>>> and these others are just bool opens what to include, but I think it
>>> is OK..
>>
>> select ???
> 
> select doesn't influence module or not any different from depeends

Ok, it seems select is a better solution, it allows HNS3 is y while INFINIBAND_HNS is m,

Will send v2, Thanks!

> 
> Jason
> 
> .
> 


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

* [PATCH v2] RDMA/hns: Fix build error for hip08
  2019-07-23  2:49 [PATCH] RDMA/hns: Fix build error for hip08 YueHaibing
  2019-07-23  7:43 ` Leon Romanovsky
@ 2019-07-24  3:40 ` YueHaibing
  2019-07-24  6:12   ` Yuehaibing
  2019-07-24  6:54 ` [PATCH] RDMA/hns: Fix build error YueHaibing
  2 siblings, 1 reply; 14+ messages in thread
From: YueHaibing @ 2019-07-24  3:40 UTC (permalink / raw)
  To: oulijun, xavier.huwei, dledford, jgg, leon
  Cc: linux-kernel, linux-rdma, YueHaibing

If INFINIBAND_HNS_HIP08 is selected and HNS3 is m,
but INFINIBAND_HNS is y, building fails:

drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_exit':
hns_roce_hw_v2.c:(.exit.text+0xd): undefined reference to `hnae3_unregister_client'
drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_init':
hns_roce_hw_v2.c:(.init.text+0xd): undefined reference to `hnae3_register_client'

Reported-by: Hulk Robot <hulkci@huawei.com>
Suggested-by: Leon Romanovsky <leon@kernel.org>
Fixes: dd74282df573 ("RDMA/hns: Initialize the PCI device for hip08 RoCE")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: select HNS3 to fix this
---
 drivers/infiniband/hw/hns/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/Kconfig b/drivers/infiniband/hw/hns/Kconfig
index 8bf847b..b9dfac0 100644
--- a/drivers/infiniband/hw/hns/Kconfig
+++ b/drivers/infiniband/hw/hns/Kconfig
@@ -22,7 +22,8 @@ config INFINIBAND_HNS_HIP06
 
 config INFINIBAND_HNS_HIP08
 	bool "Hisilicon Hip08 Family RoCE support"
-	depends on INFINIBAND_HNS && PCI && HNS3
+	depends on INFINIBAND_HNS && PCI
+	select HNS3
 	---help---
 	  RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip08 SoC.
 	  The RoCE engine is a PCI device.
-- 
2.7.4



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

* Re: [PATCH v2] RDMA/hns: Fix build error for hip08
  2019-07-24  3:40 ` [PATCH v2] " YueHaibing
@ 2019-07-24  6:12   ` Yuehaibing
  0 siblings, 0 replies; 14+ messages in thread
From: Yuehaibing @ 2019-07-24  6:12 UTC (permalink / raw)
  To: oulijun, xavier.huwei, dledford, jgg, leon; +Cc: linux-kernel, linux-rdma


Pls drop this, this cannot fix the issue.

On 2019/7/24 11:40, YueHaibing wrote:
> If INFINIBAND_HNS_HIP08 is selected and HNS3 is m,
> but INFINIBAND_HNS is y, building fails:
> 
> drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_exit':
> hns_roce_hw_v2.c:(.exit.text+0xd): undefined reference to `hnae3_unregister_client'
> drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_init':
> hns_roce_hw_v2.c:(.init.text+0xd): undefined reference to `hnae3_register_client'
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Suggested-by: Leon Romanovsky <leon@kernel.org>
> Fixes: dd74282df573 ("RDMA/hns: Initialize the PCI device for hip08 RoCE")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> v2: select HNS3 to fix this
> ---
>  drivers/infiniband/hw/hns/Kconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/hns/Kconfig b/drivers/infiniband/hw/hns/Kconfig
> index 8bf847b..b9dfac0 100644
> --- a/drivers/infiniband/hw/hns/Kconfig
> +++ b/drivers/infiniband/hw/hns/Kconfig
> @@ -22,7 +22,8 @@ config INFINIBAND_HNS_HIP06
>  
>  config INFINIBAND_HNS_HIP08
>  	bool "Hisilicon Hip08 Family RoCE support"
> -	depends on INFINIBAND_HNS && PCI && HNS3
> +	depends on INFINIBAND_HNS && PCI
> +	select HNS3
>  	---help---
>  	  RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip08 SoC.
>  	  The RoCE engine is a PCI device.
> 


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

* [PATCH] RDMA/hns: Fix build error
  2019-07-23  2:49 [PATCH] RDMA/hns: Fix build error for hip08 YueHaibing
  2019-07-23  7:43 ` Leon Romanovsky
  2019-07-24  3:40 ` [PATCH v2] " YueHaibing
@ 2019-07-24  6:54 ` YueHaibing
  2019-07-24 11:32   ` Jason Gunthorpe
  2 siblings, 1 reply; 14+ messages in thread
From: YueHaibing @ 2019-07-24  6:54 UTC (permalink / raw)
  To: oulijun, xavier.huwei, dledford, jgg, leon
  Cc: linux-kernel, linux-rdma, YueHaibing

If INFINIBAND_HNS_HIP08 is selected and HNS3 is m,
but INFINIBAND_HNS is y, building fails:

drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_exit':
hns_roce_hw_v2.c:(.exit.text+0xd): undefined reference to `hnae3_unregister_client'
drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_init':
hns_roce_hw_v2.c:(.init.text+0xd): undefined reference to `hnae3_register_client'

Also if INFINIBAND_HNS_HIP06 is selected and HNS_DSAF
is m, but INFINIBAND_HNS is y, building fails:

drivers/infiniband/hw/hns/hns_roce_hw_v1.o: In function `hns_roce_v1_reset':
hns_roce_hw_v1.c:(.text+0x39fa): undefined reference to `hns_dsaf_roce_reset'
hns_roce_hw_v1.c:(.text+0x3a25): undefined reference to `hns_dsaf_roce_reset'

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: dd74282df573 ("RDMA/hns: Initialize the PCI device for hip08 RoCE")
Fixes: 08805fdbeb2d ("RDMA/hns: Split hw v1 driver from hns roce driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/infiniband/hw/hns/Kconfig  | 6 +++---
 drivers/infiniband/hw/hns/Makefile | 8 ++------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/hw/hns/Kconfig b/drivers/infiniband/hw/hns/Kconfig
index 8bf847b..5478219 100644
--- a/drivers/infiniband/hw/hns/Kconfig
+++ b/drivers/infiniband/hw/hns/Kconfig
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config INFINIBAND_HNS
-	tristate "HNS RoCE Driver"
+	bool "HNS RoCE Driver"
 	depends on NET_VENDOR_HISILICON
 	depends on ARM64 || (COMPILE_TEST && 64BIT)
 	---help---
@@ -11,7 +11,7 @@ config INFINIBAND_HNS
 	  To compile HIP06 or HIP08 driver as module, choose M here.
 
 config INFINIBAND_HNS_HIP06
-	bool "Hisilicon Hip06 Family RoCE support"
+	tristate "Hisilicon Hip06 Family RoCE support"
 	depends on INFINIBAND_HNS && HNS && HNS_DSAF && HNS_ENET
 	---help---
 	  RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip06 and
@@ -21,7 +21,7 @@ config INFINIBAND_HNS_HIP06
 	  module will be called hns-roce-hw-v1
 
 config INFINIBAND_HNS_HIP08
-	bool "Hisilicon Hip08 Family RoCE support"
+	tristate "Hisilicon Hip08 Family RoCE support"
 	depends on INFINIBAND_HNS && PCI && HNS3
 	---help---
 	  RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip08 SoC.
diff --git a/drivers/infiniband/hw/hns/Makefile b/drivers/infiniband/hw/hns/Makefile
index e105945..449a2d8 100644
--- a/drivers/infiniband/hw/hns/Makefile
+++ b/drivers/infiniband/hw/hns/Makefile
@@ -9,12 +9,8 @@ hns-roce-objs := hns_roce_main.o hns_roce_cmd.o hns_roce_pd.o \
 	hns_roce_ah.o hns_roce_hem.o hns_roce_mr.o hns_roce_qp.o \
 	hns_roce_cq.o hns_roce_alloc.o hns_roce_db.o hns_roce_srq.o hns_roce_restrack.o
 
-ifdef CONFIG_INFINIBAND_HNS_HIP06
 hns-roce-hw-v1-objs := hns_roce_hw_v1.o $(hns-roce-objs)
-obj-$(CONFIG_INFINIBAND_HNS) += hns-roce-hw-v1.o
-endif
+obj-$(CONFIG_INFINIBAND_HNS_HIP06) += hns-roce-hw-v1.o
 
-ifdef CONFIG_INFINIBAND_HNS_HIP08
 hns-roce-hw-v2-objs := hns_roce_hw_v2.o hns_roce_hw_v2_dfx.o $(hns-roce-objs)
-obj-$(CONFIG_INFINIBAND_HNS) += hns-roce-hw-v2.o
-endif
+obj-$(CONFIG_INFINIBAND_HNS_HIP08) += hns-roce-hw-v2.o
-- 
2.7.4



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

* Re: [PATCH] RDMA/hns: Fix build error
  2019-07-24  6:54 ` [PATCH] RDMA/hns: Fix build error YueHaibing
@ 2019-07-24 11:32   ` Jason Gunthorpe
  2019-07-24 11:47     ` Yuehaibing
  2019-07-29 16:05     ` Doug Ledford
  0 siblings, 2 replies; 14+ messages in thread
From: Jason Gunthorpe @ 2019-07-24 11:32 UTC (permalink / raw)
  To: YueHaibing
  Cc: oulijun, xavier.huwei, dledford, leon, linux-kernel, linux-rdma

On Wed, Jul 24, 2019 at 02:54:43PM +0800, YueHaibing wrote:
> If INFINIBAND_HNS_HIP08 is selected and HNS3 is m,
> but INFINIBAND_HNS is y, building fails:
> 
> drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_exit':
> hns_roce_hw_v2.c:(.exit.text+0xd): undefined reference to `hnae3_unregister_client'
> drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_init':
> hns_roce_hw_v2.c:(.init.text+0xd): undefined reference to `hnae3_register_client'
> 
> Also if INFINIBAND_HNS_HIP06 is selected and HNS_DSAF
> is m, but INFINIBAND_HNS is y, building fails:
> 
> drivers/infiniband/hw/hns/hns_roce_hw_v1.o: In function `hns_roce_v1_reset':
> hns_roce_hw_v1.c:(.text+0x39fa): undefined reference to `hns_dsaf_roce_reset'
> hns_roce_hw_v1.c:(.text+0x3a25): undefined reference to `hns_dsaf_roce_reset'
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: dd74282df573 ("RDMA/hns: Initialize the PCI device for hip08 RoCE")
> Fixes: 08805fdbeb2d ("RDMA/hns: Split hw v1 driver from hns roce driver")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>  drivers/infiniband/hw/hns/Kconfig  | 6 +++---
>  drivers/infiniband/hw/hns/Makefile | 8 ++------
>  2 files changed, 5 insertions(+), 9 deletions(-)

did you test this approach with CONFIG_MODULES=n?

Jason

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

* Re: [PATCH] RDMA/hns: Fix build error
  2019-07-24 11:32   ` Jason Gunthorpe
@ 2019-07-24 11:47     ` Yuehaibing
  2019-07-29 16:05     ` Doug Ledford
  1 sibling, 0 replies; 14+ messages in thread
From: Yuehaibing @ 2019-07-24 11:47 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: oulijun, xavier.huwei, dledford, leon, linux-kernel, linux-rdma


On 2019/7/24 19:32, Jason Gunthorpe wrote:
> On Wed, Jul 24, 2019 at 02:54:43PM +0800, YueHaibing wrote:
>> If INFINIBAND_HNS_HIP08 is selected and HNS3 is m,
>> but INFINIBAND_HNS is y, building fails:
>>
>> drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_exit':
>> hns_roce_hw_v2.c:(.exit.text+0xd): undefined reference to `hnae3_unregister_client'
>> drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function `hns_roce_hw_v2_init':
>> hns_roce_hw_v2.c:(.init.text+0xd): undefined reference to `hnae3_register_client'
>>
>> Also if INFINIBAND_HNS_HIP06 is selected and HNS_DSAF
>> is m, but INFINIBAND_HNS is y, building fails:
>>
>> drivers/infiniband/hw/hns/hns_roce_hw_v1.o: In function `hns_roce_v1_reset':
>> hns_roce_hw_v1.c:(.text+0x39fa): undefined reference to `hns_dsaf_roce_reset'
>> hns_roce_hw_v1.c:(.text+0x3a25): undefined reference to `hns_dsaf_roce_reset'
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Fixes: dd74282df573 ("RDMA/hns: Initialize the PCI device for hip08 RoCE")
>> Fixes: 08805fdbeb2d ("RDMA/hns: Split hw v1 driver from hns roce driver")
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>  drivers/infiniband/hw/hns/Kconfig  | 6 +++---
>>  drivers/infiniband/hw/hns/Makefile | 8 ++------
>>  2 files changed, 5 insertions(+), 9 deletions(-)
> 
> did you test this approach with CONFIG_MODULES=n?

Yes, I test it, it works now.

> 
> Jason
> 
> .
> 


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

* Re: [PATCH] RDMA/hns: Fix build error
  2019-07-24 11:32   ` Jason Gunthorpe
  2019-07-24 11:47     ` Yuehaibing
@ 2019-07-29 16:05     ` Doug Ledford
  1 sibling, 0 replies; 14+ messages in thread
From: Doug Ledford @ 2019-07-29 16:05 UTC (permalink / raw)
  To: Jason Gunthorpe, YueHaibing
  Cc: oulijun, xavier.huwei, leon, linux-kernel, linux-rdma

[-- Attachment #1: Type: text/plain, Size: 1709 bytes --]

On Wed, 2019-07-24 at 08:32 -0300, Jason Gunthorpe wrote:
> On Wed, Jul 24, 2019 at 02:54:43PM +0800, YueHaibing wrote:
> > If INFINIBAND_HNS_HIP08 is selected and HNS3 is m,
> > but INFINIBAND_HNS is y, building fails:
> > 
> > drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function
> > `hns_roce_hw_v2_exit':
> > hns_roce_hw_v2.c:(.exit.text+0xd): undefined reference to
> > `hnae3_unregister_client'
> > drivers/infiniband/hw/hns/hns_roce_hw_v2.o: In function
> > `hns_roce_hw_v2_init':
> > hns_roce_hw_v2.c:(.init.text+0xd): undefined reference to
> > `hnae3_register_client'
> > 
> > Also if INFINIBAND_HNS_HIP06 is selected and HNS_DSAF
> > is m, but INFINIBAND_HNS is y, building fails:
> > 
> > drivers/infiniband/hw/hns/hns_roce_hw_v1.o: In function
> > `hns_roce_v1_reset':
> > hns_roce_hw_v1.c:(.text+0x39fa): undefined reference to
> > `hns_dsaf_roce_reset'
> > hns_roce_hw_v1.c:(.text+0x3a25): undefined reference to
> > `hns_dsaf_roce_reset'
> > 
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Fixes: dd74282df573 ("RDMA/hns: Initialize the PCI device for hip08
> > RoCE")
> > Fixes: 08805fdbeb2d ("RDMA/hns: Split hw v1 driver from hns roce
> > driver")
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> >  drivers/infiniband/hw/hns/Kconfig  | 6 +++---
> >  drivers/infiniband/hw/hns/Makefile | 8 ++------
> >  2 files changed, 5 insertions(+), 9 deletions(-)
> 
> did you test this approach with CONFIG_MODULES=n?

This version of the patch looks like the right fix.

Applying to for-rc, thanks.

-- 
Doug Ledford <dledford@redhat.com>
    GPG KeyID: B826A3330E572FDD
    Fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2019-07-29 16:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23  2:49 [PATCH] RDMA/hns: Fix build error for hip08 YueHaibing
2019-07-23  7:43 ` Leon Romanovsky
2019-07-23 10:06   ` Yuehaibing
2019-07-23 10:17     ` Leon Romanovsky
2019-07-23 12:34   ` Jason Gunthorpe
2019-07-23 13:35     ` Leon Romanovsky
2019-07-23 13:37       ` Jason Gunthorpe
2019-07-24  3:10         ` Yuehaibing
2019-07-24  3:40 ` [PATCH v2] " YueHaibing
2019-07-24  6:12   ` Yuehaibing
2019-07-24  6:54 ` [PATCH] RDMA/hns: Fix build error YueHaibing
2019-07-24 11:32   ` Jason Gunthorpe
2019-07-24 11:47     ` Yuehaibing
2019-07-29 16:05     ` Doug Ledford

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).