[PATCH 1/6] realtek: fix writing/deletion of CAM entries

Jan Hoffmann jan at 3e8.eu
Fri Mar 3 13:48:41 PST 2023


Actually use the index returned by rtl83xx_find_l2_cam_entry.

Fixes: cde31976e375 ("realtek: Add support for Layer 2 Multicast")
Signed-off-by: Jan Hoffmann <jan at 3e8.eu>
---
 .../realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c      | 8 ++++----
 .../realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c      | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c
index 63461ff57348..fee63c36faa1 100644
--- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c
+++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c
@@ -1662,7 +1662,7 @@ static int rtl83xx_port_fdb_add(struct dsa_switch *ds, int port,
 	}
 
 	// Hash buckets full, try CAM
-	rtl83xx_find_l2_cam_entry(priv, seed, false, &e);
+	idx = rtl83xx_find_l2_cam_entry(priv, seed, false, &e);
 
 	if (idx >= 0) {
 		rtl83xx_setup_l2_uc_entry(&e, port, vid, mac);
@@ -1698,7 +1698,7 @@ static int rtl83xx_port_fdb_del(struct dsa_switch *ds, int port,
 	}
 
 	/* Check CAM for spillover from hash buckets */
-	rtl83xx_find_l2_cam_entry(priv, seed, true, &e);
+	idx = rtl83xx_find_l2_cam_entry(priv, seed, true, &e);
 
 	if (idx >= 0) {
 		e.valid = false;
@@ -1800,7 +1800,7 @@ static void rtl83xx_port_mdb_add(struct dsa_switch *ds, int port,
 	}
 
 	// Hash buckets full, try CAM
-	rtl83xx_find_l2_cam_entry(priv, seed, false, &e);
+	idx = rtl83xx_find_l2_cam_entry(priv, seed, false, &e);
 
 	if (idx >= 0) {
 		if (e.valid) {
@@ -1860,7 +1860,7 @@ int rtl83xx_port_mdb_del(struct dsa_switch *ds, int port,
 	}
 
 	/* Check CAM for spillover from hash buckets */
-	rtl83xx_find_l2_cam_entry(priv, seed, true, &e);
+	idx = rtl83xx_find_l2_cam_entry(priv, seed, true, &e);
 
 	if (idx >= 0) {
 		portmask = rtl83xx_mc_group_del_port(priv, e.mc_portmask_index, port);
diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c
index 83a0441ce27c..f9980ccacee1 100644
--- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c
+++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c
@@ -1642,7 +1642,7 @@ static int rtl83xx_port_fdb_add(struct dsa_switch *ds, int port,
 	}
 
 	/* Hash buckets full, try CAM */
-	rtl83xx_find_l2_cam_entry(priv, seed, false, &e);
+	idx = rtl83xx_find_l2_cam_entry(priv, seed, false, &e);
 
 	if (idx >= 0) {
 		rtl83xx_setup_l2_uc_entry(&e, port, vid, mac);
@@ -1680,7 +1680,7 @@ static int rtl83xx_port_fdb_del(struct dsa_switch *ds, int port,
 	}
 
 	/* Check CAM for spillover from hash buckets */
-	rtl83xx_find_l2_cam_entry(priv, seed, true, &e);
+	idx = rtl83xx_find_l2_cam_entry(priv, seed, true, &e);
 
 	if (idx >= 0) {
 		e.valid = false;
@@ -1776,7 +1776,7 @@ static int rtl83xx_port_mdb_add(struct dsa_switch *ds, int port,
 	}
 
 	/* Hash buckets full, try CAM */
-	rtl83xx_find_l2_cam_entry(priv, seed, false, &e);
+	idx = rtl83xx_find_l2_cam_entry(priv, seed, false, &e);
 
 	if (idx >= 0) {
 		if (e.valid) {
@@ -1839,7 +1839,7 @@ int rtl83xx_port_mdb_del(struct dsa_switch *ds, int port,
 	}
 
 	/* Check CAM for spillover from hash buckets */
-	rtl83xx_find_l2_cam_entry(priv, seed, true, &e);
+	idx = rtl83xx_find_l2_cam_entry(priv, seed, true, &e);
 
 	if (idx >= 0) {
 		portmask = rtl83xx_mc_group_del_port(priv, e.mc_portmask_index, port);
-- 
2.39.1




More information about the openwrt-devel mailing list