[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221128115958.4049431-12-o.rempel@pengutronix.de>
Date: Mon, 28 Nov 2022 12:59:43 +0100
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: Woojung Huh <woojung.huh@...rochip.com>,
UNGLinuxDriver@...rochip.com, Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: Oleksij Rempel <o.rempel@...gutronix.de>, kernel@...gutronix.de,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Arun.Ramadoss@...rochip.com
Subject: [PATCH v1 11/26] net: dsa: microchip: ksz8: ksz8_fdb_dump: dump static MAC table
Extend fdb_dump with static MAC table dump.
Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
---
drivers/net/dsa/microchip/ksz8795.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
index 308b46bb2ce5..392f6cb1f706 100644
--- a/drivers/net/dsa/microchip/ksz8795.c
+++ b/drivers/net/dsa/microchip/ksz8795.c
@@ -952,6 +952,23 @@ int ksz8_fdb_dump(struct ksz_device *dev, int port,
u16 i, entries = 0;
int ret;
+ for (i = 0; i < dev->info->num_statics; i++) {
+ struct alu_struct alu;
+
+ ret = ksz8_r_sta_mac_table(dev, i, &alu);
+ if (ret == -ENXIO)
+ continue;
+ if (ret)
+ return ret;
+
+ if (!(alu.port_forward & BIT(port)))
+ continue;
+
+ ret = cb(alu.mac, 0, true, data);
+ if (ret)
+ return ret;
+ }
+
for (i = 0; i < KSZ8_DYN_MAC_ENTRIES; i++) {
u8 mac[ETH_ALEN];
u8 src_port;
--
2.30.2
Powered by blists - more mailing lists