[v1,03/26] net: dsa: microchip: ksz8: ksz8_fdb_dump: fix not complete fdb extraction
Message ID | 20221128120034.4075562-4-o.rempel@pengutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5610300wrr; Mon, 28 Nov 2022 04:04:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf61XNmzDETHOKqMd51lMmBi9pNcWh5cOlrJYxUHKYdIzYU8PRzeT/GkPH+TMb8ZYaPlxqaH X-Received: by 2002:a63:2361:0:b0:45f:f8df:108e with SMTP id u33-20020a632361000000b0045ff8df108emr26283362pgm.127.1669637082501; Mon, 28 Nov 2022 04:04:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669637082; cv=none; d=google.com; s=arc-20160816; b=pN9Qz61niraKYlfu5zcZfGfyhCW2znqxTzk1FPSO87DxkeA6eY2haK0+Xu1U5BwxkA S3O0qHtE9upar+mFTqiZ4v6o9Yn3o6aDCK1eyebNVOOMr4rpVIoDI05LYo7PUp0IvF9X IDgzWgdjRGcpequ2m6i0kfGL4lR17v+Hcts0rPwPBHvaeDtJERbCvuXpkfacpRjTTc8r wkh2M68b0iV6expt2r0SvFHnN0v3PXPk+uu0jGsq6DKwr2YBx9/qdfU+Nmp0rh7PFf/b Ux5Sp2ROSR9kIAiB7nddex6IdCbqU0gZKm5gZ3VXDdk+JGPTVrmKphFOUxyBNLOeAv9j 1nhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=MAYrSar+Nizyi1MeNokHxCy5tEfQHhGXL1AXOLemQw8=; b=OnvikJfEeEkOXdU6U9GWTk4IKGqzs2IABJJUxrfGViiABrlfE/l7RFj+EYxbDChi56 YET2Ufg/xwhF+GYmFHt7MaIQiPTzg/rGu+qSpw0Yp07ex4kpS+6aU5yRco8+1YOdxWDg 3TAORUTayUhl1+4naYrXGklHTJc1gh8sCV5flafUFDO70Z0yaeFURp1LzwdsPI3+6n3V h3JCRoVrULYmEa9GCP42neDcyI5fJJ55Oug0kgYZZqGPnWaETFMc9Rs3uBm5rn+p2xLq 2uQqhGCE5w7I/PbTJ+tW8Azez7ULcTuO6cRjFHf9e17L9nRVUls9N5R4bezndk/CU4Nx 7y8Q== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d8-20020aa78e48000000b005633766252asi10139053pfr.313.2022.11.28.04.04.26; Mon, 28 Nov 2022 04:04:42 -0800 (PST) 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 S231708AbiK1MD2 (ORCPT <rfc822;gah0developer@gmail.com> + 99 others); Mon, 28 Nov 2022 07:03:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231492AbiK1MAq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 28 Nov 2022 07:00:46 -0500 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 D74E31A04E for <linux-kernel@vger.kernel.org>; Mon, 28 Nov 2022 04:00:45 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <ore@pengutronix.de>) id 1ozcoR-0005Hi-4h; Mon, 28 Nov 2022 13:00:39 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from <ore@pengutronix.de>) id 1ozcoP-000oB3-GF; Mon, 28 Nov 2022 13:00:38 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from <ore@pengutronix.de>) id 1ozcoN-00H6MF-4s; Mon, 28 Nov 2022 13:00:35 +0100 From: Oleksij Rempel <o.rempel@pengutronix.de> To: Woojung Huh <woojung.huh@microchip.com>, UNGLinuxDriver@microchip.com, Andrew Lunn <andrew@lunn.ch>, Vivien Didelot <vivien.didelot@gmail.com>, Florian Fainelli <f.fainelli@gmail.com>, Vladimir Oltean <olteanv@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: Oleksij Rempel <o.rempel@pengutronix.de>, kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Arun.Ramadoss@microchip.com Subject: [PATCH v1 03/26] net: dsa: microchip: ksz8: ksz8_fdb_dump: fix not complete fdb extraction Date: Mon, 28 Nov 2022 13:00:11 +0100 Message-Id: <20221128120034.4075562-4-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221128120034.4075562-1-o.rempel@pengutronix.de> References: <20221128120034.4075562-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 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=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750741373214058174?= X-GMAIL-MSGID: =?utf-8?q?1750741373214058174?= |
Series |
net: dsa: microchip: stats64, fdb, error
|
|
Commit Message
Oleksij Rempel
Nov. 28, 2022, noon UTC
Current ksz8_fdb_dump() is able to extract max 249 entries on
the ksz8863/ksz8873 series of switches. This happened due to wrong
bit mask and offset calculation.
With this patch, we will be able to extract all possible 1024 entries.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
drivers/net/dsa/microchip/ksz_common.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index 423f944cc34c..43d94131417b 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -398,10 +398,10 @@ static const u32 ksz8863_masks[] = { [STATIC_MAC_TABLE_FID] = GENMASK(29, 26), [STATIC_MAC_TABLE_OVERRIDE] = BIT(20), [STATIC_MAC_TABLE_FWD_PORTS] = GENMASK(18, 16), - [DYNAMIC_MAC_TABLE_ENTRIES_H] = GENMASK(5, 0), + [DYNAMIC_MAC_TABLE_ENTRIES_H] = GENMASK(1, 0), [DYNAMIC_MAC_TABLE_MAC_EMPTY] = BIT(7), [DYNAMIC_MAC_TABLE_NOT_READY] = BIT(7), - [DYNAMIC_MAC_TABLE_ENTRIES] = GENMASK(31, 28), + [DYNAMIC_MAC_TABLE_ENTRIES] = GENMASK(31, 24), [DYNAMIC_MAC_TABLE_FID] = GENMASK(19, 16), [DYNAMIC_MAC_TABLE_SRC_PORT] = GENMASK(21, 20), [DYNAMIC_MAC_TABLE_TIMESTAMP] = GENMASK(23, 22), @@ -411,7 +411,7 @@ static u8 ksz8863_shifts[] = { [VLAN_TABLE_MEMBERSHIP_S] = 16, [STATIC_MAC_FWD_PORTS] = 16, [STATIC_MAC_FID] = 22, - [DYNAMIC_MAC_ENTRIES_H] = 3, + [DYNAMIC_MAC_ENTRIES_H] = 8, [DYNAMIC_MAC_ENTRIES] = 24, [DYNAMIC_MAC_FID] = 16, [DYNAMIC_MAC_TIMESTAMP] = 24,