Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp897424rdb; Tue, 19 Sep 2023 13:37:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEgoU+3T+EfyM88c9MBf6KppaucBZ04mZZTLSGtzgmHCKe5VdARVGIWJh3uUUuNumtnKQ3g X-Received: by 2002:a05:6358:99a1:b0:143:27e:d3cf with SMTP id j33-20020a05635899a100b00143027ed3cfmr927659rwb.4.1695155829408; Tue, 19 Sep 2023 13:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695155829; cv=none; d=google.com; s=arc-20160816; b=rcyFrIgsTDbbuTEX0XHtB7m5Gkg0YqcLVNEPxejYQq9n/cdkaJFNB05FZuNfq9zLtp ZC2stlnp4Hj6PvCvZxCYe5R5n7baSsapwrqxJpHuewLIANeYjr3xkeU9Se2mWnp4ogkt nrN76DRYYN4/aNHHxqHEdj84ZxnlJ+Hmd/FMEPcYq3xAiM0kmuShKKVrLeCXFK/GLvO4 FgUJ1AZw6SbTKbPFV+YxPyYERaWtyb47aCOv5kkGDzLH5kRw+Pp5gP0YZFtlSARELvsp AiKadCSZoe/YKHAUmRxN3C3y7T4C9vRJ3nPEsixFeMl+2kAG9+KSMWaF0Hu6XCW8tDBz 8sQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=GXgi+7it7TJZ+BnmRErxCssW8oym9RoKeuy/pjSqSX4=; fh=vdy8fLmkzgLosg2v5sVYMftPpjJTf1v+KansN80xFQ8=; b=ywl0lWB0DELipJqYo6EClmlDWux/+MUTcaebSNDpOB8je+b3JL52XbVomLgfMZ+BIi JvhkfupFxVBPcQKRjtN9+STQZbKH/7WFheEefaWntm3R3mF4jfk4RmrVq2picCfHW17r 2j2lERX5lTGWJMWhy84btQlIThNy6tDOaJnmG52oKTHZOHzQ1JGIt8b88NPfc4wtTCTP kOvQVZBN0SN++RaUo2nj6WD5NEdSart42YZufoRRepLs0C8fFAfCPU0Zaz1MJLyLyzlD Cw4Q0cmymlFaVANfrmodXw9HNl5y9oO5p55SbjkJPLvXotK3caGv5d6o9H/AADfP0DW4 ZVOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@avm.de header.s=mail header.b=bDYGCiaN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=avm.de Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id s72-20020a63774b000000b00565f0e9cfbbsi1704989pgc.382.2023.09.19.13.37.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 13:37:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@avm.de header.s=mail header.b=bDYGCiaN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=avm.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6207D81CEB3B; Tue, 19 Sep 2023 05:18:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232144AbjISMR7 (ORCPT + 99 others); Tue, 19 Sep 2023 08:17:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232043AbjISMR1 (ORCPT ); Tue, 19 Sep 2023 08:17:27 -0400 Received: from mail.avm.de (mail.avm.de [212.42.244.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 903E7CF5; Tue, 19 Sep 2023 05:16:36 -0700 (PDT) Received: from mail-auth.avm.de (dovecot-mx-01.avm.de [212.42.244.71]) by mail.avm.de (Postfix) with ESMTPS; Tue, 19 Sep 2023 14:16:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=avm.de; s=mail; t=1695125794; bh=FwyAToRIE29YQYTXCZD36dnr5jrFFg1GpuCyJILagjE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bDYGCiaNi2SMoB4Lq20YNO9OSX5appH2rXn5siz/Drn8RfD4iF4K36cjToWpcDfVd e7nJU4MIKMYNVCEJD42MsX0LP/2rgxBnmhBJGysdHEYleoFVkLdO38xxlor72DgWLG QWwGswxJmMDtXDRXD2HfMSdkTiOFUFCBZACOzzZ8= Received: from localhost (unknown [172.17.88.63]) by mail-auth.avm.de (Postfix) with ESMTPSA id 15F5981FF3; Tue, 19 Sep 2023 14:16:34 +0200 (CEST) From: Johannes Nixdorf Date: Tue, 19 Sep 2023 10:12:48 +0200 Subject: [PATCH net-next v4 1/6] net: bridge: Set BR_FDB_ADDED_BY_USER early in fdb_add_entry MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230919-fdb_limit-v4-1-39f0293807b8@avm.de> References: <20230919-fdb_limit-v4-0-39f0293807b8@avm.de> In-Reply-To: <20230919-fdb_limit-v4-0-39f0293807b8@avm.de> To: "David S. Miller" , Andrew Lunn , David Ahern , Eric Dumazet , Florian Fainelli , Ido Schimmel , Jakub Kicinski , Nikolay Aleksandrov , Oleksij Rempel , Paolo Abeni , Roopa Prabhu , Shuah Khan , Vladimir Oltean Cc: bridge@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Johannes Nixdorf X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1695111167; l=1376; i=jnixdorf-oss@avm.de; s=20230906; h=from:subject:message-id; bh=FwyAToRIE29YQYTXCZD36dnr5jrFFg1GpuCyJILagjE=; b=4H9SGHafMlvvhzLNe+S2ZC1itIhii7CabVi/bmpupLrRj5CyQXRME/UGIiDnlNZgJoDI3FcKL 1f27fMU577fAiVdzuph2/KCHWC8a67UWmmHku7Jz7fuUjk4Pqxt9Kcl X-Developer-Key: i=jnixdorf-oss@avm.de; a=ed25519; pk=KMraV4q7ANHRrwjf9EVhvU346JsqGGNSbPKeNILOQfo= X-purgate-ID: 149429::1695125794-54606D5A-73B3AB27/0/0 X-purgate-type: clean X-purgate-size: 1378 X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,DATE_IN_PAST_03_06, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 19 Sep 2023 05:18:01 -0700 (PDT) In preparation of the following fdb limit for dynamically learned entries, allow fdb_create to detect that the entry was added by the user. This way it can skip applying the limit in this case. Signed-off-by: Johannes Nixdorf --- net/bridge/br_fdb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index e69a872bfc1d..f517ea92132c 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c @@ -1056,7 +1056,8 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_port *source, if (!(flags & NLM_F_CREATE)) return -ENOENT; - fdb = fdb_create(br, source, addr, vid, 0); + fdb = fdb_create(br, source, addr, vid, + BIT(BR_FDB_ADDED_BY_USER)); if (!fdb) return -ENOMEM; @@ -1069,6 +1070,8 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_port *source, WRITE_ONCE(fdb->dst, source); modified = true; } + + set_bit(BR_FDB_ADDED_BY_USER, &fdb->flags); } if (fdb_to_nud(br, fdb) != state) { @@ -1100,8 +1103,6 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_port *source, if (fdb_handle_notify(fdb, notify)) modified = true; - set_bit(BR_FDB_ADDED_BY_USER, &fdb->flags); - fdb->used = jiffies; if (modified) { if (refresh) -- 2.42.0