Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3086312rwe; Mon, 29 Aug 2022 05:43:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR7arpca5Ewq5OUwMsPP7AOAHmejMnl7xfD3rZdrWV8uSKONCzc76mWwFuCOSewT8jzPDokz X-Received: by 2002:a17:90a:fb43:b0:1fd:95e6:9e57 with SMTP id iq3-20020a17090afb4300b001fd95e69e57mr10768233pjb.234.1661776998624; Mon, 29 Aug 2022 05:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661776998; cv=none; d=google.com; s=arc-20160816; b=ORh7DiYIFpD1UzYs9AUX9kIQfErc+tbY0chCSJpgv8P64MILQ3W5V89ZYAOj1GOx/O w9mMmCf8P2pR8V8BZFDbxYqiokdCx4VztXoAyqVSTtY+SojkAearMZIpaMzmsyAIEp4I +J8TM+vgR7kRijBMfGh8LTe5R0wzvgbm99TLLnzYz5Wr+Rt6qSUW3VcFHEjnKPWr8PAc sJpg1P4H4kR+SWyaARd2MACBjEGBIVWGAQLXULvD5FKAOce/Jyp82zEFiC94QSu5Q+ok iQrvBt/r5/WyM+KO6yKaJ7ZTpwxHYsM00lDWpb9SQwiuZ3QcnMnVZTJ/ZFTwsMwl9Txv L93A== 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=6X+A/CY6hCesiBm0B3HPbEZOmy/FGctIKVvXMEfqC44=; b=AY+PyR4AUfcNJccGkQ1Jwv838bNT7JG0ifiFhyitOvS3y64bDHOpLy0noz9EwesnRY BFyLOSnfaHVo5V8z4wlLGJnn/ELqqbFy5Q71f6HhrFStbpAgj46vMLkJcJz4Dbr0ufED 82dSiOULCjNzxSlAv1GUJuzPfNPQqGyehPvS8xOIzBajCQvR9Zshh8X15T7TXpDxAt/Q BeHLigE80630zVEU1+ggUQE46XVYnD2ZdgrfpL3flRULZ9fS2ICypikzpQi2nb952e1G 2CbVnAX6wKTMKvYOpdLHGRkw2XT8mwofKJHsUT9XwtuZUPsE5pcpzixKIWMh/0f2UPPy LhoA== 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 17-20020a630e51000000b0041ccd92214bsi9164569pgo.409.2022.08.29.05.43.07; Mon, 29 Aug 2022 05:43:18 -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 S229579AbiH2MZo (ORCPT + 99 others); Mon, 29 Aug 2022 08:25:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232013AbiH2MZZ (ORCPT ); Mon, 29 Aug 2022 08:25:25 -0400 Received: from mailout-taastrup.gigahost.dk (mailout-taastrup.gigahost.dk [46.183.139.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C1EB923F5; Mon, 29 Aug 2022 05:09:16 -0700 (PDT) Received: from mailout.gigahost.dk (mailout.gigahost.dk [89.186.169.112]) by mailout-taastrup.gigahost.dk (Postfix) with ESMTP id 5AC4E1884942; Mon, 29 Aug 2022 11:43:18 +0000 (UTC) Received: from smtp.gigahost.dk (smtp.gigahost.dk [89.186.169.109]) by mailout.gigahost.dk (Postfix) with ESMTP id 4B03125032B7; Mon, 29 Aug 2022 11:43:18 +0000 (UTC) Received: by smtp.gigahost.dk (Postfix, from userid 1000) id 42CC79EC0001; Mon, 29 Aug 2022 11:43:18 +0000 (UTC) X-Screener-Id: 413d8c6ce5bf6eab4824d0abaab02863e8e3f662 MIME-Version: 1.0 Date: Mon, 29 Aug 2022 13:43:18 +0200 From: netdev@kapio-technology.com To: Nikolay Aleksandrov Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Florian Fainelli , Andrew Lunn , Vivien Didelot , Vladimir Oltean , 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 , Shuah Khan , Christian Marangi , Daniel Borkmann , Yuwei Wang , Ido Schimmel , 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 v5 net-next 1/6] net: bridge: add locked entry fdb flag to extend locked port feature In-Reply-To: References: <20220826114538.705433-1-netdev@kapio-technology.com> <20220826114538.705433-2-netdev@kapio-technology.com> 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,T_SCC_BODY_TEXT_LINE 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-08-27 13:30, Nikolay Aleksandrov wrote: >> @@ -879,6 +888,10 @@ void br_fdb_update(struct net_bridge *br, struct >> net_bridge_port *source, >> &fdb->flags))) >> clear_bit(BR_FDB_ADDED_BY_EXT_LEARN, >> &fdb->flags); >> + if (source->flags & BR_PORT_MAB) >> + set_bit(BR_FDB_ENTRY_LOCKED, &fdb->flags); >> + else >> + clear_bit(BR_FDB_ENTRY_LOCKED, &fdb->flags); > Please add a test for that bit and only then change it. > Okay, I have revised this part now. I hope that it is suitable? @@ -749,6 +756,10 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, &fdb->flags))) clear_bit(BR_FDB_ADDED_BY_EXT_LEARN, &fdb->flags); + /* Allow roaming from an unauthorized port to an + * authorized port */ + if (unlikely(test_bit(BR_FDB_ENTRY_LOCKED, &fdb->flags))) + clear_bit(BR_FDB_ENTRY_LOCKED, &fdb->flags); } if (unlikely(test_bit(BR_FDB_ADDED_BY_USER, &flags)))