Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3069939rwi; Fri, 21 Oct 2022 11:06:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5URPFyLlkqkctSDmMJtbmp2Hc6wRlVrj+D+RBwRp/J0V0jqI9g3UPhGWRxVKVhbcJlzsG0 X-Received: by 2002:a17:907:2bd4:b0:78d:48c9:29b0 with SMTP id gv20-20020a1709072bd400b0078d48c929b0mr16072000ejc.562.1666375596145; Fri, 21 Oct 2022 11:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666375596; cv=none; d=google.com; s=arc-20160816; b=DDLlOj6yrIakGntgDQe1QUmQQyWdBOsQlD8TxvUAKzQml0OIWu4boTGPXQUrlz1YPh ILxDpjzmZ6isnD8CeVXFqicUn3BI/Q1Ip1Xpd7cJi8EMm1SoGSCqF9LAo+TamMq7PMvM fVxG+GrBoy0iGSmdzvbWqt2CHZjw+XJ/0SAXZiiGASniRs1kI09mt43jwdfCimpT2C3A vWEr6Z+Jy6BmhhNyQYA2d5zoY+buFwLESIzPk97xSDwwU4zh+k/BZ6VwJ1U8jW2Xoi8E DFvC5zk/T4qibo6RwxR8yHFrIkc3jNKIrn4zyRwmWtuV497XIkzugWylthC+v2aobapY MQuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version; bh=wX17tT+QrD7lFBeePCT0xLdrixl4HwabyZojnT4Rgns=; b=WepbbO/CEJIZckxfoGc7zkJLcmEzjKGq3Xoz2UghExTxVYD0ocdppPnwsxd73KtqZL 5ng8fNGau/ob31Tfve799t1iiIibMf8zzzbcAc23cQPH6mvkpPYN9XjOoGHYxgZJz7SH jh01MBjbudD57ZHK30+xONq+C3AG0DzMV7CbZZKRvx5G2cUfbwqT7Qd5S7V42J1cINNM Fx5u0mnBrJYhvnT+2f3wmPJ5dioIzZNrEwxv9C7VU4IGv5J8g3/nTKKoyL08uszGTD2/ sCeAyt1IK+fLQs6vLfwlcKRPy/oL6tV9u2L55037iO+0GXnrJwQIe/lK92cD8cQPnX/0 bQ8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr8-20020a170907720800b0077945c44b7fsi22140444ejc.856.2022.10.21.11.06.09; Fri, 21 Oct 2022 11:06:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230453AbiJURTS (ORCPT + 99 others); Fri, 21 Oct 2022 13:19:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230049AbiJURTF (ORCPT ); Fri, 21 Oct 2022 13:19:05 -0400 Received: from mailout-taastrup.gigahost.dk (mailout-taastrup.gigahost.dk [46.183.139.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B2811ABA01; Fri, 21 Oct 2022 10:19:02 -0700 (PDT) Received: from mailout.gigahost.dk (mailout.gigahost.dk [89.186.169.112]) by mailout-taastrup.gigahost.dk (Postfix) with ESMTP id BD5431884D31; Fri, 21 Oct 2022 17:18:59 +0000 (UTC) Received: from smtp.gigahost.dk (smtp.gigahost.dk [89.186.169.109]) by mailout.gigahost.dk (Postfix) with ESMTP id 7E0FF250007B; Fri, 21 Oct 2022 17:18:59 +0000 (UTC) Received: by smtp.gigahost.dk (Postfix, from userid 1000) id 7497A9EC0007; Fri, 21 Oct 2022 17:18:59 +0000 (UTC) X-Screener-Id: 413d8c6ce5bf6eab4824d0abaab02863e8e3f662 MIME-Version: 1.0 Date: Fri, 21 Oct 2022 19:18:59 +0200 From: netdev@kapio-technology.com To: Vladimir Oltean Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Florian Fainelli , Andrew Lunn , Vivien Didelot , Eric Dumazet , Paolo Abeni , Kurt Kanzenbach , Hauke Mehrtens , Woojung Huh , UNGLinuxDriver@microchip.com, Sean Wang , Landen Chao , DENG Qingfang , Matthias Brugger , Claudiu Manoil , Alexandre Belloni , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Shuah Khan , Russell King , Christian Marangi , Daniel Borkmann , Yuwei Wang , Petr Machata , Ido Schimmel , Florent Fourcot , Hans Schultz , Joachim Wiberg , Amit Cohen , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, bridge@lists.linux-foundation.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v8 net-next 10/12] net: dsa: mv88e6xxx: mac-auth/MAB implementation In-Reply-To: <20221021163005.xljk2j3fkikr6uge@skbuf> References: <20221018165619.134535-1-netdev@kapio-technology.com> <20221018165619.134535-1-netdev@kapio-technology.com> <20221018165619.134535-11-netdev@kapio-technology.com> <20221018165619.134535-11-netdev@kapio-technology.com> <20221020132538.reirrskemcjwih2m@skbuf> <2565c09bb95d69142522c3c3bcaa599e@kapio-technology.com> <20221020225719.l5iw6vndmm7gvjo3@skbuf> <82d23b100b8d2c9e4647b8a134d5cbbf@kapio-technology.com> <20221021112216.6bw6sjrieh2znlti@skbuf> <7bfaae46b1913fe81654a4cd257d98b1@kapio-technology.com> <20221021163005.xljk2j3fkikr6uge@skbuf> User-Agent: Gigahost Webmail Message-ID: X-Sender: netdev@kapio-technology.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-10-21 18:30, Vladimir Oltean wrote: > On Fri, Oct 21, 2022 at 03:16:21PM +0200, netdev@kapio-technology.com > wrote: >> As it is now in the bridge, the locked port part is handled before >> learning >> in the ingress data path, so with BR_LEARNING and BR_PORT_LOCKED, I >> think it >> will work as it does now except link local packages. > > If link-local learning is enabled on a locked port, I think those > addresses should also be learned with the BR_FDB_LOCKED flag. The > creation of those locked FDB entries can be further suppressed by the > BROPT_NO_LL_LEARN flag. > >> If your suggestion of BR_LEARNING causing BR_FDB_LOCKED on a locked >> port, I >> guess it would be implemented under br_fdb_update() and BR_LEARNING + >> BR_PORT_LOCKED would go together, forcing BR_LEARNING in this case, >> thus also >> for all drivers? > > Yes, basically where this is placed right now (in > br_handle_frame_finish): > > if (p->flags & BR_PORT_LOCKED) { > struct net_bridge_fdb_entry *fdb_src = > br_fdb_find_rcu(br, eth_hdr(skb)->h_source, vid); > > if (!fdb_src) { > unsigned long flags = 0; > > if (p->flags & BR_PORT_MAB) { > ~~~~~~~~~~~~~~~~~~~~~~~~ > except check for BR_LEARNING > > __set_bit(BR_FDB_LOCKED, &flags); > br_fdb_update(br, p, eth_hdr(skb)->h_source, > vid, flags); > } > goto drop; > } else if (READ_ONCE(fdb_src->dst) != p || > test_bit(BR_FDB_LOCAL, &fdb_src->flags) || > test_bit(BR_FDB_LOCKED, &fdb_src->flags)) { > goto drop; > } > } As I don't know what implications it would have for other drivers to have learning forced enabled on locked ports, I cannot say if it is a good idea or not. Right now learning is not forced either way as is, but the consensus is that learning should be off with locked ports, which it would be either way in the common case I think.