diff mbox series

[net] net: mscc: ocelot: populate the entry type in ocelot_mact_read

Message ID 20201026112257.1371229-1-vladimir.oltean@nxp.com
State New
Headers show
Series [net] net: mscc: ocelot: populate the entry type in ocelot_mact_read | expand

Commit Message

Vladimir Oltean Oct. 26, 2020, 11:22 a.m. UTC
Currently this boolean in ocelot_fdb_dump will always be set to false:

is_static = (entry.type == ENTRYTYPE_LOCKED);

Fix it by ensuring the entry type is always read from hardware.

Fixes: 64bfb05b74ad ("net: mscc: ocelot: break out fdb operations into abstract implementations")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/ethernet/mscc/ocelot.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jakub Kicinski Oct. 26, 2020, 6:51 p.m. UTC | #1
On Mon, 26 Oct 2020 13:22:57 +0200 Vladimir Oltean wrote:
> Currently this boolean in ocelot_fdb_dump will always be set to false:

> 

> is_static = (entry.type == ENTRYTYPE_LOCKED);

> 

> Fix it by ensuring the entry type is always read from hardware.

> 

> Fixes: 64bfb05b74ad ("net: mscc: ocelot: break out fdb operations into abstract implementations")

> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>


Fixes tag: Fixes: 64bfb05b74ad ("net: mscc: ocelot: break out fdb operations into abstract implementations")
Has these problem(s):
	- Target SHA1 does not exist
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index 70bf8c67d7ef..860cd2390670 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -647,6 +647,8 @@  static int ocelot_mact_read(struct ocelot *ocelot, int port, int row, int col,
 	if (dst != port)
 		return -EINVAL;
 
+	entry->type = ANA_TABLES_MACACCESS_ENTRYTYPE_X(val);
+
 	/* Get the entry's MAC address and VLAN id */
 	macl = ocelot_read(ocelot, ANA_TABLES_MACLDATA);
 	mach = ocelot_read(ocelot, ANA_TABLES_MACHDATA);