Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1630715pxv; Fri, 2 Jul 2021 08:23:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXItEXmLvPKHdjeTBPuQw3Jy9sPatXHU+fgnoUVQdmRDPBLiX+d4uJUakkdfa0NbOElx5G X-Received: by 2002:aa7:c909:: with SMTP id b9mr4913187edt.1.1625239402963; Fri, 02 Jul 2021 08:23:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625239402; cv=none; d=google.com; s=arc-20160816; b=WQnZ6K5IwQKQM9ip5OwolDgi7M6VO7zLTdzL06CaYgmbD1hbSs6vJhgvMOflKhGMAD lylhjomFJCmxmTUIv94EABpenl/X28+/t8g7PCr5HZF7zRgUuQl67pY9jdOTNnBTkE8k IB6mhUxVuJK2KkK0zggVGPS+bZ6LqfYmn0D6E7XyFZRjK5rjYHbcnF+c5eT9f+x0zglM jB6VdtsB4bP7AXpFAr6YCPDuHgBhydtziYkH4niwUsbOFonshmO21eRrujzoFVIBNYLw Q/+07qTY/2D4fWTlSa0S8S2nL76eZC2y5Xgh/pcJrrAoc9vh/YcRpGTuOyrivAO5xUto fKmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OrjOu76OBGPYy39KuvyK91RrT0dYFD2lgNzam5imG+w=; b=DqvOIFTDb9t/MTBLO/SHsR3aVwpUHujBAyKg8BCZWxEp8uojkUP9ImErA7ZEjG/s8f vLhP1+/UbY1Osp9aI9xht0Cq4s6wppMnzgWdtAQxUhjZG96CZpVwKntPEmHqECJXOeRu NU2eHo/fkMtDx5z6kMvXeAEgG82MnLBZokCCva4c9UG6aJHN/6jYjSqXX2H8YgUjKPKL LFjz3kFAiX8si20w/PqAPqn8ahweNJVY7dKqVzI2ZlKCUGIF1BvYKxzMQ6jekoP29H4D caMNKYtKHt38E2bX6ciFnEoW3pvCvLRkQhCgq61V+EKBPTTfBHcOqzXSmB78NcY+Qw6W Qe2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=aKtlMxct; 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 f15si3290297edf.175.2021.07.02.08.22.59; Fri, 02 Jul 2021 08:23:22 -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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=aKtlMxct; 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 S232289AbhGBPRL (ORCPT + 99 others); Fri, 2 Jul 2021 11:17:11 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:37646 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232248AbhGBPRK (ORCPT ); Fri, 2 Jul 2021 11:17:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=OrjOu76OBGPYy39KuvyK91RrT0dYFD2lgNzam5imG+w=; b=aKtlMxctQdlvgLWeJXRAg8VLhm EbHsjT0nSPMFHL23FLtPtdhFO8RIfusa7/n27a8xsVCqiN6uWQ8bufbJtVU3c/rYnulI/cHYFKEOV uEPPLInjWnn2sTZtkUeUvstH53ajiZ94NbVvRXIfdleKEY1yzXMzLIplwkcTfsZLU7s4=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1lzKsE-00BvlX-B2; Fri, 02 Jul 2021 17:14:34 +0200 Date: Fri, 2 Jul 2021 17:14:34 +0200 From: Andrew Lunn To: Oleksij Rempel , '@lunn.ch Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Russell King , Pengutronix Kernel Team , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org Subject: Re: [PATCH net-next v2 3/6] net: dsa: qca: ar9331: add forwarding database support' Message-ID: References: <20210702101751.13168-1-o.rempel@pengutronix.de> <20210702101751.13168-4-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210702101751.13168-4-o.rempel@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 02, 2021 at 12:17:48PM +0200, Oleksij Rempel wrote: > This switch provides simple address resolution table, without VLAN or > multicast specific information. > With this patch we are able now to read, modify unicast and mulicast mul_t_icast. > addresses. > +static int ar9331_sw_port_fdb_dump(struct dsa_switch *ds, int port, > + dsa_fdb_dump_cb_t *cb, void *data) > +{ > + struct ar9331_sw_priv *priv = (struct ar9331_sw_priv *)ds->priv; > + int cnt = AR9331_SW_NUM_ARL_RECORDS; > + struct ar9331_sw_fdb _fdb = { 0 }; Why use _fdb? There does not appear to be an fdb? > +static int ar9331_sw_port_fdb_rmw(struct ar9331_sw_priv *priv, > + const unsigned char *mac, > + u8 port_mask_set, > + u8 port_mask_clr) > +{ > + struct regmap *regmap = priv->regmap; > + u32 f0, f1, f2 = 0; > + u8 port_mask, port_mask_new, status, func; > + int ret; Reverse Christmas tree. > +static int ar9331_sw_port_fdb_add(struct dsa_switch *ds, int port, > + const unsigned char *mac, u16 vid) > +{ > + struct ar9331_sw_priv *priv = (struct ar9331_sw_priv *)ds->priv; > + u16 port_mask = BIT(port); > + > + dev_info(priv->dev, "%s(%pM, %x)\n", __func__, mac, port); dev_dbg()? Andrew