Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3706437pxb; Mon, 24 Jan 2022 15:56:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCSQGUgo4Kzv46rAroBfTKiq9ME6pVblNhrCSKiOr+igbqnCIPEAhXZDltQwzGxwHRHbnd X-Received: by 2002:a05:6a00:21c2:b0:4bc:fb2d:4b6f with SMTP id t2-20020a056a0021c200b004bcfb2d4b6fmr15817594pfj.62.1643068468950; Mon, 24 Jan 2022 15:54:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068468; cv=none; d=google.com; s=arc-20160816; b=sDVoimJGG7RBXHn5GszPVQf+csTRza/U2RMTaT6RSpOdWSsB+wLrw3FcONV96eJuox V9OLKaawWoqhmgxDZqWKfhHb6JVsR3nrb5iyAK8XRJxwoXQdAf+08e1piLPYeTe+Te4I 8pYH0ljJ3mfAA573823G3Dk+p8wxDwl4gAx8FOy+ZB+HiNFZJIQADkUexj6YXIZL0Kqb DlwsNqVFRaKxP8TPrirMFXn3vWLwjeaX0qS8Gv7ifsFQIzLGBZI2A0ld9f+pD4RPSbY7 oS45XQTOJse6MwIlpyXIPnafWKrEUy2Ni/b39NnFVJK5Hs+CA6U0CaTKS2XJ5M8Lhi/z z+EA== 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:dkim-signature; bh=18KJwP2b3bz21HNcarg1aueiUUVE21tAdU9ddUfz3qA=; b=Rg+Z5YgXQEdKM68r9gvy4SQoQDGrdlIJ+YW5jGbqyR18seILDdjs2rb1xW6Uh1yi34 YM5NnAKi0NHBmPjcP3SNRom5q6rr4Bu5ypnSB5XZbhmY51yNIs3BIsW27SKgiCc+9/2Y XmnqYsRqz2FbOOFGSVv4MJ0Idr24Mf3y46yG13NiJPmL3Lrgom+k41CxICCBOmmHnaK0 YPQ2AKxxIqlH0lUp0Go2gv6xkjS+6isgnH7DwSuPhv8LvxLAJWKPW1SP4hmJ9QSC+P6m Nn3C7vxFyBDUP4LyPKnC9SZo3mYaC1dNQ991KhUCx94jTSjnOVcpP+wBKRZ78mtBTfL7 3zOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@waldekranz-com.20210112.gappssmtp.com header.s=20210112 header.b=OsU66u99; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bg7si13392224plb.285.2022.01.24.15.54.17; Mon, 24 Jan 2022 15:54:28 -0800 (PST) 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=@waldekranz-com.20210112.gappssmtp.com header.s=20210112 header.b=OsU66u99; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2364303AbiAXXrN (ORCPT + 99 others); Mon, 24 Jan 2022 18:47:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356393AbiAXWz7 (ORCPT ); Mon, 24 Jan 2022 17:55:59 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47B88C0680BA for ; Mon, 24 Jan 2022 13:10:04 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id x7so52565891lfu.8 for ; Mon, 24 Jan 2022 13:10:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=waldekranz-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:organization:content-transfer-encoding; bh=18KJwP2b3bz21HNcarg1aueiUUVE21tAdU9ddUfz3qA=; b=OsU66u99/x9BMUkHF9xzX6B+3gW1+rFX/a5ajDSKkmI+Ml+RsGLwJcN7JhZK+OT7dm cU8aqIG3qqoDrU87ET/8ybgc7Jm5cqpBemP3uHyJGEKWFA0QY7LNJ1ESp3A3/qdm4Fip kC0V31Xmqgd4rJ+ELdHRdnexUMoExv+HeUz5qiMdyydSC36Qz5iyCMNDR7fLJZnzSAoE pI+YTJOUwp9lIRfNxLNe7FUgbuTropK2DhTsfHQfQG5bQIppNMU+kAwK6SjIBLDYlleD B00RxjzHjF7oDhMSanZlXxBIHPMI5+KwX4k4yfQlCe3FPPW4OJmwz7zsvNFhMu76XY2j 8Q8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:organization:content-transfer-encoding; bh=18KJwP2b3bz21HNcarg1aueiUUVE21tAdU9ddUfz3qA=; b=fWo/jya+Yu6wpuiqyQM5BWX+U2HW5ShFhgyZgC1flx/3+PkTHU1dJ55q4IP1tcKMKL a05Jjhw0TnXQv93VXgbXAPQdhBIp6q/JxFmgF6yNGJkmUdIim00geT5IXF81tejxPhpR 2LcShUzz527CHDCyXWKpiBx+7eZitMfDAA5WDQnPEXv5LObUVUy2BV7xcH50LZ7vpc8i Sp1VoSsathNgmDQaQzRU89m+7L6GWqU2ZpnECC2dawEzHltSwvAh/mdSA6SA62/0895p h3NwoUNObHzSOs+QZXGbveFuFfGKpFwYZQ4anoUiJtph/JGCEhEd+TV6IME9rs5WEQrk GF6A== X-Gm-Message-State: AOAM531aAjaa/DxJOI5lygOifnH+4HBAkA6GiDExhYeTDwppAPai4be+ ch+CzRIrflZVc9zdh4eHbz9rGg== X-Received: by 2002:a05:6512:33d1:: with SMTP id d17mr6920429lfg.647.1643058602643; Mon, 24 Jan 2022 13:10:02 -0800 (PST) Received: from veiron.westermo.com (static-193-12-47-89.cust.tele2.se. [193.12.47.89]) by smtp.gmail.com with ESMTPSA id t12sm1009115ljj.118.2022.01.24.13.10.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 13:10:02 -0800 (PST) From: Tobias Waldekranz To: davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , linux-kernel@vger.kernel.org Subject: [PATCH net 1/2] net: dsa: Move VLAN filtering syncing out of dsa_switch_bridge_leave Date: Mon, 24 Jan 2022 22:09:43 +0100 Message-Id: <20220124210944.3749235-2-tobias@waldekranz.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220124210944.3749235-1-tobias@waldekranz.com> References: <20220124210944.3749235-1-tobias@waldekranz.com> MIME-Version: 1.0 Organization: Westermo Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Most of dsa_switch_bridge_leave was, in fact, dealing with the syncing of VLAN filtering for switches on which that is a global setting. Separate the two phases to prepare for the cross-chip related bugfix in the following commit. Signed-off-by: Tobias Waldekranz --- net/dsa/switch.c | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/net/dsa/switch.c b/net/dsa/switch.c index e3c7d2627a61..9f9b70d6070a 100644 --- a/net/dsa/switch.c +++ b/net/dsa/switch.c @@ -113,26 +113,15 @@ static int dsa_switch_bridge_join(struct dsa_switch *ds, return dsa_tag_8021q_bridge_join(ds, info); } -static int dsa_switch_bridge_leave(struct dsa_switch *ds, - struct dsa_notifier_bridge_info *info) +static int dsa_switch_sync_vlan_filtering(struct dsa_switch *ds, + struct dsa_notifier_bridge_info *info) { - struct dsa_switch_tree *dst = ds->dst; struct netlink_ext_ack extack = {0}; bool change_vlan_filtering = false; bool vlan_filtering; struct dsa_port *dp; int err; - if (dst->index == info->tree_index && ds->index == info->sw_index && - ds->ops->port_bridge_leave) - ds->ops->port_bridge_leave(ds, info->port, info->bridge); - - if ((dst->index != info->tree_index || ds->index != info->sw_index) && - ds->ops->crosschip_bridge_leave) - ds->ops->crosschip_bridge_leave(ds, info->tree_index, - info->sw_index, info->port, - info->bridge); - if (ds->needs_standalone_vlan_filtering && !br_vlan_enabled(info->bridge.dev)) { change_vlan_filtering = true; @@ -172,6 +161,29 @@ static int dsa_switch_bridge_leave(struct dsa_switch *ds, return err; } + return 0; +} + +static int dsa_switch_bridge_leave(struct dsa_switch *ds, + struct dsa_notifier_bridge_info *info) +{ + struct dsa_switch_tree *dst = ds->dst; + int err; + + if (dst->index == info->tree_index && ds->index == info->sw_index && + ds->ops->port_bridge_leave) + ds->ops->port_bridge_leave(ds, info->port, info->bridge); + + if ((dst->index != info->tree_index || ds->index != info->sw_index) && + ds->ops->crosschip_bridge_leave) + ds->ops->crosschip_bridge_leave(ds, info->tree_index, + info->sw_index, info->port, + info->bridge); + + err = dsa_switch_sync_vlan_filtering(ds, info); + if (err) + return err; + return dsa_tag_8021q_bridge_leave(ds, info); } -- 2.25.1