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=-5.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 C6B6CC10F13 for ; Mon, 8 Apr 2019 12:50:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 93E6A20883 for ; Mon, 8 Apr 2019 12:50:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lwyOx3RZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726585AbfDHMuQ (ORCPT ); Mon, 8 Apr 2019 08:50:16 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:41099 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726349AbfDHMuQ (ORCPT ); Mon, 8 Apr 2019 08:50:16 -0400 Received: by mail-pf1-f195.google.com with SMTP id 188so7574017pfd.8 for ; Mon, 08 Apr 2019 05:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=41WCg9mySUExaeANbEpDyg2NTd+lsre3TxW1irMMn4k=; b=lwyOx3RZuW+Knas01HcVQZGhfQROWuprITAkiR03n1Z93e3fJseCAoXRJYWu5ID9SP sJYCd8FfkNzH7bBK0yBCBj6f17nIMVNLODPE4V/7pCqEyB4URrg1IjM0w/8epHMYVMHS CnCz7qiAV9lA+gKaJSyENigYt/5jLJRbZTOmkio+6Grcb3bbVlj2tQlrZp1XqAy2bY46 g6e7Fa6X7W3glUsvxljjtzCxdwrGNA6uc5zFzvfHrvOvafk7pD7e+x08b+ktZLom93oY UfvfrX8hcywDJgqp+eMzpNXeZPQfThUjbrGbNr+eyizV/nhAkSDuTRin7b7XInAyyxF+ IkSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=41WCg9mySUExaeANbEpDyg2NTd+lsre3TxW1irMMn4k=; b=KlvbkekkmYgQzIXxTr+lnh3PZDnzbsXpO+9ERioIYN/NVBz9zNu6uh4OFW+sdfyxhT 4DxAL9vA8SXm4099DBFdSWwGwku/0Ca27DT+5uZoqnyRC9OE4GiaxXOhju6RPcRjYTE2 88CvJv7YIV+JA3MaesA2BaKkXEosCxebXQ1gciTUM9VMlwzMFc23rkWgIU1dCr2V9hC8 2nNlNWca3MPKJ2a7nxJ3UthIUlSbdWGU2+5FdQbCoVNL0fKv9i3z/p5GIT3Np8b7mpFv umhTgaUIYPhGP3SlVo/D7zZ+nXEpU72NR283xJqHVaH9KILYAMVkuTirx+WkY/ShPLBb G3qw== X-Gm-Message-State: APjAAAVRc3NWzcea63KSKxXIcp/2CZ+XHiCw76ebx258nPhSifVin+tt weyJ9/haqVBZ4Nt+snDa3vI64yViO1g= X-Google-Smtp-Source: APXvYqzciYbjshInyuQRhn4ky2+vbBidCQGKSsutBqr45oFUZ9frF9jZDC3ROdDIRoiXzoF2Dvc1ug== X-Received: by 2002:a63:5c43:: with SMTP id n3mr26232874pgm.163.1554727815491; Mon, 08 Apr 2019 05:50:15 -0700 (PDT) Received: from dhcp-12-139.nay.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id p26sm66663885pfa.49.2019.04.08.05.50.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Apr 2019 05:50:14 -0700 (PDT) Date: Mon, 8 Apr 2019 20:50:05 +0800 From: Hangbin Liu To: David Miller Cc: netdev@vger.kernel.org, wangchen@cn.fujitsu.com, sbrivio@redhat.com Subject: Re: [PATCH net] netdevice: Fix promiscuity and allmulti negative overflow Message-ID: <20190408125005.GQ10051@dhcp-12-139.nay.redhat.com> References: <20190404124518.16794-1-liuhangbin@gmail.com> <20190406.181428.1813237479044536410.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190406.181428.1813237479044536410.davem@davemloft.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi David, On Sat, Apr 06, 2019 at 06:14:28PM -0700, David Miller wrote: > From: Hangbin Liu > Date: Thu, 4 Apr 2019 20:45:18 +0800 > > > Similarly to dad9b335c694 ("netdevice: Fix promiscuity and allmulti > > overflow"), we should not decrease promiscuity if it is already 0. > > > > An example is after adding a team interface to bridge, the team interface > > will enter promisc mode. Then if we add a slave to team0, the slave will > > keep promisc off. If we remove team from bridge, both team0 and slave will > > decrease the promiscuity, which will cause a negative overflow on the slave. > > The team's issue will be fixed in a separate patch. > > > > Reviewed-by: Stefano Brivio > > Signed-off-by: Hangbin Liu > > These little hacks are endless. > > I would rather see team and bridge and bonding appropriately keep the > promisc count adjusted as need when slaves are added/removed etc. Yes, I have post a v2 patch for team fix. but I think the dev_set_promiscuity() should also be more robust and not broken so eassily. Thanks Hangbin