From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99587C4338F for ; Tue, 3 Aug 2021 11:19:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7246E61040 for ; Tue, 3 Aug 2021 11:19:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235495AbhHCLTO (ORCPT ); Tue, 3 Aug 2021 07:19:14 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:57594 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235467AbhHCLTN (ORCPT ); Tue, 3 Aug 2021 07:19:13 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 173BIjbx114050; Tue, 3 Aug 2021 06:18:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1627989525; bh=xOfUPHHqXVwjF79ATT4GN2kZvtYkfFv5v8eXZAY31GQ=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=fjNZeXY/VWBa/4VsSDhJfHzAdOXle125mDkxgMdz5rl9GAblcSpGkxEFR1PDgqlnU /M01c9+hiwiBTirfoZGVEOGuhz935RrM86Q5aDryphlVTyZB9kSlhteyd1eqhy8YrM sPbddqZjUFJTDXGwPIfd8NVlKgNQmhO5IxnZojsg= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 173BIjKe067253 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 3 Aug 2021 06:18:45 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 3 Aug 2021 06:18:45 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Tue, 3 Aug 2021 06:18:44 -0500 Received: from [10.250.100.73] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 173BIebq100518; Tue, 3 Aug 2021 06:18:40 -0500 Subject: Re: [PATCH net-next] net: build all switchdev drivers as modules when the bridge is a module To: Arnd Bergmann , Vladimir Oltean CC: Networking , Jakub Kicinski , "David S. Miller" , Naresh Kamboju , Lars Povlsen , Steen Hegelund , Microchip Linux Driver Support , Florian Fainelli , Andrew Lunn , Vivien Didelot , Ido Schimmel , Jiri Pirko , Roopa Prabhu , Nikolay Aleksandrov , Linux Kernel Functional Testing , Vignesh Raghavendra , Florian Fainelli , Andrew Lunn References: <20210726142536.1223744-1-vladimir.oltean@nxp.com> From: Grygorii Strashko Message-ID: Date: Tue, 3 Aug 2021 14:18:38 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi All, On 02/08/2021 17:47, Arnd Bergmann wrote: > On Mon, Jul 26, 2021 at 4:28 PM Vladimir Oltean 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 >> Signed-off-by: Vladimir Oltean > > 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