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.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,FROM_EXCESS_BASE64, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED 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 76E9DC169C4 for ; Sun, 3 Feb 2019 05:34:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B1AE2083B for ; Sun, 3 Feb 2019 05:34:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TD1yHI3a" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726077AbfBCFeO (ORCPT ); Sun, 3 Feb 2019 00:34:14 -0500 Received: from mail-vs1-f68.google.com ([209.85.217.68]:47039 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725648AbfBCFeN (ORCPT ); Sun, 3 Feb 2019 00:34:13 -0500 Received: by mail-vs1-f68.google.com with SMTP id n10so6658228vso.13 for ; Sat, 02 Feb 2019 21:34:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=YbVmWR+4+wBNKI6EP4KZGPnAAtRsEU5yiuGlb0JsvcA=; b=TD1yHI3aZShsCm8Hn+8TdnxDFBZvJDQjr11y8vol0KtkDbDMkTgVntwR9Af42pFlbN FEseaQ69TerIA5lq9zTSkJYNCY90w6qemoqxPZj7Ijrf+kLgidS7rqlHVtGlagndVZBV K6uU5xjhsinllIdpKulZKVSZtdiaO43Ktry9t7KEWSPI1D3ofpt5BLvv/kDfQz/VTpCr GJ0brtvgEzWk5vGqpvSYgkTwR9A3QundShjaxxVS/u0gGj6ymPsnGre1i7ttgW1UNoPt /M0wvVQbJpYdHL2hdg2iFYotAEMONuEw4Otwk/ab8if3jciKqPFDZGuQuIH0UJKpOWCU idBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YbVmWR+4+wBNKI6EP4KZGPnAAtRsEU5yiuGlb0JsvcA=; b=KYhSQ+R35OTRH8k0vXA1AD9XTGxX4Vr16KSGZmeOpEbeMBJUrVaGoX7nWyhDk2PrXQ 0iRun/bMho+tI4IOH9AlgPjaW6FiuaT1zUP3KpPmLUVurcLcgN1ME2SdIaFmMtQSxs9V ReSkAcypE/ZFNmjouHY+dODe8C48ZOMFUFf9rXGoT7v7QtbPr/wp5Et7WDzEbQxnN6ht /UxV0fb+nVOJ6ZSTo4rtIWAqaOgn1bXNenFbmSU8Y3pV87AGdjZVm/DSeTwouaa71zrB aIQWSsjqVpbbHnWUjKm1tMIMNbkvnZcoh+TVj7edg/DG5/d5OIIo65jRTHByEN121nUD Mx1w== X-Gm-Message-State: AJcUukeYc4T20c0PvGPaKLv5aoBJNchbibc1VgINWZKLnmrsFx7kypnN h4ytmEifYPGd0ks+HqgdH0Ml8uG5qJggV6MNgg== X-Google-Smtp-Source: ALg8bN5MDDCoYSQcN7UpIv7c+a+JpPsNbLkB9rOA/Pgr5WUPDPXgLfc5y2uu+x5U4E17ddWef2gHNztfXGzEdWfW9tI= X-Received: by 2002:a67:6f82:: with SMTP id k124mr19644997vsc.42.1549172052469; Sat, 02 Feb 2019 21:34:12 -0800 (PST) MIME-Version: 1.0 References: <20190202142935.3090-1-rdong.ge@gmail.com> <7f8fadc6-1bb5-03b5-4f5e-a407e9116399@gmail.com> <20190202171636.GB3398@lunn.ch> In-Reply-To: <20190202171636.GB3398@lunn.ch> From: =?UTF-8?B?5oiI5ram5qCL?= Date: Sun, 3 Feb 2019 13:34:01 +0800 Message-ID: Subject: Re: [PATCH] net: dsa: slave: Don't propagate flag changes on down slave interfaces To: Andrew Lunn Cc: Florian Fainelli , vivien.didelot@gmail.com, davem@davemloft.net, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Andrew Sorry for the previous mails due to my error mail format setting on browser= . I have reproduced the tcpdump issue in my env, but not sure if it is the same issue as you mentioned. Ifdown a slave interface which is under tcpdump capturing will also decreas= e the master's promiscuous twice. So when I do: a) tcpdump -i ethx b) ifdown ethx c) ifup ethx d) goto a for several times the promiscuous count of master will go negative. Raydon Andrew Lunn =E4=BA=8E2019=E5=B9=B42=E6=9C=883=E6=97=A5=E5= =91=A8=E6=97=A5 =E4=B8=8A=E5=8D=881:16=E5=86=99=E9=81=93=EF=BC=9A > > On Sat, Feb 02, 2019 at 09:05:11AM -0800, Florian Fainelli wrote: > > Le 2/2/19 =C3=A0 6:29 AM, Rundong Ge a =C3=A9crit : > > > The unbalance of master's promiscuity or allmulti will happen after i= fdown > > > 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() appear= s > > 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