2019-08-27 03:11:13

by Mao Wenan

[permalink] [raw]
Subject: [PATCH -next] net: mlx5: Kconfig: Fix MLX5_CORE_EN dependencies

When MLX5_CORE_EN=y and PCI_HYPERV_INTERFACE is not set, below errors are found:
drivers/net/ethernet/mellanox/mlx5/core/en_main.o: In function `mlx5e_nic_enable':
en_main.c:(.text+0xb649): undefined reference to `mlx5e_hv_vhca_stats_create'
drivers/net/ethernet/mellanox/mlx5/core/en_main.o: In function `mlx5e_nic_disable':
en_main.c:(.text+0xb8c4): undefined reference to `mlx5e_hv_vhca_stats_destroy'

This because CONFIG_PCI_HYPERV_INTERFACE is newly introduced by 'commit 348dd93e40c1
("PCI: hv: Add a Hyper-V PCI interface driver for software backchannel interface"),
Fix this by making MLX5_CORE_EN imply PCI_HYPERV_INTERFACE.

Fixes: cef35af34d6d ("net/mlx5e: Add mlx5e HV VHCA stats agent")
Signed-off-by: Mao Wenan <[email protected]>
---
drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
index 37fef8c..a6a70ce 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
@@ -35,6 +35,7 @@ config MLX5_CORE_EN
depends on IPV6=y || IPV6=n || MLX5_CORE=m
select PAGE_POOL
select DIMLIB
+ imply PCI_HYPERV_INTERFACE
default n
---help---
Ethernet support in Mellanox Technologies ConnectX-4 NIC.
--
2.7.4


2019-08-27 07:27:25

by walter harms

[permalink] [raw]
Subject: Re: [PATCH -next] net: mlx5: Kconfig: Fix MLX5_CORE_EN dependencies



Am 27.08.2019 05:12, schrieb Mao Wenan:
> When MLX5_CORE_EN=y and PCI_HYPERV_INTERFACE is not set, below errors are found:
> drivers/net/ethernet/mellanox/mlx5/core/en_main.o: In function `mlx5e_nic_enable':
> en_main.c:(.text+0xb649): undefined reference to `mlx5e_hv_vhca_stats_create'
> drivers/net/ethernet/mellanox/mlx5/core/en_main.o: In function `mlx5e_nic_disable':
> en_main.c:(.text+0xb8c4): undefined reference to `mlx5e_hv_vhca_stats_destroy'
>
> This because CONFIG_PCI_HYPERV_INTERFACE is newly introduced by 'commit 348dd93e40c1
> ("PCI: hv: Add a Hyper-V PCI interface driver for software backchannel interface"),
> Fix this by making MLX5_CORE_EN imply PCI_HYPERV_INTERFACE.
>
> Fixes: cef35af34d6d ("net/mlx5e: Add mlx5e HV VHCA stats agent")
> Signed-off-by: Mao Wenan <[email protected]>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
> index 37fef8c..a6a70ce 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
> @@ -35,6 +35,7 @@ config MLX5_CORE_EN
> depends on IPV6=y || IPV6=n || MLX5_CORE=m

OT but ...
is that IPV6 needed at all ? can there be something else that yes or no ?

re,
wh

> select PAGE_POOL
> select DIMLIB
> + imply PCI_HYPERV_INTERFACE
> default n
> ---help---
> Ethernet support in Mellanox Technologies ConnectX-4 NIC.

2019-08-27 09:52:44

by Mao Wenan

[permalink] [raw]
Subject: Re: [PATCH -next] net: mlx5: Kconfig: Fix MLX5_CORE_EN dependencies



On 2019/8/27 15:24, walter harms wrote:
>
>
> Am 27.08.2019 05:12, schrieb Mao Wenan:
>> When MLX5_CORE_EN=y and PCI_HYPERV_INTERFACE is not set, below errors are found:
>> drivers/net/ethernet/mellanox/mlx5/core/en_main.o: In function `mlx5e_nic_enable':
>> en_main.c:(.text+0xb649): undefined reference to `mlx5e_hv_vhca_stats_create'
>> drivers/net/ethernet/mellanox/mlx5/core/en_main.o: In function `mlx5e_nic_disable':
>> en_main.c:(.text+0xb8c4): undefined reference to `mlx5e_hv_vhca_stats_destroy'
>>
>> This because CONFIG_PCI_HYPERV_INTERFACE is newly introduced by 'commit 348dd93e40c1
>> ("PCI: hv: Add a Hyper-V PCI interface driver for software backchannel interface"),
>> Fix this by making MLX5_CORE_EN imply PCI_HYPERV_INTERFACE.
>>
>> Fixes: cef35af34d6d ("net/mlx5e: Add mlx5e HV VHCA stats agent")
>> Signed-off-by: Mao Wenan <[email protected]>
>> ---
>> drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
>> index 37fef8c..a6a70ce 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
>> @@ -35,6 +35,7 @@ config MLX5_CORE_EN
>> depends on IPV6=y || IPV6=n || MLX5_CORE=m
>
> OT but ...
> is that IPV6 needed at all ? can there be something else that yes or no ?

If I set IPV6=m, errors are found as below:
drivers/net/ethernet/mellanox/mlx5/core/main.o: In function `mlx5_unload':
main.c:(.text+0x275): undefined reference to `mlx5_hv_vhca_cleanup'
drivers/net/ethernet/mellanox/mlx5/core/main.o: In function `mlx5_cleanup_once':
main.c:(.text+0x2e8): undefined reference to `mlx5_hv_vhca_destroy'
drivers/net/ethernet/mellanox/mlx5/core/main.o: In function `mlx5_load_one':
main.c:(.text+0x23c1): undefined reference to `mlx5_hv_vhca_create'
main.c:(.text+0x248f): undefined reference to `mlx5_hv_vhca_init'
main.c:(.text+0x25e0): undefined reference to `mlx5_hv_vhca_cleanup
>
> re,
> wh
>
>> select PAGE_POOL
>> select DIMLIB
>> + imply PCI_HYPERV_INTERFACE
>> default n
>> ---help---
>> Ethernet support in Mellanox Technologies ConnectX-4 NIC.
>
> .
>

2019-08-27 20:15:59

by Saeed Mahameed

[permalink] [raw]
Subject: Re: [PATCH -next] net: mlx5: Kconfig: Fix MLX5_CORE_EN dependencies

On Tue, 2019-08-27 at 11:12 +0800, Mao Wenan wrote:
> When MLX5_CORE_EN=y and PCI_HYPERV_INTERFACE is not set, below errors
> are found:
> drivers/net/ethernet/mellanox/mlx5/core/en_main.o: In function
> `mlx5e_nic_enable':
> en_main.c:(.text+0xb649): undefined reference to
> `mlx5e_hv_vhca_stats_create'
> drivers/net/ethernet/mellanox/mlx5/core/en_main.o: In function
> `mlx5e_nic_disable':
> en_main.c:(.text+0xb8c4): undefined reference to
> `mlx5e_hv_vhca_stats_destroy'
>
> This because CONFIG_PCI_HYPERV_INTERFACE is newly introduced by
> 'commit 348dd93e40c1
> ("PCI: hv: Add a Hyper-V PCI interface driver for software
> backchannel interface"),
> Fix this by making MLX5_CORE_EN imply PCI_HYPERV_INTERFACE.
>

let's not imply anything..
mlx5e_hv_vhca_* should already have stubs in
mlx5/core/en/hv_vhca_stat.h when PCI_HYPERV_INTERFACE is off/undef !

I Just tried:

$ ./scripts/config -s PCI_HYPERV_INTERFACE
$ ./scripts/config -s MLX5_CORE
$ ./scripts/config -s MLX5_CORE_EN
undef
y
y

$ make

And build passed just fine.


2019-08-27 21:18:29

by Saeed Mahameed

[permalink] [raw]
Subject: Re: [PATCH -next] net: mlx5: Kconfig: Fix MLX5_CORE_EN dependencies

On Tue, 2019-08-27 at 17:51 +0800, maowenan wrote:
>
> On 2019/8/27 15:24, walter harms wrote:
> >
> > Am 27.08.2019 05:12, schrieb Mao Wenan:
> > > When MLX5_CORE_EN=y and PCI_HYPERV_INTERFACE is not set, below
> > > errors are found:
> > > drivers/net/ethernet/mellanox/mlx5/core/en_main.o: In function
> > > `mlx5e_nic_enable':
> > > en_main.c:(.text+0xb649): undefined reference to
> > > `mlx5e_hv_vhca_stats_create'
> > > drivers/net/ethernet/mellanox/mlx5/core/en_main.o: In function
> > > `mlx5e_nic_disable':
> > > en_main.c:(.text+0xb8c4): undefined reference to
> > > `mlx5e_hv_vhca_stats_destroy'
> > >
> > > This because CONFIG_PCI_HYPERV_INTERFACE is newly introduced by
> > > 'commit 348dd93e40c1
> > > ("PCI: hv: Add a Hyper-V PCI interface driver for software
> > > backchannel interface"),
> > > Fix this by making MLX5_CORE_EN imply PCI_HYPERV_INTERFACE.
> > >
> > > Fixes: cef35af34d6d ("net/mlx5e: Add mlx5e HV VHCA stats agent")
> > > Signed-off-by: Mao Wenan <[email protected]>
> > > ---
> > > drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
> > > b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
> > > index 37fef8c..a6a70ce 100644
> > > --- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
> > > +++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
> > > @@ -35,6 +35,7 @@ config MLX5_CORE_EN
> > > depends on IPV6=y || IPV6=n || MLX5_CORE=m
> >
> > OT but ...
> > is that IPV6 needed at all ? can there be something else that yes
> > or no ?

only needed for en_rep.c/en_tc.c which are only compiled when
MLX5_ESWITCH is selected, so actually such condition should be for
MLX5_ESWITCH and not MLX5_CORE_EN

tested with:
MLX5_CORE=y
MLX5_CORE_EN=y
IPV6=m

and removed the dependency.
so if ipv6 is a module but mlx5 is builtin this will happen..

ld: drivers/net/ethernet/mellanox/mlx5/core/en_rep.o: in function
`mlx5e_rep_neigh_update_init_interval':
/home/saeedm/devel/linux/drivers/net/ethernet/mellanox/mlx5/core/en_rep
.c:505: undefined reference to `nd_tbl'
ld: drivers/net/ethernet/mellanox/mlx5/core/en_rep.o: in function
`mlx5e_rep_netevent_event':
/home/saeedm/devel/linux/drivers/net/ethernet/mellanox/mlx5/core/en_rep
.c:946: undefined reference to `nd_tbl'
ld:
/home/saeedm/devel/linux/drivers/net/ethernet/mellanox/mlx5/core/en_rep
.c:919: undefined reference to `nd_tbl'
ld: drivers/net/ethernet/mellanox/mlx5/core/en_tc.o: in function
`mlx5e_tc_update_neigh_used_value':
/home/saeedm/devel/linux/drivers/net/ethernet/mellanox/mlx5/core/en_tc.
c:1497: undefined reference to `nd_tbl'

the problem is that mlx5_core can't be builtin if ipv6 is a module due
to this nd_tbl dependency

I think this is solvable by using ipv6_stub->nd_tbl, instead of
referencing md_tbl directly from mlx5.

>
> If I set IPV6=m, errors are found as below:
> drivers/net/ethernet/mellanox/mlx5/core/main.o: In function
> `mlx5_unload':
> main.c:(.text+0x275): undefined reference to `mlx5_hv_vhca_cleanup'
> drivers/net/ethernet/mellanox/mlx5/core/main.o: In function
> `mlx5_cleanup_once':
> main.c:(.text+0x2e8): undefined reference to `mlx5_hv_vhca_destroy'
> drivers/net/ethernet/mellanox/mlx5/core/main.o: In function
> `mlx5_load_one':
> main.c:(.text+0x23c1): undefined reference to `mlx5_hv_vhca_create'
> main.c:(.text+0x248f): undefined reference to `mlx5_hv_vhca_init'
> main.c:(.text+0x25e0): undefined reference to `mlx5_hv_vhca_cleanup

this is not related, i think there is something wrong with your local
repository.

2019-08-30 21:46:00

by Saeed Mahameed

[permalink] [raw]
Subject: Re: [PATCH -next] net: mlx5: Kconfig: Fix MLX5_CORE_EN dependencies

On Tue, 2019-08-27 at 11:12 +0800, Mao Wenan wrote:
> When MLX5_CORE_EN=y and PCI_HYPERV_INTERFACE is not set, below errors

The issue happens when PCI_HYPERV_INTERFACE is a module and mlx5_core
is built-in.

> are found:
> drivers/net/ethernet/mellanox/mlx5/core/en_main.o: In function
> `mlx5e_nic_enable':
> en_main.c:(.text+0xb649): undefined reference to
> `mlx5e_hv_vhca_stats_create'
> drivers/net/ethernet/mellanox/mlx5/core/en_main.o: In function
> `mlx5e_nic_disable':
> en_main.c:(.text+0xb8c4): undefined reference to
> `mlx5e_hv_vhca_stats_destroy'
>
> This because CONFIG_PCI_HYPERV_INTERFACE is newly introduced by
> 'commit 348dd93e40c1
> ("PCI: hv: Add a Hyper-V PCI interface driver for software
> backchannel interface"),
> Fix this by making MLX5_CORE_EN imply PCI_HYPERV_INTERFACE.
>

the imply should be in MLX5_CORE not MLX5_CORE_EN since the
implementation also involves MLX5_CORE.

I will prepare a patch with these fixups.

Thanks,
Saeed.