2014-12-04 16:34:58

by Jim Davis

[permalink] [raw]
Subject: randconfig build error with next-20141204, in drivers/net/ethernet/rocker/rocker.c

Building with the attached random configuration file,

drivers/built-in.o: In function `rocker_port_fdb_learn_work':
/home/jim/linux/drivers/net/ethernet/rocker/rocker.c:3014: undefined
reference to `br_fdb_external_learn_del'
/home/jim/linux/drivers/net/ethernet/rocker/rocker.c:3016: undefined
reference to `br_fdb_external_learn_add'


Attachments:
randconfig-1417689029.txt (114.27 kB)

2014-12-04 17:43:26

by Andreas Ruprecht

[permalink] [raw]
Subject: [PATCH] net: ethernet: rocker: Add select to CONFIG_BRIDGE in Kconfig

On 04.12.2014 17:34, Jim Davis wrote:
> Building with the attached random configuration file,
>
> drivers/built-in.o: In function `rocker_port_fdb_learn_work':
> /home/jim/linux/drivers/net/ethernet/rocker/rocker.c:3014: undefined
> reference to `br_fdb_external_learn_del'
> /home/jim/linux/drivers/net/ethernet/rocker/rocker.c:3016: undefined
> reference to `br_fdb_external_learn_add'
>

Hi,

the problem here is that CONFIG_BRIDGE is set to 'm' (leading to
inclusion of the two functions above in the kernel module) while
CONFIG_ROCKER is set to 'y', requiring the functions at link time.

Is the attached patch sufficient to fix this?

Regards,

Andreas


Attachments:
0001-net-ethernet-rocker-Add-select-to-CONFIG_BRIDGE-in-K.patch (1.30 kB)

2014-12-04 18:15:53

by Jiri Pirko

[permalink] [raw]
Subject: Re: [PATCH] net: ethernet: rocker: Add select to CONFIG_BRIDGE in Kconfig

Thu, Dec 04, 2014 at 06:36:37PM CET, [email protected] wrote:
>On 04.12.2014 17:34, Jim Davis wrote:
>> Building with the attached random configuration file,
>>
>> drivers/built-in.o: In function `rocker_port_fdb_learn_work':
>> /home/jim/linux/drivers/net/ethernet/rocker/rocker.c:3014: undefined
>> reference to `br_fdb_external_learn_del'
>> /home/jim/linux/drivers/net/ethernet/rocker/rocker.c:3016: undefined
>> reference to `br_fdb_external_learn_add'
>>
>
>Hi,
>
>the problem here is that CONFIG_BRIDGE is set to 'm' (leading to
>inclusion of the two functions above in the kernel module) while
>CONFIG_ROCKER is set to 'y', requiring the functions at link time.
>
>Is the attached patch sufficient to fix this?
>
>Regards,
>
>Andreas

>From 0529c3cbe381338dc3337e07a71e15b3d22a3255 Mon Sep 17 00:00:00 2001
>From: Andreas Ruprecht <[email protected]>
>Date: Thu, 4 Dec 2014 18:28:09 +0100
>Subject: [PATCH] net: ethernet: rocker: Add select to CONFIG_BRIDGE in Kconfig
>
>In a configuration with CONFIG_BRIDGE set to 'm' and CONFIG_ROCKER
>set to 'y', undefined references occur at link time:
>
>> drivers/built-in.o: In function `rocker_port_fdb_learn_work':
>> /home/jim/linux/drivers/net/ethernet/rocker/rocker.c:3014: undefined
>> reference to `br_fdb_external_learn_del'
>> /home/jim/linux/drivers/net/ethernet/rocker/rocker.c:3016: undefined
>> reference to `br_fdb_external_learn_add'
>
>This patch fixes these by selecting CONFIG_BRIDGE from CONFIG_ROCKER.
>
>Reported-by: Jim Davis <[email protected]>
>Signed-off-by: Andreas Ruprecht <[email protected]>
Acked-by: Jiri Pirko <[email protected]>

this is ok for now. There is a plan to replace
br_fdb_external_learn_add/del a by notifier which will fix this as well.

Thanks.

>---
> drivers/net/ethernet/rocker/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/drivers/net/ethernet/rocker/Kconfig b/drivers/net/ethernet/rocker/Kconfig
>index 11a850eab628..ade10ec4c78d 100644
>--- a/drivers/net/ethernet/rocker/Kconfig
>+++ b/drivers/net/ethernet/rocker/Kconfig
>@@ -18,6 +18,7 @@ if NET_VENDOR_ROCKER
> config ROCKER
> tristate "Rocker switch driver (EXPERIMENTAL)"
> depends on PCI && NET_SWITCHDEV
>+ select BRIDGE
> ---help---
> This driver supports Rocker switch device.
>
>--
>1.9.1
>

2014-12-05 04:19:43

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] net: ethernet: rocker: Add select to CONFIG_BRIDGE in Kconfig

From: Andreas Ruprecht <[email protected]>
Date: Thu, 04 Dec 2014 18:36:37 +0100

> On 04.12.2014 17:34, Jim Davis wrote:
>> Building with the attached random configuration file,
>>
>> drivers/built-in.o: In function `rocker_port_fdb_learn_work':
>> /home/jim/linux/drivers/net/ethernet/rocker/rocker.c:3014: undefined
>> reference to `br_fdb_external_learn_del'
>> /home/jim/linux/drivers/net/ethernet/rocker/rocker.c:3016: undefined
>> reference to `br_fdb_external_learn_add'
>>
>
> Hi,
>
> the problem here is that CONFIG_BRIDGE is set to 'm' (leading to
> inclusion of the two functions above in the kernel module) while
> CONFIG_ROCKER is set to 'y', requiring the functions at link time.
>
> Is the attached patch sufficient to fix this?

Do not use select, please.

You can only use select on leaf node Kconfig symbols, ie. those
which do not have any dependencies whatsoever.

Select does not recursively walk down the dependency chain turning
things on for you when you say "select X".

2014-12-05 08:28:13

by Andreas Ruprecht

[permalink] [raw]
Subject: Re: [PATCH] net: ethernet: rocker: Add select to CONFIG_BRIDGE in Kconfig


> On 05.12.2014 05:24, David Miller wrote:
> Do not use select, please.
>
> You can only use select on leaf node Kconfig symbols, ie. those
> which do not have any dependencies whatsoever.
>
> Select does not recursively walk down the dependency chain turning
> things on for you when you say "select X".
>

Okay, sure, my bad for not looking that up properly.

If we change this into a "depends on", this should not be a problem,
right? If CONFIG_BRIDGE is selected as 'm', then CONFIG_ROCKER can only
be 'n' or 'm', if CONFIG_BRIDGE is set to 'y', it can be 'n', 'm' or 'y'.

This also means that the prompt associated with CONFIG_ROCKER will only
show up in menuconfig when CONFIG_BRIDGE has been enabled (either 'm' or
'y').

I've attached an updated patch.


Attachments:
0001-net-ethernet-rocker-Add-dependency-to-CONFIG_BRIDGE-.patch (1.37 kB)

2014-12-05 08:32:58

by Jiri Pirko

[permalink] [raw]
Subject: Re: [PATCH] net: ethernet: rocker: Add select to CONFIG_BRIDGE in Kconfig

Fri, Dec 05, 2014 at 09:28:03AM CET, [email protected] wrote:
>
>> On 05.12.2014 05:24, David Miller wrote:
>> Do not use select, please.
>>
>> You can only use select on leaf node Kconfig symbols, ie. those
>> which do not have any dependencies whatsoever.
>>
>> Select does not recursively walk down the dependency chain turning
>> things on for you when you say "select X".
>>
>
>Okay, sure, my bad for not looking that up properly.
>
>If we change this into a "depends on", this should not be a problem,
>right? If CONFIG_BRIDGE is selected as 'm', then CONFIG_ROCKER can only
>be 'n' or 'm', if CONFIG_BRIDGE is set to 'y', it can be 'n', 'm' or 'y'.
>
>This also means that the prompt associated with CONFIG_ROCKER will only
>show up in menuconfig when CONFIG_BRIDGE has been enabled (either 'm' or
>'y').
>
>I've attached an updated patch.

>From 931a36cc5ec67ec23ba2373d42840d968ed78120 Mon Sep 17 00:00:00 2001
>From: Andreas Ruprecht <[email protected]>
>Date: Thu, 4 Dec 2014 18:28:09 +0100
>Subject: [PATCH] net: ethernet: rocker: Add dependency to CONFIG_BRIDGE in
> Kconfig
>
>In a configuration with CONFIG_BRIDGE set to 'm' and CONFIG_ROCKER
>set to 'y', undefined references occur at link time:
>
>> drivers/built-in.o: In function `rocker_port_fdb_learn_work':
>> /home/jim/linux/drivers/net/ethernet/rocker/rocker.c:3014: undefined
>> reference to `br_fdb_external_learn_del'
>> /home/jim/linux/drivers/net/ethernet/rocker/rocker.c:3016: undefined
>> reference to `br_fdb_external_learn_add'
>
>This patch fixes these by declaring CONFIG_ROCKER as being dependent
>on CONFIG_BRIDGE.
>
>Reported-by: Jim Davis <[email protected]>
>Signed-off-by: Andreas Ruprecht <[email protected]>

Acked-by: Jiri Pirko <[email protected]>


>---
> drivers/net/ethernet/rocker/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/net/ethernet/rocker/Kconfig b/drivers/net/ethernet/rocker/Kconfig
>index 11a850eab628..b9952ef040e4 100644
>--- a/drivers/net/ethernet/rocker/Kconfig
>+++ b/drivers/net/ethernet/rocker/Kconfig
>@@ -17,7 +17,7 @@ if NET_VENDOR_ROCKER
>
> config ROCKER
> tristate "Rocker switch driver (EXPERIMENTAL)"
>- depends on PCI && NET_SWITCHDEV
>+ depends on PCI && NET_SWITCHDEV && BRIDGE
> ---help---
> This driver supports Rocker switch device.
>
>--
>1.9.1
>