Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3432116pxj; Tue, 11 May 2021 04:30:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8stVfazYtVXMsyew5cm92kGp0JY33bgzDUDuPZ26U4gRHKNo6ZJQtlWv717NdJLXkS4bZ X-Received: by 2002:a05:6e02:80b:: with SMTP id u11mr26692716ilm.153.1620732659723; Tue, 11 May 2021 04:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620732659; cv=none; d=google.com; s=arc-20160816; b=VBCdX2l52Zvq/qBGNSbBQBSDE3ECDCifpXj4e9WhpqiutrtOwJNxxFIauMBPYpkKWX MisHBtJL9WBsK9RocGX6iQJY5jpEOFsZz/Z7jOz0g+7D4Kwc2e4x7GMSr0cTdQ53LlBZ dYbSCnYCeaHKOFzBMa533tH8m4hVg/Axe5VgVB9EuU+9ZRDekGoZA/AXSSAH6S9q74gE BfzEwEqOwIYlGBmv5Qx/lrLufF0ubVLlK91y1cwjyrmQF92B6T6asS1nPXJrGMf8RFdT AzNnc14xV6q2FHgolxzAz44KF5NWr8k5SGkUox5GMlYWiquLthJDXnlBvqM6Xg+RWcUZ NF8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=44UrMKOpEgYUiNO89savLvoTA2ZPcTWprUDBxfbb6WU=; b=rcTK/b6yUAVjMnvHxW0Sw7FfOdbO+5I1ootFrBWwKkWzId4Ja/HzmZTmWwrSVitNej HMbMMqriNgqFqka9XgNNFyveBraeDTA0UYeiuPV4Rs3JQO5j+XZwFF2GqrEPTOsKuvex jPNlZgrwjN5jtMVIA/zBQt+VKwxUP6DM/DUzXdqD00F+JtqtmKYWdWsSWn5fBNwcL+Xj cR+pkWh4ohCYgWQ2jhRAcFfPjGGnCgEba4PeSxJ1NzwJ1bvcOK4GO+OCYIRM4mbCZ2NP gs2ym4SCDKw4KJJG338/ywnKFshYr+yKKtreUpt9MTc3ZQOIEZY6wsyCVTkcLJ+C295x mBYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si16718998jad.12.2021.05.11.04.30.46; Tue, 11 May 2021 04:30:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231481AbhEKLaH (ORCPT + 99 others); Tue, 11 May 2021 07:30:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230519AbhEKLaG (ORCPT ); Tue, 11 May 2021 07:30:06 -0400 Received: from mail.aperture-lab.de (mail.aperture-lab.de [IPv6:2a01:4f8:c2c:665b::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70E35C061574; Tue, 11 May 2021 04:28:59 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 711293E8F5; Tue, 11 May 2021 13:28:56 +0200 (CEST) Date: Tue, 11 May 2021 13:28:54 +0200 From: Linus =?utf-8?Q?L=C3=BCssing?= To: The list for a Better Approach To Mobile Ad-hoc Networking Cc: netdev@vger.kernel.org, Roopa Prabhu , Jakub Kicinski , "David S . Miller" , bridge@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [net-next v2 09/11] net: bridge: mcast: split multicast router state for IPv4 and IPv6 Message-ID: <20210511112854.GA2222@otheros> References: <20210509194509.10849-1-linus.luessing@c0d3.blue> <20210509194509.10849-10-linus.luessing@c0d3.blue> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Last-TLS-Session-Version: TLSv1.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 11, 2021 at 12:29:41PM +0300, Nikolay Aleksandrov wrote: > [...] > > -static void br_multicast_mark_router(struct net_bridge *br, > > - struct net_bridge_port *port) > > +#if IS_ENABLED(CONFIG_IPV6) > > +struct hlist_node * > > +br_ip6_multicast_get_rport_slot(struct net_bridge *br, struct net_bridge_port *port) > > +{ > > + struct hlist_node *slot = NULL; > > + struct net_bridge_port *p; > > + > > + hlist_for_each_entry(p, &br->ip6_mc_router_list, ip6_rlist) { > > + if ((unsigned long)port >= (unsigned long)p) > > + break; > > + slot = &p->ip6_rlist; > > + } > > + > > + return slot; > > +} > > The ip4/ip6 get_rport_slot functions are identical, why not add a list pointer > and use one function ? Hi Nikolay, Thanks for all the feedback and reviewing again! I'll remove (most of) the inlines as the router list modifications are not in the fast path. For the get_rport_slot functions, maybe I'm missing a simple solution. Note that "ip6_rlist" in hlist_for_each_entry() is not a pointer but will be expanded by the macro. I currently don't see how I could solve this with just one hlist_for_each_entry(). Regards, Linus