Commit 8e6598a7 authored by Tobias Waldekranz's avatar Tobias Waldekranz Committed by Jakub Kicinski

net: dsa: Pass VLAN MSTI migration notifications to driver

Add the usual trampoline functionality from the generic DSA layer down
to the drivers for VLAN MSTI migrations.
Signed-off-by: default avatarTobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 332afc4c
...@@ -976,6 +976,9 @@ struct dsa_switch_ops { ...@@ -976,6 +976,9 @@ struct dsa_switch_ops {
struct netlink_ext_ack *extack); struct netlink_ext_ack *extack);
int (*port_vlan_del)(struct dsa_switch *ds, int port, int (*port_vlan_del)(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_vlan *vlan); const struct switchdev_obj_port_vlan *vlan);
int (*vlan_msti_set)(struct dsa_switch *ds, struct dsa_bridge bridge,
const struct switchdev_vlan_msti *msti);
/* /*
* Forwarding database * Forwarding database
*/ */
......
...@@ -236,6 +236,8 @@ bool dsa_port_skip_vlan_configuration(struct dsa_port *dp); ...@@ -236,6 +236,8 @@ bool dsa_port_skip_vlan_configuration(struct dsa_port *dp);
int dsa_port_ageing_time(struct dsa_port *dp, clock_t ageing_clock); int dsa_port_ageing_time(struct dsa_port *dp, clock_t ageing_clock);
int dsa_port_mst_enable(struct dsa_port *dp, bool on, int dsa_port_mst_enable(struct dsa_port *dp, bool on,
struct netlink_ext_ack *extack); struct netlink_ext_ack *extack);
int dsa_port_vlan_msti(struct dsa_port *dp,
const struct switchdev_vlan_msti *msti);
int dsa_port_mtu_change(struct dsa_port *dp, int new_mtu, int dsa_port_mtu_change(struct dsa_port *dp, int new_mtu,
bool targeted_match); bool targeted_match);
int dsa_port_fdb_add(struct dsa_port *dp, const unsigned char *addr, int dsa_port_fdb_add(struct dsa_port *dp, const unsigned char *addr,
......
...@@ -323,7 +323,10 @@ static void dsa_port_bridge_destroy(struct dsa_port *dp, ...@@ -323,7 +323,10 @@ static void dsa_port_bridge_destroy(struct dsa_port *dp,
static bool dsa_port_supports_mst(struct dsa_port *dp) static bool dsa_port_supports_mst(struct dsa_port *dp)
{ {
return dsa_port_can_configure_learning(dp); struct dsa_switch *ds = dp->ds;
return ds->ops->vlan_msti_set &&
dsa_port_can_configure_learning(dp);
} }
int dsa_port_bridge_join(struct dsa_port *dp, struct net_device *br, int dsa_port_bridge_join(struct dsa_port *dp, struct net_device *br,
...@@ -800,6 +803,17 @@ int dsa_port_bridge_flags(struct dsa_port *dp, ...@@ -800,6 +803,17 @@ int dsa_port_bridge_flags(struct dsa_port *dp,
return 0; return 0;
} }
int dsa_port_vlan_msti(struct dsa_port *dp,
const struct switchdev_vlan_msti *msti)
{
struct dsa_switch *ds = dp->ds;
if (!ds->ops->vlan_msti_set)
return -EOPNOTSUPP;
return ds->ops->vlan_msti_set(ds, *dp->bridge, msti);
}
int dsa_port_mtu_change(struct dsa_port *dp, int new_mtu, int dsa_port_mtu_change(struct dsa_port *dp, int new_mtu,
bool targeted_match) bool targeted_match)
{ {
......
...@@ -483,6 +483,12 @@ static int dsa_slave_port_attr_set(struct net_device *dev, const void *ctx, ...@@ -483,6 +483,12 @@ static int dsa_slave_port_attr_set(struct net_device *dev, const void *ctx,
ret = dsa_port_bridge_flags(dp, attr->u.brport_flags, extack); ret = dsa_port_bridge_flags(dp, attr->u.brport_flags, extack);
break; break;
case SWITCHDEV_ATTR_ID_VLAN_MSTI:
if (!dsa_port_offloads_bridge_dev(dp, attr->orig_dev))
return -EOPNOTSUPP;
ret = dsa_port_vlan_msti(dp, &attr->u.vlan_msti);
break;
default: default:
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
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