linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net v3] net: dsa: microchip: ksz9477: fix fdb_dump last invalid entry
@ 2022-08-16 10:55 Arun Ramadoss
  2022-08-16 18:48 ` Vladimir Oltean
  2022-08-17 19:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Arun Ramadoss @ 2022-08-16 10:55 UTC (permalink / raw)
  To: linux-kernel, netdev
  Cc: Woojung Huh, UNGLinuxDriver, Andrew Lunn, Vivien Didelot,
	Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Russell King, Tristram Ha

In the ksz9477_fdb_dump function it reads the ALU control register and
exit from the timeout loop if there is valid entry or search is
complete. After exiting the loop, it reads the alu entry and report to
the user space irrespective of entry is valid. It works till the valid
entry. If the loop exited when search is complete, it reads the alu
table. The table returns all ones and it is reported to user space. So
bridge fdb show gives ff:ff:ff:ff:ff:ff as last entry for every port.
To fix it, after exiting the loop the entry is reported only if it is
valid one.

Fixes: b987e98e50ab ("dsa: add DSA switch driver for Microchip KSZ9477")
Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
---
changes in v3
- changed the subject from net-next to net

changes in v2
- changed the fixes commit id
- reduced the indentation level by using ! and continue statement

 drivers/net/dsa/microchip/ksz9477.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c
index 4b14d80d27ed..e4f446db0ca1 100644
--- a/drivers/net/dsa/microchip/ksz9477.c
+++ b/drivers/net/dsa/microchip/ksz9477.c
@@ -613,6 +613,9 @@ int ksz9477_fdb_dump(struct ksz_device *dev, int port,
 			goto exit;
 		}
 
+		if (!(ksz_data & ALU_VALID))
+			continue;
+
 		/* read ALU table */
 		ksz9477_read_table(dev, alu_table);
 

base-commit: 7ebfc85e2cd7b08f518b526173e9a33b56b3913b
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch net v3] net: dsa: microchip: ksz9477: fix fdb_dump last invalid entry
  2022-08-16 10:55 [patch net v3] net: dsa: microchip: ksz9477: fix fdb_dump last invalid entry Arun Ramadoss
@ 2022-08-16 18:48 ` Vladimir Oltean
  2022-08-17 19:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Oltean @ 2022-08-16 18:48 UTC (permalink / raw)
  To: Arun Ramadoss
  Cc: linux-kernel, netdev, Woojung Huh, UNGLinuxDriver, Andrew Lunn,
	Vivien Didelot, Florian Fainelli, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Russell King, Tristram Ha

On Tue, Aug 16, 2022 at 04:25:16PM +0530, Arun Ramadoss wrote:
> In the ksz9477_fdb_dump function it reads the ALU control register and
> exit from the timeout loop if there is valid entry or search is
> complete. After exiting the loop, it reads the alu entry and report to
> the user space irrespective of entry is valid. It works till the valid
> entry. If the loop exited when search is complete, it reads the alu
> table. The table returns all ones and it is reported to user space. So
> bridge fdb show gives ff:ff:ff:ff:ff:ff as last entry for every port.
> To fix it, after exiting the loop the entry is reported only if it is
> valid one.
> 
> Fixes: b987e98e50ab ("dsa: add DSA switch driver for Microchip KSZ9477")
> Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
> ---

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch net v3] net: dsa: microchip: ksz9477: fix fdb_dump last invalid entry
  2022-08-16 10:55 [patch net v3] net: dsa: microchip: ksz9477: fix fdb_dump last invalid entry Arun Ramadoss
  2022-08-16 18:48 ` Vladimir Oltean
@ 2022-08-17 19:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-08-17 19:20 UTC (permalink / raw)
  To: Arun Ramadoss
  Cc: linux-kernel, netdev, woojung.huh, UNGLinuxDriver, andrew,
	vivien.didelot, f.fainelli, olteanv, davem, edumazet, kuba,
	pabeni, linux, Tristram.Ha

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 16 Aug 2022 16:25:16 +0530 you wrote:
> In the ksz9477_fdb_dump function it reads the ALU control register and
> exit from the timeout loop if there is valid entry or search is
> complete. After exiting the loop, it reads the alu entry and report to
> the user space irrespective of entry is valid. It works till the valid
> entry. If the loop exited when search is complete, it reads the alu
> table. The table returns all ones and it is reported to user space. So
> bridge fdb show gives ff:ff:ff:ff:ff:ff as last entry for every port.
> To fix it, after exiting the loop the entry is reported only if it is
> valid one.
> 
> [...]

Here is the summary with links:
  - [net,v3] net: dsa: microchip: ksz9477: fix fdb_dump last invalid entry
    https://git.kernel.org/netdev/net/c/36c0d9350157

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-17 19:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-16 10:55 [patch net v3] net: dsa: microchip: ksz9477: fix fdb_dump last invalid entry Arun Ramadoss
2022-08-16 18:48 ` Vladimir Oltean
2022-08-17 19:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).