Commit 1c1ed5a4 authored by Casper Andersson's avatar Casper Andersson Committed by Paolo Abeni

net: sparx5: Add handling of host MDB entries

Handle adding and removing MDB entries for host
Signed-off-by: default avatarCasper Andersson <casper.casan@gmail.com>
Link: https://lore.kernel.org/r/20220503093922.1630804-1-casper.casan@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 4950b699
...@@ -396,6 +396,11 @@ static int sparx5_handle_port_mdb_add(struct net_device *dev, ...@@ -396,6 +396,11 @@ static int sparx5_handle_port_mdb_add(struct net_device *dev,
u32 mact_entry; u32 mact_entry;
int res, err; int res, err;
if (netif_is_bridge_master(v->obj.orig_dev)) {
sparx5_mact_learn(spx5, PGID_CPU, v->addr, v->vid);
return 0;
}
/* When VLAN unaware the vlan value is not parsed and we receive vid 0. /* When VLAN unaware the vlan value is not parsed and we receive vid 0.
* Fall back to bridge vid 1. * Fall back to bridge vid 1.
*/ */
...@@ -461,6 +466,11 @@ static int sparx5_handle_port_mdb_del(struct net_device *dev, ...@@ -461,6 +466,11 @@ static int sparx5_handle_port_mdb_del(struct net_device *dev,
u32 mact_entry, res, pgid_entry[3]; u32 mact_entry, res, pgid_entry[3];
int err; int err;
if (netif_is_bridge_master(v->obj.orig_dev)) {
sparx5_mact_forget(spx5, v->addr, v->vid);
return 0;
}
if (!br_vlan_enabled(spx5->hw_bridge_dev)) if (!br_vlan_enabled(spx5->hw_bridge_dev))
vid = 1; vid = 1;
else else
...@@ -500,6 +510,7 @@ static int sparx5_handle_port_obj_add(struct net_device *dev, ...@@ -500,6 +510,7 @@ static int sparx5_handle_port_obj_add(struct net_device *dev,
SWITCHDEV_OBJ_PORT_VLAN(obj)); SWITCHDEV_OBJ_PORT_VLAN(obj));
break; break;
case SWITCHDEV_OBJ_ID_PORT_MDB: case SWITCHDEV_OBJ_ID_PORT_MDB:
case SWITCHDEV_OBJ_ID_HOST_MDB:
err = sparx5_handle_port_mdb_add(dev, nb, err = sparx5_handle_port_mdb_add(dev, nb,
SWITCHDEV_OBJ_PORT_MDB(obj)); SWITCHDEV_OBJ_PORT_MDB(obj));
break; break;
...@@ -552,6 +563,7 @@ static int sparx5_handle_port_obj_del(struct net_device *dev, ...@@ -552,6 +563,7 @@ static int sparx5_handle_port_obj_del(struct net_device *dev,
SWITCHDEV_OBJ_PORT_VLAN(obj)->vid); SWITCHDEV_OBJ_PORT_VLAN(obj)->vid);
break; break;
case SWITCHDEV_OBJ_ID_PORT_MDB: case SWITCHDEV_OBJ_ID_PORT_MDB:
case SWITCHDEV_OBJ_ID_HOST_MDB:
err = sparx5_handle_port_mdb_del(dev, nb, err = sparx5_handle_port_mdb_del(dev, nb,
SWITCHDEV_OBJ_PORT_MDB(obj)); SWITCHDEV_OBJ_PORT_MDB(obj));
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment