mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
net: dsa: remove cross-chip support for MRP
The cross-chip notifiers for MRP are bypass operations, meaning that even though all switches in a tree are notified, only the switch specified in the info structure is targeted. We can eliminate the unnecessary complexity by deleting the cross-chip notifier logic and calling the ds->ops straight from port.c. Cc: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
ff91e1b684
commit
cad69019f2
@@ -907,49 +907,45 @@ int dsa_port_vlan_del(struct dsa_port *dp,
|
||||
int dsa_port_mrp_add(const struct dsa_port *dp,
|
||||
const struct switchdev_obj_mrp *mrp)
|
||||
{
|
||||
struct dsa_notifier_mrp_info info = {
|
||||
.sw_index = dp->ds->index,
|
||||
.port = dp->index,
|
||||
.mrp = mrp,
|
||||
};
|
||||
struct dsa_switch *ds = dp->ds;
|
||||
|
||||
return dsa_port_notify(dp, DSA_NOTIFIER_MRP_ADD, &info);
|
||||
if (!ds->ops->port_mrp_add)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
return ds->ops->port_mrp_add(ds, dp->index, mrp);
|
||||
}
|
||||
|
||||
int dsa_port_mrp_del(const struct dsa_port *dp,
|
||||
const struct switchdev_obj_mrp *mrp)
|
||||
{
|
||||
struct dsa_notifier_mrp_info info = {
|
||||
.sw_index = dp->ds->index,
|
||||
.port = dp->index,
|
||||
.mrp = mrp,
|
||||
};
|
||||
struct dsa_switch *ds = dp->ds;
|
||||
|
||||
return dsa_port_notify(dp, DSA_NOTIFIER_MRP_DEL, &info);
|
||||
if (!ds->ops->port_mrp_del)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
return ds->ops->port_mrp_del(ds, dp->index, mrp);
|
||||
}
|
||||
|
||||
int dsa_port_mrp_add_ring_role(const struct dsa_port *dp,
|
||||
const struct switchdev_obj_ring_role_mrp *mrp)
|
||||
{
|
||||
struct dsa_notifier_mrp_ring_role_info info = {
|
||||
.sw_index = dp->ds->index,
|
||||
.port = dp->index,
|
||||
.mrp = mrp,
|
||||
};
|
||||
struct dsa_switch *ds = dp->ds;
|
||||
|
||||
return dsa_port_notify(dp, DSA_NOTIFIER_MRP_ADD_RING_ROLE, &info);
|
||||
if (!ds->ops->port_mrp_add_ring_role)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
return ds->ops->port_mrp_add_ring_role(ds, dp->index, mrp);
|
||||
}
|
||||
|
||||
int dsa_port_mrp_del_ring_role(const struct dsa_port *dp,
|
||||
const struct switchdev_obj_ring_role_mrp *mrp)
|
||||
{
|
||||
struct dsa_notifier_mrp_ring_role_info info = {
|
||||
.sw_index = dp->ds->index,
|
||||
.port = dp->index,
|
||||
.mrp = mrp,
|
||||
};
|
||||
struct dsa_switch *ds = dp->ds;
|
||||
|
||||
return dsa_port_notify(dp, DSA_NOTIFIER_MRP_DEL_RING_ROLE, &info);
|
||||
if (!ds->ops->port_mrp_del_ring_role)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
return ds->ops->port_mrp_del_ring_role(ds, dp->index, mrp);
|
||||
}
|
||||
|
||||
void dsa_port_set_tag_protocol(struct dsa_port *cpu_dp,
|
||||
|
||||
Reference in New Issue
Block a user