From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753378AbcITAcl (ORCPT ); Mon, 19 Sep 2016 20:32:41 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:52744 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbcITAcj (ORCPT ); Mon, 19 Sep 2016 20:32:39 -0400 Date: Tue, 20 Sep 2016 02:32:36 +0200 From: Andrew Lunn To: Vivien Didelot Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli Subject: Re: [PATCH net-next] net: dsa: mv88e6xxx: handle multiple ports in ATU Message-ID: <20160920003236.GD6323@lunn.ch> References: <20160919235611.31975-1-vivien.didelot@savoirfairelinux.com> <20160920001914.GB6323@lunn.ch> <87oa3jo1l7.fsf@ketchup.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87oa3jo1l7.fsf@ketchup.i-did-not-set--mail-host-address--so-tickle-me> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 19, 2016 at 08:29:40PM -0400, Vivien Didelot wrote: > Hi Andrew, > > Andrew Lunn writes: > > > Hi Vivien > > > >> + do { > >> + err = _mv88e6xxx_atu_getnext(chip, fid, &next); > >> + if (err) > >> + return err; > >> + > >> + if (next.state == GLOBAL_ATU_DATA_STATE_UNUSED) > >> + break; > >> + > >> + if (ether_addr_equal(next.mac, addr)) { > >> + *entry = next; > >> + return 0; > >> + } > >> + } while (!is_broadcast_ether_addr(next.mac)); > > > > This is correct, but i wonder how well it scales? When we have a lot > > of entries in the ATU, this is going to take time. At some point in > > the future, we might want to keep a shadow copy of static entries of > > the ATU in RAM. We then don't need to search for them. > > There won't be any issue about time here, because we are searching a > precise FID. Ah, i didn't realise you can do that. However, it makes sense, the hardware needs to do it all the time when it receives a frame. Andrew