Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5411653rwb; Tue, 17 Jan 2023 13:27:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXv8pUrhEcriYyF1j4IBOIdsj1dG88b7Cq2ous9AB3mdbQGi9Q9IjncveiMesjgyebsFvDMj X-Received: by 2002:a17:907:ca85:b0:86f:ae1f:9234 with SMTP id ul5-20020a170907ca8500b0086fae1f9234mr4800243ejc.7.1673990868026; Tue, 17 Jan 2023 13:27:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673990868; cv=none; d=google.com; s=arc-20160816; b=fGlCCCuLodOyB/sL1BN4g7ttdq83Bd2Bl456ypnypJ2RHbhhIyizhjsfcrgerLcQiz o+VEoSzbaNjfIdUP36YD4SIHKp9LGure91RCOAzLBkwElTe7WJiOdP+5Zf60dU2tIswY NjkXbN5VnC2S+CpP7BdUP1acGZ4h3H8OKDgIWYMl5aTVs7UOPhajFT5lKMu516Xq4V/X rkdNQMVWJ6euV0UeoWsZYs+umNjNG2I2N6L5s2wifO21NI7iDk371bI/72toEpbgJCLH 0LL18k1x/toICTuWy7gIG0HN/byvsi1ZAahzMsJJFlK00FL0S8O+zoYoK69tKboohG5J QgJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=kr7hOd6c8hT924R9Kmj87tFZQb5RQTTidtVqB6Z9AKQ=; b=Xz7FhDFPKbT/Uo/t4BM6HVqyGYLRNvtyvUrojxC/ps/htl38CcDUh87peMyL9yoe1p 8W5wu7Xr0mkwgYKMhjZpCNC2qrcpbRrnZtGLRu7gGrcDLJRifTBkhh09owkmIZtCfYG6 tI2bdXIwGbrs+liKd0dsDXOt58KmfACuL1vIGTwOwgk89A2k9xhwe9mMV6pFBxs+PmUC i96g4d4VT+HzO4atV5H8zGQFht3J0FI4alZ6b538wQ+xZeXR4hPr6zdrgC1aqYyAlwWo NZXjI1zWQriOKOsQG6UUXcc0gMYwLQCmZq5tu0U8Dp18EWmZBpjhMiRW2Dv1dx6KaF1B qJeQ== 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 xh9-20020a170906da8900b0084d3036d59bsi33134526ejb.152.2023.01.17.13.27.35; Tue, 17 Jan 2023 13:27:48 -0800 (PST) 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 S229517AbjAQU4K (ORCPT + 49 others); Tue, 17 Jan 2023 15:56:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231338AbjAQUxY (ORCPT ); Tue, 17 Jan 2023 15:53:24 -0500 Received: from mailout-taastrup.gigahost.dk (mailout-taastrup.gigahost.dk [46.183.139.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1FC1683F5; Tue, 17 Jan 2023 11:25:42 -0800 (PST) Received: from mailout.gigahost.dk (mailout.gigahost.dk [89.186.169.112]) by mailout-taastrup.gigahost.dk (Postfix) with ESMTP id F2A8418836BA; Tue, 17 Jan 2023 18:59:14 +0000 (UTC) Received: from smtp.gigahost.dk (smtp.gigahost.dk [89.186.169.109]) by mailout.gigahost.dk (Postfix) with ESMTP id E0A58250007B; Tue, 17 Jan 2023 18:59:14 +0000 (UTC) Received: by smtp.gigahost.dk (Postfix, from userid 1000) id D3B309EC000B; Tue, 17 Jan 2023 18:59:14 +0000 (UTC) X-Screener-Id: 413d8c6ce5bf6eab4824d0abaab02863e8e3f662 Received: from fujitsu.vestervang (2-104-116-184-cable.dk.customer.tdc.net [2.104.116.184]) by smtp.gigahost.dk (Postfix) with ESMTPSA id 325C791201E3; Tue, 17 Jan 2023 18:59:14 +0000 (UTC) From: "Hans J. Schultz" To: davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, "Hans J. Schultz" , Florian Fainelli , Andrew Lunn , Vladimir Oltean , Eric Dumazet , Paolo Abeni , Kurt Kanzenbach , Hauke Mehrtens , Woojung Huh , UNGLinuxDriver@microchip.com (maintainer:MICROCHIP KSZ SERIES ETHERNET SWITCH DRIVER), Sean Wang , Landen Chao , DENG Qingfang , Matthias Brugger , Claudiu Manoil , Alexandre Belloni , =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Russell King , Christian Marangi , linux-kernel@vger.kernel.org (open list), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-renesas-soc@vger.kernel.org (open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER), bridge@lists.linux-foundation.org (moderated list:ETHERNET BRIDGE) Subject: [RFC PATCH net-next 4/5] net: bridge: ensure FDB offloaded flag is handled as needed Date: Tue, 17 Jan 2023 19:57:13 +0100 Message-Id: <20230117185714.3058453-5-netdev@kapio-technology.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230117185714.3058453-1-netdev@kapio-technology.com> References: <20230117185714.3058453-1-netdev@kapio-technology.com> MIME-Version: 1.0 Organization: Westermo Network Technologies AB Content-Transfer-Encoding: 8bit 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 Since user added entries in the bridge FDB will get the BR_FDB_OFFLOADED flag set, we do not want the bridge to age those entries and we want the entries to be deleted in the bridge upon an SWITCHDEV_FDB_DEL_TO_BRIDGE event. Signed-off-by: Hans J. Schultz --- net/bridge/br_fdb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index e69a872bfc1d..b0c23a72bc76 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c @@ -537,6 +537,7 @@ void br_fdb_cleanup(struct work_struct *work) unsigned long this_timer = f->updated + delay; if (test_bit(BR_FDB_STATIC, &f->flags) || + test_bit(BR_FDB_OFFLOADED, &f->flags) || test_bit(BR_FDB_ADDED_BY_EXT_LEARN, &f->flags)) { if (test_bit(BR_FDB_NOTIFY, &f->flags)) { if (time_after(this_timer, now)) @@ -1465,7 +1466,9 @@ int br_fdb_external_learn_del(struct net_bridge *br, struct net_bridge_port *p, spin_lock_bh(&br->hash_lock); fdb = br_fdb_find(br, addr, vid); - if (fdb && test_bit(BR_FDB_ADDED_BY_EXT_LEARN, &fdb->flags)) + if (fdb && + (test_bit(BR_FDB_ADDED_BY_EXT_LEARN, &fdb->flags) || + test_bit(BR_FDB_OFFLOADED, &fdb->flags))) fdb_delete(br, fdb, swdev_notify); else err = -ENOENT; -- 2.34.1