diff options
author | Horatiu Vultur <horatiu.vultur@microchip.com> | 2022-01-04 16:33:38 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-01-05 11:25:13 +0000 |
commit | 7aacb894b1adf8b0f46e6370417350a6bac20c55 (patch) | |
tree | 371e23bb2c51584b2fc93f9e45f534d531055bb1 /drivers/net/ethernet/microchip/lan966x/lan966x_main.h | |
parent | 11b0a27772f5ea294816aabe0f47892ef9b8e65b (diff) |
net: lan966x: Extend switchdev with mdb support
Extend lan966x driver with mdb support by implementing the switchdev
calls: SWITCHDEV_OBJ_ID_PORT_MDB and SWITCHDEV_OBJ_ID_HOST_MDB.
It is allowed to add both ipv4/ipv6 entries and l2 entries. To add
ipv4/ipv6 entries is not required to use the PGID table while for l2
entries it is required. The PGID table is much smaller than MAC table
so only fewer l2 entries can be added.
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/microchip/lan966x/lan966x_main.h')
-rw-r--r-- | drivers/net/ethernet/microchip/lan966x/lan966x_main.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.h b/drivers/net/ethernet/microchip/lan966x/lan966x_main.h index 367c2afe84a6..99c6d0a9f946 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.h +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.h @@ -109,6 +109,10 @@ struct lan966x { /* worqueue for fdb */ struct workqueue_struct *fdb_work; struct list_head fdb_entries; + + /* mdb */ + struct list_head mdb_entries; + struct list_head pgid_entries; }; struct lan966x_port_config { @@ -215,6 +219,15 @@ int lan966x_handle_fdb(struct net_device *dev, unsigned long event, const void *ctx, const struct switchdev_notifier_fdb_info *fdb_info); +void lan966x_mdb_init(struct lan966x *lan966x); +void lan966x_mdb_deinit(struct lan966x *lan966x); +int lan966x_handle_port_mdb_add(struct lan966x_port *port, + const struct switchdev_obj *obj); +int lan966x_handle_port_mdb_del(struct lan966x_port *port, + const struct switchdev_obj *obj); +void lan966x_mdb_erase_entries(struct lan966x *lan966x, u16 vid); +void lan966x_mdb_write_entries(struct lan966x *lan966x, u16 vid); + static inline void __iomem *lan_addr(void __iomem *base[], int id, int tinst, int tcnt, int gbase, int ginst, |