Re: [PATCH v6 net-next 8/9] net: dsa: mv88e6xxx: add blackhole ATU entries

From: netdev
Date: Thu Oct 06 2022 - 08:24:26 EST


On 2022-09-28 17:02, Hans Schultz wrote:
From: "Hans J. Schultz" <netdev@xxxxxxxxxxxxxxxxxxxx>

Blackhole FDB entries can now be added, deleted or replaced in the
driver ATU.

Signed-off-by: Hans J. Schultz <netdev@xxxxxxxxxxxxxxxxxxxx>
---
drivers/net/dsa/mv88e6xxx/chip.c | 78 ++++++++++++++++++++++++++++++--
1 file changed, 74 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 71843fe87f77..a17f30e5d4a6 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2735,6 +2735,72 @@ static int mv88e6xxx_vlan_msti_set(struct dsa_switch *ds,
return err;
}

+struct mv88e6xxx_vid_search_ctx {
+ u16 vid_search;
+ u16 fid_found;
+};
+
+static int mv88e6xxx_find_fid_on_matching_vid(struct mv88e6xxx_chip *chip,
+ const struct mv88e6xxx_vtu_entry *entry,
+ void *priv)
+{
+ struct mv88e6xxx_vid_search_ctx *ctx = priv;
+

FYI: I have already made updates to this part to use mv88e6xxx_vtu_get() instead of the walk, which also fixes a problem when vid=0 in this implementation.