From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.2 required=3.0 tests=DATE_IN_PAST_12_24, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8B03C282D7 for ; Tue, 5 Feb 2019 18:25:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF2012175B for ; Tue, 5 Feb 2019 18:25:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729977AbfBESZC convert rfc822-to-8bit (ORCPT ); Tue, 5 Feb 2019 13:25:02 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:45942 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729941AbfBESZB (ORCPT ); Tue, 5 Feb 2019 13:25:01 -0500 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id BFF84133FABD2; Tue, 5 Feb 2019 10:25:00 -0800 (PST) Date: Mon, 04 Feb 2019 18:29:23 -0800 (PST) Message-Id: <20190204.182923.1406130482982930675.davem@davemloft.net> To: f.fainelli@gmail.com Cc: rdong.ge@gmail.com, andrew@lunn.ch, vivien.didelot@gmail.com, netdev@vger.kernel.org Subject: Re: [PATCH] net: dsa: slave: Don't propagate flag changes on down slave interfaces From: David Miller In-Reply-To: <7f8fadc6-1bb5-03b5-4f5e-a407e9116399@gmail.com> References: <20190202142935.3090-1-rdong.ge@gmail.com> <7f8fadc6-1bb5-03b5-4f5e-a407e9116399@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 05 Feb 2019 10:25:01 -0800 (PST) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Florian Fainelli Date: Sat, 2 Feb 2019 09:05:11 -0800 > Le 2/2/19 à 6:29 AM, Rundong Ge a écrit : >> The unbalance of master's promiscuity or allmulti will happen after ifdown >> and ifup a slave interface which is in a bridge. >> >> When we ifdown a slave interface , both the 'dsa_slave_close' and >> 'dsa_slave_change_rx_flags' will clear the master's flags. The flags >> of master will be decrease twice. >> In the other hand, if we ifup the slave interface again, since the >> slave's flags were cleared the 'dsa_slave_open' won't set the master's >> flag, only 'dsa_slave_change_rx_flags' that triggered by 'br_add_if' >> will set the master's flags. The flags of master is increase once. >> >> Only propagating flag changes when a slave interface is up makes >> sure this does not happen. The 'vlan_dev_change_rx_flags' had the >> same problem and was fixed, and changes here follows that fix. > > VLAN code under net/8021q/vlan_dev.c::vlan_dev_change_rx_flags() appears > to do the same thing that you are proposing, so this looks fine to me. > Since that is a bugfix, we should probably add: > > Fixes: 91da11f870f0 ("net: Distributed Switch Architecture protocol > support") Applied with Fixes tag added, and queued up for -stable. Thanks.