net: dsa: microchip: ksz8: Implement add/del_fdb and use static MAC table operations
authorOleksij Rempel <o.rempel@pengutronix.de>
Tue, 4 Apr 2023 10:18:37 +0000 (12:18 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 6 Apr 2023 09:34:45 +0000 (11:34 +0200)
Add support for add/del_fdb operations and utilize the refactored static
MAC table code. This resolves kernel warnings caused by the lack of fdb
add function support in the current driver.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/dsa/microchip/ksz8.h
drivers/net/dsa/microchip/ksz8795.c
drivers/net/dsa/microchip/ksz_common.c

index ea05abfbd51d648624489782f054b429025c2b75..4d4552ac2792b4b43a57d38a980ae281ad1cf1b4 100644 (file)
@@ -32,6 +32,10 @@ void ksz8_freeze_mib(struct ksz_device *dev, int port, bool freeze);
 void ksz8_port_init_cnt(struct ksz_device *dev, int port);
 int ksz8_fdb_dump(struct ksz_device *dev, int port,
                  dsa_fdb_dump_cb_t *cb, void *data);
+int ksz8_fdb_add(struct ksz_device *dev, int port, const unsigned char *addr,
+                u16 vid, struct dsa_db db);
+int ksz8_fdb_del(struct ksz_device *dev, int port, const unsigned char *addr,
+                u16 vid, struct dsa_db db);
 int ksz8_mdb_add(struct ksz_device *dev, int port,
                 const struct switchdev_obj_port_mdb *mdb, struct dsa_db db);
 int ksz8_mdb_del(struct ksz_device *dev, int port,
index e47d08cf3f26d7f7ee2eac92c732ff6de34ba7f5..7143e90bf35ffc918e78875202a9e4b4ab10e034 100644 (file)
@@ -1061,6 +1061,18 @@ int ksz8_mdb_del(struct ksz_device *dev, int port,
        return ksz8_del_sta_mac(dev, port, mdb->addr, mdb->vid);
 }
 
+int ksz8_fdb_add(struct ksz_device *dev, int port, const unsigned char *addr,
+                u16 vid, struct dsa_db db)
+{
+       return ksz8_add_sta_mac(dev, port, addr, vid);
+}
+
+int ksz8_fdb_del(struct ksz_device *dev, int port, const unsigned char *addr,
+                u16 vid, struct dsa_db db)
+{
+       return ksz8_del_sta_mac(dev, port, addr, vid);
+}
+
 int ksz8_port_vlan_filtering(struct ksz_device *dev, int port, bool flag,
                             struct netlink_ext_ack *extack)
 {
index 5568d7b22135b32c34b6477cbf1aac7acc09f069..a4428be5f483ca1587229f8e4c36d6a6dd276892 100644 (file)
@@ -200,6 +200,8 @@ static const struct ksz_dev_ops ksz8_dev_ops = {
        .freeze_mib = ksz8_freeze_mib,
        .port_init_cnt = ksz8_port_init_cnt,
        .fdb_dump = ksz8_fdb_dump,
+       .fdb_add = ksz8_fdb_add,
+       .fdb_del = ksz8_fdb_del,
        .mdb_add = ksz8_mdb_add,
        .mdb_del = ksz8_mdb_del,
        .vlan_filtering = ksz8_port_vlan_filtering,