“2d8a59b3a55342fcdf32c85e25f3e3c10cab834a”上不存在“...channels/git@gitcode.net:openanolis/dragonwell8_jdk.git”
提交 2cc193eb 编写于 作者: R Rakesh Sankaranarayanan 提交者: sanglipeng

net: dsa: microchip: ksz9477: port map correction in ALU table entry register

stable inclusion
from stable-v5.10.166
commit a84240df70793d53d43ba8569e399500712c3651
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7TH9O

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a84240df70793d53d43ba8569e399500712c3651

--------------------------------

[ Upstream commit 6c977c5c ]

ALU table entry 2 register in KSZ9477 have bit positions reserved for
forwarding port map. This field is referred in ksz9477_fdb_del() for
clearing forward port map and alu table.

But current fdb_del refer ALU table entry 3 register for accessing forward
port map. Update ksz9477_fdb_del() to get forward port map from correct
alu table entry register.

With this bug, issue can be observed while deleting static MAC entries.
Delete any specific MAC entry using "bridge fdb del" command. This should
clear all the specified MAC entries. But it is observed that entries with
self static alone are retained.

Tested on LAN9370 EVB since ksz9477_fdb_del() is used common across
LAN937x and KSZ series.

Fixes: b987e98e ("dsa: add DSA switch driver for Microchip KSZ9477")
Signed-off-by: NRakesh Sankaranarayanan <rakesh.sankaranarayanan@microchip.com>
Reviewed-by: NVladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20230118174735.702377-1-rakesh.sankaranarayanan@microchip.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
上级 469c1d65
...@@ -678,10 +678,10 @@ static int ksz9477_port_fdb_del(struct dsa_switch *ds, int port, ...@@ -678,10 +678,10 @@ static int ksz9477_port_fdb_del(struct dsa_switch *ds, int port,
ksz_read32(dev, REG_SW_ALU_VAL_D, &alu_table[3]); ksz_read32(dev, REG_SW_ALU_VAL_D, &alu_table[3]);
/* clear forwarding port */ /* clear forwarding port */
alu_table[2] &= ~BIT(port); alu_table[1] &= ~BIT(port);
/* if there is no port to forward, clear table */ /* if there is no port to forward, clear table */
if ((alu_table[2] & ALU_V_PORT_MAP) == 0) { if ((alu_table[1] & ALU_V_PORT_MAP) == 0) {
alu_table[0] = 0; alu_table[0] = 0;
alu_table[1] = 0; alu_table[1] = 0;
alu_table[2] = 0; alu_table[2] = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册