Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6191988rwl; Wed, 22 Mar 2023 07:38:12 -0700 (PDT) X-Google-Smtp-Source: AK7set9AduB4d1Xs3eVY2rV/kuZd1sU5rMc4GA8S5Yg3kk9+NWvf/aG0Ry4It4RZVkk8M1l9qrEZ X-Received: by 2002:a62:18c1:0:b0:62a:443b:eb3 with SMTP id 184-20020a6218c1000000b0062a443b0eb3mr276851pfy.27.1679495891956; Wed, 22 Mar 2023 07:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679495891; cv=none; d=google.com; s=arc-20160816; b=l6Cd+OkUeSX8ofYUhG0dzPv99LcNI0CJejsgMT7fRduf3pYUEa0C9rjrVWarQJPFBE DOpzdrxdlJpt+QjYLXoOYQys44bMM6hYCw8/ghpVlp7uMBUwKABwEC489bZOKsbYZkdz Hd9hB3VSszH/qOqmQVpUWFKmo8UNvhDbSj8+Kk+0xWiw8/84dR7BJtT48cI0ZT3AINcp G/d7kX4XiNSUOQQauHvu3K2NnZ5HOw7Ug0fbDimQ+MbyBzWPQDMnRyoMXuMoQOwfTeeS eX7S+8vuUgLzGe/0AI1qw5s5zezTRFRwV1pPFfYgYRyL/pvL9sSjQyIuxIPTHUiyWVbV hlvg== 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=FuazTsxa2eFc7vknsBjwJbGZuins2/IAVF/8HGUBqPk=; b=qVadZsacjmDs+2YW5/5DrysF6FqE95opVQeldRXt368w8Qaz6nc6uTWW1gk2w8QBLP gvOkMnoP3OjsCTe7bK8r9tBsb8Tk0/gpbFcKgt9CGcDmtHYm2GM6eEDweO5QOZUzer9I W6ATtZ95nb2fs+bV52tTTC346TyEGc+49b/+YuBFVOeDMSR880/HIHOWUQJtZyzNOPvh p/rvFoMHecZ+yPEEbkfpEUy6DFpKnL9kLBWtc8hoke1Mg4UOz0HYwEH+ylBogmTIlUU8 nVQ4jHBYoRwX4rbPNtcwuU/xk7Cj/2hTgw1WLyGVxU3q85fWA+7xkmNl+qdrMg2PybPg rYrQ== 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 d32-20020a631d60000000b0050be758e45fsi15662211pgm.554.2023.03.22.07.38.00; Wed, 22 Mar 2023 07:38:11 -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 S231530AbjCVObt (ORCPT + 99 others); Wed, 22 Mar 2023 10:31:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231146AbjCVObq (ORCPT ); Wed, 22 Mar 2023 10:31:46 -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 9DB5F62B4C for ; Wed, 22 Mar 2023 07:31:44 -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 1pezV1-0003Oo-Ay; Wed, 22 Mar 2023 15:31:35 +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 1pezUx-005wW3-ST; Wed, 22 Mar 2023 15:31:31 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pezUx-0060Zc-2B; Wed, 22 Mar 2023 15:31:31 +0100 From: Oleksij Rempel To: "David S. Miller" , Andrew Lunn , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , Woojung Huh Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com Subject: [PATCH net v1 1/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() Date: Wed, 22 Mar 2023 15:31:25 +0100 Message-Id: <20230322143130.1432106-2-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230322143130.1432106-1-o.rempel@pengutronix.de> References: <20230322143130.1432106-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 Before this patch, the ksz8_fdb_dump() function had several issues, such as uninitialized variables and incorrect usage of source port as a bit mask. These problems caused inaccurate reporting of vid information and port assignment in the bridge fdb. Fixes: e587be759e6e ("net: dsa: microchip: update fdb add/del/dump in ksz_common") Signed-off-by: Oleksij Rempel --- drivers/net/dsa/microchip/ksz8795.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c index 003b0ac2854c..3fffd5da8d3b 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -958,15 +958,14 @@ int ksz8_fdb_dump(struct ksz_device *dev, int port, u16 entries = 0; u8 timestamp = 0; u8 fid; - u8 member; - struct alu_struct alu; + u8 src_port; + u8 mac[ETH_ALEN]; do { - alu.is_static = false; - ret = ksz8_r_dyn_mac_table(dev, i, alu.mac, &fid, &member, + ret = ksz8_r_dyn_mac_table(dev, i, mac, &fid, &src_port, ×tamp, &entries); - if (!ret && (member & BIT(port))) { - ret = cb(alu.mac, alu.fid, alu.is_static, data); + if (!ret && port == src_port) { + ret = cb(mac, fid, false, data); if (ret) break; } -- 2.30.2