summaryrefslogtreecommitdiff
path: root/net/bridge/br_mrp.c
diff options
context:
space:
mode:
authorHoratiu Vultur <horatiu.vultur@microchip.com>2020-05-27 12:34:30 +0000
committerDavid S. Miller <davem@davemloft.net>2020-05-27 11:30:43 -0700
commit20f6a05ef63594feb0c6dfbd629da0448b43124d (patch)
tree829dc3b600b771048c5a70c7a43bf12a4ad5d5d1 /net/bridge/br_mrp.c
parent9f01a71c5cbec10b851588457089d17c20dc5a40 (diff)
bridge: mrp: Rework the MRP netlink interface
This patch reworks the MRP netlink interface. Before, each attribute represented a binary structure which made it hard to be extended. Therefore update the MRP netlink interface such that each existing attribute to be a nested attribute which contains the fields of the binary structures. In this way the MRP netlink interface can be extended without breaking the backwards compatibility. It is also using strict checking for attributes under the MRP top attribute. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_mrp.c')
-rw-r--r--net/bridge/br_mrp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c
index 528d767eb026..8ea59504ef47 100644
--- a/net/bridge/br_mrp.c
+++ b/net/bridge/br_mrp.c
@@ -376,24 +376,24 @@ int br_mrp_set_port_state(struct net_bridge_port *p,
* note: already called with rtnl_lock
*/
int br_mrp_set_port_role(struct net_bridge_port *p,
- struct br_mrp_port_role *role)
+ enum br_mrp_port_role_type role)
{
struct br_mrp *mrp;
if (!p || !(p->flags & BR_MRP_AWARE))
return -EINVAL;
- mrp = br_mrp_find_id(p->br, role->ring_id);
+ mrp = br_mrp_find_port(p->br, p);
if (!mrp)
return -EINVAL;
- if (role->role == BR_MRP_PORT_ROLE_PRIMARY)
+ if (role == BR_MRP_PORT_ROLE_PRIMARY)
rcu_assign_pointer(mrp->p_port, p);
else
rcu_assign_pointer(mrp->s_port, p);
- br_mrp_port_switchdev_set_role(p, role->role);
+ br_mrp_port_switchdev_set_role(p, role);
return 0;
}