Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp2670197qtg; Tue, 4 Apr 2023 06:09:59 -0700 (PDT) X-Google-Smtp-Source: AKy350YLmyOX/doFXz9DARwp8EFMX0e/26ZWHalmAkuJOKiqaPwuWXXP84TDlgkW8xUG5FKsPVxX X-Received: by 2002:a17:90a:590e:b0:23f:2757:ce99 with SMTP id k14-20020a17090a590e00b0023f2757ce99mr2567036pji.49.1680613798671; Tue, 04 Apr 2023 06:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680613798; cv=none; d=google.com; s=arc-20160816; b=qsEzrXKC75XdXSFylZiwgxegA++nxAM2ZzxTCX/7/EEIg+RiIf5WpslArs8lKEEI/4 y8ReaCvm0hvuhBEj+Gu7BwaBt2Ka+qP/g6ejx/TOyPDD9hqK0g2CQE63tZ6au0kEay9l +TEIsDFMktaAyEh3u3jK4F/vyx+km7nRzkszvf9eD03a12tA0kaZfMRmtlPN6qi0o4Tp IJtHPuX6jXro5OXVIGGd3rObzihE4Pd9AFbYZUbjpkRZ1D2Ew1ILh5srdVkLeMHY8SWM IRL3T1kJP55kXYx1aaPbPw3ppVlqbsPhvegus8pRkl4WJZ/NVt78/ZOkkoCdxZkEHbZL VI7A== 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=R4d+QkbhW4patc9H9LDYt3c1Kp73orSY0xw1wJY2rJw=; b=uheWkilQ0es4L68cmQmG1bMz1aO38CgRflYKPbYLb2zXE6Q75gUkFKH7Tpfv92TPd3 XAb1omTZz7AvXYZQlymX/iiE0afczVDQM6kw4FjRKVjOya43M9NVW1lWTABQ75BOYUd2 SJpnuCjSd1eVeSujMliJRpv+MiVV0MBWacH+fFxdKnPC20ihqbXgb2r6bfOPLtxvgnLh a5XY22Xr5HH4YClsYNxzr/L1Jqg6IQ3EVxLFaTJ0JM4uHCJ1/V5A0LdKou45+WOd8TLV PO682aK+Q/6mAF7wBMaQc2ctegpdOe5FOuCfipIpFseWouljYLTcze/Bs3bZUPyAOhnw 0dHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mj24-20020a17090b369800b002336940f887si9935767pjb.61.2023.04.04.06.09.47; Tue, 04 Apr 2023 06:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234750AbjDDNGS (ORCPT + 99 others); Tue, 4 Apr 2023 09:06:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234434AbjDDNGQ (ORCPT ); Tue, 4 Apr 2023 09:06:16 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3EB62709 for ; Tue, 4 Apr 2023 06:06:15 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pjgMT-0005aV-Ku; Tue, 04 Apr 2023 15:06:09 +0200 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1pjgMR-0003hi-Fx; Tue, 04 Apr 2023 15:06:07 +0200 Date: Tue, 4 Apr 2023 15:06:07 +0200 From: Oleksij Rempel To: Vladimir Oltean Cc: "David S. Miller" , Andrew Lunn , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Woojung Huh , Arun Ramadoss , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com Subject: Re: [PATCH net-next v1 2/7] net: dsa: microchip: ksz8: Implement add/del_fdb and use static MAC table operations Message-ID: <20230404130607.GB4044@pengutronix.de> References: <20230404101842.1382986-1-o.rempel@pengutronix.de> <20230404101842.1382986-1-o.rempel@pengutronix.de> <20230404101842.1382986-3-o.rempel@pengutronix.de> <20230404101842.1382986-3-o.rempel@pengutronix.de> <20230404113124.nokweynmxtj3yqgt@skbuf> <20230404121911.GA4044@pengutronix.de> <20230404125002.dv2f4foojhy43dkx@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230404125002.dv2f4foojhy43dkx@skbuf> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 04, 2023 at 03:50:02PM +0300, Vladimir Oltean wrote: > On Tue, Apr 04, 2023 at 02:19:11PM +0200, Oleksij Rempel wrote: > > If I compare KSZ879CLX and KSZ8873MLL datasheets, i do not see direct > > answer. The only reason I can imagine is the size of static MAC table. > > All KSZ88xx and KSZ87xx variants have only 8 entries. One is already > > used for STP (even if STP is not enabled, can be optimized). If > > BRIDGE_VLAN compiled, each local address will be configured 2 times. > > So, depending on system configuration the static MAC table will full > > very soon. > > Yikes. KSZ8765 has num_statics = 8 and port_cnt = 5 (so 4 user ports I > assume). So if all 4 user ports had their own MAC address, it would > simply not be possible to put them under a VLAN-aware bridge, since that > would consume 2 BR_FDB_LOCAL entries for each port, so the static MAC > table would be full even without taking the bridge's MAC address into > consideration. > > Even with CONFIG_BRIDGE_VLAN_FILTERING turned off or with the bridge > option vlan_default_pvid = 0, this would still consume 4 BR_FDB_LOCAL > entries + one for the bridge's MAC address + 1 for STP, leaving only 2 > entries usable for *both* bridge fdb, *and* bridge mdb. > > I haven't opened the datasheets of these chips. Is it possible to use > the dynamic MAC table to store static(-ish) entries? According to KSZ8795CLX datasheet, dynamic MAC table is read-only. But there is Access Control Lists (ACL) with 16 entries. It is possible created a forwarding rule with match against DST MAC address. Beside, I'm working right now on KSZ9477 tc-flower support based on ACL implementation. Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |