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=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT 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 E5121C282D7 for ; Sat, 2 Feb 2019 17:16:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A68552083B for ; Sat, 2 Feb 2019 17:16:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="EeTDf8pW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726387AbfBBRQj (ORCPT ); Sat, 2 Feb 2019 12:16:39 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:36851 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbfBBRQj (ORCPT ); Sat, 2 Feb 2019 12:16:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=d8SfLGdwXjtdriwA0cXG4lbfPY18SoMjckpVBrS/4/4=; b=EeTDf8pWR1s3CqBTNR1CdEHzJN +C4EcoTEeHmKvtTSwS2xqiGnGqyE3XkJ4Y6IeXIA3DihZw4mAfO+gY2w6BfX1RJV0RI+J4YI88dPz /0PNpRsdjzV55HkUa6HKhYBYUcjIMKXUagju0/fj9R2g+AE52hWFJ6hxopngY5HBLh6c=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1gpyuC-0001Q7-Lz; Sat, 02 Feb 2019 18:16:36 +0100 Date: Sat, 2 Feb 2019 18:16:36 +0100 From: Andrew Lunn To: Florian Fainelli Cc: Rundong Ge , vivien.didelot@gmail.com, davem@davemloft.net, netdev@vger.kernel.org Subject: Re: [PATCH] net: dsa: slave: Don't propagate flag changes on down slave interfaces Message-ID: <20190202171636.GB3398@lunn.ch> References: <20190202142935.3090-1-rdong.ge@gmail.com> <7f8fadc6-1bb5-03b5-4f5e-a407e9116399@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7f8fadc6-1bb5-03b5-4f5e-a407e9116399@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sat, Feb 02, 2019 at 09:05:11AM -0800, Florian Fainelli wrote: > 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: Hi Rundong, Florian I've seen issues with tcpdump causing the promiscuous count to go negative. I wounder if this will fix that at well? Andrew