Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp758674rwl; Fri, 24 Mar 2023 01:19:01 -0700 (PDT) X-Google-Smtp-Source: AK7set/elk7Tv+L/vumZQu1L4T7rLzqVVb0FcH+z6ODA3ikbltThSFoiVgDABvifZeg8osDLjrKX X-Received: by 2002:a05:6a20:6589:b0:d9:3440:9a26 with SMTP id p9-20020a056a20658900b000d934409a26mr2321251pzh.20.1679645940853; Fri, 24 Mar 2023 01:19:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679645940; cv=none; d=google.com; s=arc-20160816; b=aPgEPcF1P/ZH434r6NpZ/Vxy87GhtZbANgY+LLPquLoEwjlfA+WjRGgYdDiAxsZ3da uL1CXDvqXb3IPJAE2G+nBnrazU2EvoyrZnoEKTuFrbSOkcM9ObAgyJp2Vl6G/ARIq7qa qgSWpZdx2IwmNhrnk9OosF7SqjibrypVObJd6PbI0OmBqEnKM4LVnq17+lWeepKHJBUt V7Oc0u4x2i25QN5KHPjz2rZu01lDnZcKTcgPUw4Sn5MMcyvtTmywFOKoquERA+Ge0XJP aoVg+bzjoCqpBfydP0jq88aaLtaVMCBtzgWywGRosMYxMQm9X/+jOobxieTnOqd6HBb3 VPxw== 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=xZOrNF4/E99RgicJEWZut4ApkDuqRiNaLQtYhE8GyMY=; b=TXL75hs6/qUVInZeGhi3FJsCdaGymHR34BjmCF8h+aFqsrC7J6gaeCbClj1YjxIJuN CUBDSD16idLDRKu2stvgOpyM9deEvunW+AaO4hARbsGlDwI07UB++TtZkvdNd10lfhsy YOBOTIyeVJEZgBUP8MIVr9RiuIJRUZvbbr6dvqEdXuvFxG+oO3nhil+p0vBwit9dNwoq 8q6tbQC/KS4ujw3FpA9eVe3sRA9rgs7Lhg5QhOHVqXHvJZAfavb2j+ORKjqc7XTZKe1l irMdayoo4gmjRGH/S9YQ2u75Y2hHG02iYvCWNNqkDW+jpbc/ENrhcsNGuCv8OIEJFWBd Ivzg== 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 34-20020a630b22000000b0050bf219bfd7si21000360pgl.236.2023.03.24.01.18.49; Fri, 24 Mar 2023 01:19:00 -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 S231738AbjCXIGn (ORCPT + 99 others); Fri, 24 Mar 2023 04:06:43 -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: 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=-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 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 --- 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 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[] = { [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), @@ -420,7 +420,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, -- 2.30.2