Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4341656pxu; Mon, 12 Oct 2020 16:52:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLT2+xjWg7kx28JI+m8fCAhFtvaeQAwkJW1O01x3xfvPQ43Jx1UjbGlGUT0Dkr7ec+RV+r X-Received: by 2002:a17:906:f24b:: with SMTP id gy11mr1307575ejb.371.1602546731517; Mon, 12 Oct 2020 16:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602546731; cv=none; d=google.com; s=arc-20160816; b=Df0h5qySf1m7COEJvh2R8NWX1zqBMrzL9TBgrzo9BBW/VVrGc4RMmplkIOfW9qzaJS 2O6a7jTGFPLtJs2X7Otl5Zq/5NAt0c3QgQq23Kl9j6PDhDLmhNHday+LilKYG8N+hDtz mNE5+De9sowk8olvgpAYbj9r0LO0+rkbGuwQFvALSCTebqqFoaNSEdy3RYxAifbEEy8J AU6cx3EYxU6zEjT3uOWmQnmwCAdtWxUpVMvJsRJnGUn2ABuf569hdw9wa3/ZCD7hbIo0 pOyobUmwYKxdkPAAmtpVxAQWK3lPvE/+iL1FKUKhdcQJnr4tQFfsv0eSeCzx4fYjGDBs VJJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qhXOsV7ekjMSBoAS0pQOXPIdPh14KaThLr8U5OAB3Ck=; b=uF8giGD566i7iEe8ubrOdFNlfDfvvs+wWc1qOc6vnIXmiq2SPIPpqBWpXbyGhP0Ht2 cObqjD4UOVrPPP70vuFOOWmD/l+9gw9BdUiIeOA7JnrmNaXaw9PzeW/rNC5ygyofYNYO Ico6qX9VNVyb35+FqExuSC5h/0qvt+50CJVAYXswmTaY/CF9yGSFTXK3QmMyrz5ih2kA Z/g9uN39kLYuAmY8oabxKPGDucYGRK7jxhK0tuPUQht4mp94/bfh/AAHUYjVp7lNwbgk lLOr43aUKlbBtGt3gWDX4heeppHLoAPG3ul8xtFtWl65D0epKH3T+Lot5IN7P25LIBI8 sM4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=u9aAN3F1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si8736985eds.406.2020.10.12.16.51.49; Mon, 12 Oct 2020 16:52:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=u9aAN3F1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390011AbgJLNuO (ORCPT + 99 others); Mon, 12 Oct 2020 09:50:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:55734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731918AbgJLNsT (ORCPT ); Mon, 12 Oct 2020 09:48:19 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 744772076E; Mon, 12 Oct 2020 13:48:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510493; bh=3mnmW4Kn3WSOaWuJNFlbQfs1FOqdw20rPVotspi8Mw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u9aAN3F1PIv+7Qexw5FtZALUGcGvuR7sZXVRlcopttujhQFuiRQmnqVOpATuk1Yzx s1zB3fKEOTjCERLQMoyRvoHV5q+cQ53Rb4n55gbWz2ql0etG+YikizNb9uQlYCPMOX gvXgYHl48Md21S4dUoqsFNJ6jZhRuBtKsmb6f4Bg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nikolay Aleksandrov , "David S. Miller" Subject: [PATCH 5.8 116/124] net: bridge: fdb: dont flush ext_learn entries Date: Mon, 12 Oct 2020 15:32:00 +0200 Message-Id: <20201012133152.464287592@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012133146.834528783@linuxfoundation.org> References: <20201012133146.834528783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nikolay Aleksandrov commit f2f3729fb65c5c2e6db234e6316b71a7bdc4b30b upstream. When a user-space software manages fdb entries externally it should set the ext_learn flag which marks the fdb entry as externally managed and avoids expiring it (they're treated as static fdbs). Unfortunately on events where fdb entries are flushed (STP down, netlink fdb flush etc) these fdbs are also deleted automatically by the bridge. That in turn causes trouble for the managing user-space software (e.g. in MLAG setups we lose remote fdb entries on port flaps). These entries are completely externally managed so we should avoid automatically deleting them, the only exception are offloaded entries (i.e. BR_FDB_ADDED_BY_EXT_LEARN + BR_FDB_OFFLOADED). They are flushed as before. Fixes: eb100e0e24a2 ("net: bridge: allow to add externally learned entries from user-space") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/bridge/br_fdb.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c @@ -404,6 +404,8 @@ void br_fdb_delete_by_port(struct net_br if (!do_all) if (test_bit(BR_FDB_STATIC, &f->flags) || + (test_bit(BR_FDB_ADDED_BY_EXT_LEARN, &f->flags) && + !test_bit(BR_FDB_OFFLOADED, &f->flags)) || (vid && f->key.vlan_id != vid)) continue;