Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14718446rwb; Mon, 28 Nov 2022 04:21:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Pp2MtYHp4H1BKxzzXvo7Sr04w8MvgdR52sIvpH36aqIXjGDUVYWxR3wfuYONUGv1uYyo3 X-Received: by 2002:a17:906:1dc3:b0:7ad:bbcc:814 with SMTP id v3-20020a1709061dc300b007adbbcc0814mr43355739ejh.425.1669638115673; Mon, 28 Nov 2022 04:21:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669638115; cv=none; d=google.com; s=arc-20160816; b=VpJH/gi1rpw600IU93n4QlrT9BkaYL4hkuZMo3upvnYoWe+fn6dtapspKkOMCZb7oo ZJT5oS9/qVIF/nYh03g2TrEN67GYU+O19qJsa6rMS/Is0cOTuQTOxrIC17f8X5aCeIaV +m8Tm7Y7ytXroB9oEhPhCjRB10fH5jt6CF2iFwf3/8TytsXNHFmQ67HDi54EhSekdUwl P6vvPuct6tcytFbBQ9hSMd2NK2oBsBsANPc9f9Tph4yYA8ve6EBdk4WSZ/BAz8XtHsbP YeMDHe3r4A7IVnkHZ7zvZGaiWVe1K4GCDMXiH/lij2GxTyC4GGMPQLOTbmqK5nm1anC6 WJkA== 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=Zjfuvp4zTUzsA212Ez7/Nag/v0OM+t04V+aBUiiZKy6C5Rp46HJ2cABiI9saq6AFZM /dMtcYxIQ51nl2p7XxmKzZW41aJCvLExisNzhP9hwyaqO9ZMeaXOGEo2B7in46FEnOth Fq8OlMRNsni3xjdshoHGg2Z5moYnktONcH2znjDcd9ezMdXWVSwD4nlsb1E/0rPLZQSk U0Ljg2SaEOkoMq5lwqMmr2Wvm3dqMNO8JOVegKpvzHoBuV2bNOr/rCcmW7YiSMqE0CFz wWR1kNHqbAX3gbLZe4iD69ymjjBP3qVcH6i9EA7wbDYDewCPQfqaJ7weBMKkU/ioKqtp 8LKg== 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 h11-20020a05640250cb00b0046a642710cesi11262253edb.254.2022.11.28.04.21.36; Mon, 28 Nov 2022 04:21:55 -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 S231584AbiK1MBP (ORCPT + 84 others); Mon, 28 Nov 2022 07:01:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231357AbiK1MAQ (ORCPT ); Mon, 28 Nov 2022 07:00:16 -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 713A118B24 for ; Mon, 28 Nov 2022 04:00:14 -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 ) id 1ozcnt-0003rf-NS; Mon, 28 Nov 2022 13:00:05 +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 1ozcnr-000o9n-Rw; Mon, 28 Nov 2022 13:00:04 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1ozcnn-00Gzct-Nq; Mon, 28 Nov 2022 12:59:59 +0100 From: Oleksij Rempel To: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Oleksij Rempel , 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 12:59:35 +0100 Message-Id: <20221128115958.4049431-4-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221128115958.4049431-1-o.rempel@pengutronix.de> References: <20221128115958.4049431-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: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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, -- 2.30.2