lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 3 Aug 2021 14:18:38 +0300
From:   Grygorii Strashko <grygorii.strashko@...com>
To:     Arnd Bergmann <arnd@...nel.org>,
        Vladimir Oltean <vladimir.oltean@....com>
CC:     Networking <netdev@...r.kernel.org>,
        Jakub Kicinski <kuba@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Naresh Kamboju <naresh.kamboju@...aro.org>,
        Lars Povlsen <lars.povlsen@...rochip.com>,
        Steen Hegelund <Steen.Hegelund@...rochip.com>,
        Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Ido Schimmel <idosch@...dia.com>, Jiri Pirko <jiri@...dia.com>,
        Roopa Prabhu <roopa@...dia.com>,
        Nikolay Aleksandrov <nikolay@...dia.com>,
        Linux Kernel Functional Testing <lkft@...aro.org>,
        Vignesh Raghavendra <vigneshr@...com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH net-next] net: build all switchdev drivers as modules when
 the bridge is a module

Hi All,

On 02/08/2021 17:47, Arnd Bergmann wrote:
> On Mon, Jul 26, 2021 at 4:28 PM Vladimir Oltean <vladimir.oltean@....com> wrote:
>>
>> Currently, all drivers depend on the bool CONFIG_NET_SWITCHDEV, but only
>> the drivers that call some sort of function exported by the bridge, like
>> br_vlan_enabled() or whatever, have an extra dependency on CONFIG_BRIDGE.
>>
>> Since the blamed commit, all switchdev drivers have a functional
>> dependency upon switchdev_bridge_port_{,un}offload(), which is a pair of
>> functions exported by the bridge module and not by the bridge-independent
>> part of CONFIG_NET_SWITCHDEV.
>>
>> Problems appear when we have:
>>
>> CONFIG_BRIDGE=m
>> CONFIG_NET_SWITCHDEV=y
>> CONFIG_TI_CPSW_SWITCHDEV=y
>>
>> because cpsw, am65_cpsw and sparx5 will then be built-in but they will
>> call a symbol exported by a loadable module. This is not possible and
>> will result in the following build error:
>>
>> drivers/net/ethernet/ti/cpsw_new.o: in function `cpsw_netdevice_event':
>> drivers/net/ethernet/ti/cpsw_new.c:1520: undefined reference to
>>                                          `switchdev_bridge_port_offload'
>> drivers/net/ethernet/ti/cpsw_new.c:1537: undefined reference to
>>                                          `switchdev_bridge_port_unoffload'
>>
>> As mentioned, the other switchdev drivers don't suffer from this because
>> switchdev_bridge_port_offload() is not the first symbol exported by the
>> bridge that they are calling, so they already needed to deal with this
>> in the same way.
>>
>> Fixes: 2f5dc00f7a3e ("net: bridge: switchdev: let drivers inform which bridge ports are offloaded")
>> Reported-by: Linux Kernel Functional Testing <lkft@...aro.org>
>> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
> 
> I'm still seeing build failures after this patch was applied. I have a fixup
> patch that seems to work, but I'm still not sure if that version is complete.

In my opinion, the problem is a bit bigger here than just fixing the build :(

In case, of ^cpsw the switchdev mode is kinda optional and in many cases
(especially for testing purposes, NFS) the multi-mac mode is still preferable mode.

There were no such tight dependency between switchdev drivers and bridge core before and switchdev serviced as
independent, notification based layer between them, so ^cpsw still can be "Y" and bridge can be "M".
Now for mostly every kernel build configuration the CONFIG_BRIDGE will need to be set as "Y", or we will have
to update drivers to support build with BRIDGE=n and maintain separate builds for networking vs non-networking testing.
But is this enough? Wouldn't it cause 'chain reaction' required to add more and more "Y" options (like CONFIG_VLAN_8021Q)?

PS. Just to be sure we on the same page - ARM builds will be forced (with this patch) to have CONFIG_TI_CPSW_SWITCHDEV=m
and so all our automation testing will just fail with omap2plus_defconfig.
-- 
Best regards,
grygorii

Powered by blists - more mailing lists