From nobody Mon Apr 13 08:06:38 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61AD1C77B62 for ; Fri, 24 Mar 2023 08:07:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231807AbjCXIGo (ORCPT ); Fri, 24 Mar 2023 04:06:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbjCXIGW (ORCPT ); Fri, 24 Mar 2023 04:06:22 -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 F39172386D for ; Fri, 24 Mar 2023 01:06:20 -0700 (PDT) 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 ) id 1pfcRB-00077V-IU; Fri, 24 Mar 2023 09:06:13 +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 ) id 1pfcR9-006Kcb-M1; Fri, 24 Mar 2023 09:06:11 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pfcR7-00ENz7-Hc; Fri, 24 Mar 2023 09:06:09 +0100 From: Oleksij Rempel To: "David S. Miller" , Andrew Lunn , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , Woojung Huh , Arun Ramadoss Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com Subject: [PATCH net v2 2/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() to extract all 1024 entries Date: Fri, 24 Mar 2023 09:06:04 +0100 Message-Id: <20230324080608.3428714-3-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230324080608.3428714-1-o.rempel@pengutronix.de> References: <20230324080608.3428714-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Current ksz8_fdb_dump() is able to extract only max 249 entries on the ksz8863/ksz8873 series of switches. This happened due to wrong bit mask and offset calculation. This commit corrects the issue and allows for the complete extraction of all 1024 entries. Fixes: 4b20a07e103f ("net: dsa: microchip: ksz8795: add support for ksz88xx= chips") Signed-off-by: Oleksij Rempel Acked-by: Arun Ramadoss Reviewed-by: Florian Fainelli --- 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/micro= chip/ksz_common.c index 7fc2155d93d6..3a1afc9f4621 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -407,10 +407,10 @@ static const u32 ksz8863_masks[] =3D { [STATIC_MAC_TABLE_FID] =3D GENMASK(29, 26), [STATIC_MAC_TABLE_OVERRIDE] =3D BIT(20), [STATIC_MAC_TABLE_FWD_PORTS] =3D GENMASK(18, 16), - [DYNAMIC_MAC_TABLE_ENTRIES_H] =3D GENMASK(5, 0), + [DYNAMIC_MAC_TABLE_ENTRIES_H] =3D GENMASK(1, 0), [DYNAMIC_MAC_TABLE_MAC_EMPTY] =3D BIT(7), [DYNAMIC_MAC_TABLE_NOT_READY] =3D BIT(7), - [DYNAMIC_MAC_TABLE_ENTRIES] =3D GENMASK(31, 28), + [DYNAMIC_MAC_TABLE_ENTRIES] =3D GENMASK(31, 24), [DYNAMIC_MAC_TABLE_FID] =3D GENMASK(19, 16), [DYNAMIC_MAC_TABLE_SRC_PORT] =3D GENMASK(21, 20), [DYNAMIC_MAC_TABLE_TIMESTAMP] =3D GENMASK(23, 22), @@ -420,7 +420,7 @@ static u8 ksz8863_shifts[] =3D { [VLAN_TABLE_MEMBERSHIP_S] =3D 16, [STATIC_MAC_FWD_PORTS] =3D 16, [STATIC_MAC_FID] =3D 22, - [DYNAMIC_MAC_ENTRIES_H] =3D 3, + [DYNAMIC_MAC_ENTRIES_H] =3D 8, [DYNAMIC_MAC_ENTRIES] =3D 24, [DYNAMIC_MAC_FID] =3D 16, [DYNAMIC_MAC_TIMESTAMP] =3D 24, --=20 2.30.2