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=-6.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT 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 532ABC4360F for ; Thu, 4 Apr 2019 12:22:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 203BC206C0 for ; Thu, 4 Apr 2019 12:22:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728683AbfDDMWA (ORCPT ); Thu, 4 Apr 2019 08:22:00 -0400 Received: from ganesha.gnumonks.org ([213.95.27.120]:40908 "EHLO ganesha.gnumonks.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727039AbfDDMWA (ORCPT ); Thu, 4 Apr 2019 08:22:00 -0400 Received: from sys.soleta.eu ([212.170.55.40] helo=gnumonks.org) by ganesha.gnumonks.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1hC1NU-0004sv-7P; Thu, 04 Apr 2019 14:21:58 +0200 Date: Thu, 4 Apr 2019 14:21:55 +0200 From: Pablo Neira Ayuso To: Nikolay Aleksandrov Cc: netdev@vger.kernel.org, davem@davemloft.net, roopa@cumulusnetworks.com, bridge@lists.linux-foundation.org, nbd@nbd.name Subject: Re: [PATCH net-next] net: bridge: update multicast stats from maybe_deliver() Message-ID: <20190404122155.grjs6beng6ubt5gr@salvia> References: <20190404115638.28592-1-pablo@netfilter.org> <952568d9-771f-982c-9a75-5dfc01a461fb@cumulusnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <952568d9-771f-982c-9a75-5dfc01a461fb@cumulusnetworks.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Apr 04, 2019 at 03:02:19PM +0300, Nikolay Aleksandrov wrote: > On 04/04/2019 14:56, Pablo Neira Ayuso wrote: > > Simplify this code by updating bridge multicast stats from > > maybe_deliver(). > > > > Note that commit 6db6f0eae605 ("bridge: multicast to unicast"), in case > > the port flag BR_MULTICAST_TO_UNICAST is set, never updates the previous > > port pointer, therefore it is always going to be different from the > > existing port in this deduplicated list iteration. > > > > Signed-off-by: Pablo Neira Ayuso > > --- > > net/bridge/br_forward.c | 15 ++++----------- > > 1 file changed, 4 insertions(+), 11 deletions(-) This is removing two branches, it is less code to maintain and easier to read than: if (prev == p) > This was intentional, the reason I didn't add that call to maybe_deliver() is to avoid > these checks for the standard unicast fast-path. We need to avoid touching the mcast > cache lines (and checks) when using unicast. maybe_deliver() is called from br_flood() and br_multicast_flood(), not the standard unicast fast-path. Thanks.