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_vlan.c | |
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_vlan.c')
-rw-r--r-- | drivers/net/ethernet/microchip/lan966x/lan966x_vlan.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_vlan.c b/drivers/net/ethernet/microchip/lan966x/lan966x_vlan.c index 057f48ddf22c..8d7260cd7da9 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_vlan.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_vlan.c @@ -219,6 +219,7 @@ void lan966x_vlan_port_add_vlan(struct lan966x_port *port, if (lan966x_vlan_cpu_member_cpu_vlan_mask(lan966x, vid)) { lan966x_vlan_cpu_add_vlan_mask(lan966x, vid); lan966x_fdb_write_entries(lan966x, vid); + lan966x_mdb_write_entries(lan966x, vid); } lan966x_vlan_port_set_vid(port, vid, pvid, untagged); @@ -241,6 +242,7 @@ void lan966x_vlan_port_del_vlan(struct lan966x_port *port, u16 vid) if (!lan966x_vlan_port_any_vlan_mask(lan966x, vid)) { lan966x_vlan_cpu_del_vlan_mask(lan966x, vid); lan966x_fdb_erase_entries(lan966x, vid); + lan966x_mdb_erase_entries(lan966x, vid); } } @@ -254,8 +256,10 @@ void lan966x_vlan_cpu_add_vlan(struct lan966x *lan966x, u16 vid) * information so when a front port is added then it would add also the * CPU port. */ - if (lan966x_vlan_port_any_vlan_mask(lan966x, vid)) + if (lan966x_vlan_port_any_vlan_mask(lan966x, vid)) { lan966x_vlan_cpu_add_vlan_mask(lan966x, vid); + lan966x_mdb_write_entries(lan966x, vid); + } lan966x_vlan_cpu_add_cpu_vlan_mask(lan966x, vid); lan966x_fdb_write_entries(lan966x, vid); @@ -267,6 +271,7 @@ void lan966x_vlan_cpu_del_vlan(struct lan966x *lan966x, u16 vid) lan966x_vlan_cpu_del_cpu_vlan_mask(lan966x, vid); lan966x_vlan_cpu_del_vlan_mask(lan966x, vid); lan966x_fdb_erase_entries(lan966x, vid); + lan966x_mdb_erase_entries(lan966x, vid); } void lan966x_vlan_init(struct lan966x *lan966x) |