summaryrefslogtreecommitdiff
path: root/net/bridge/br_mrp.c
diff options
context:
space:
mode:
authorHoratiu Vultur <horatiu.vultur@microchip.com>2020-05-30 18:09:47 +0000
committerDavid S. Miller <davem@davemloft.net>2020-06-01 11:56:11 -0700
commit4b3a61b030d1131dcf3633a276158a3d0a435a47 (patch)
treee68bce001797bc8b8beaeabb45e286b219df5673 /net/bridge/br_mrp.c
parent7e89ed8ab3f74e0746d3ea80537d7a06b0e27732 (diff)
bridge: mrp: Set the priority of MRP instance
Each MRP instance has a priority, a lower value means a higher priority. The priority of MRP instance is stored in MRP_Test frame in this way all the MRP nodes in the ring can see other nodes priority. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c
index 8ea59504ef47..f8fd037219fe 100644
--- a/net/bridge/br_mrp.c
+++ b/net/bridge/br_mrp.c
@@ -147,7 +147,7 @@ static struct sk_buff *br_mrp_alloc_test_skb(struct br_mrp *mrp,
br_mrp_skb_tlv(skb, BR_MRP_TLV_HEADER_RING_TEST, sizeof(*hdr));
hdr = skb_put(skb, sizeof(*hdr));
- hdr->prio = cpu_to_be16(MRP_DEFAULT_PRIO);
+ hdr->prio = cpu_to_be16(mrp->prio);
ether_addr_copy(hdr->sa, p->br->dev->dev_addr);
hdr->port_role = cpu_to_be16(port_role);
hdr->state = cpu_to_be16(mrp->ring_state);
@@ -290,6 +290,7 @@ int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance)
return -ENOMEM;
mrp->ring_id = instance->ring_id;
+ mrp->prio = instance->prio;
p = br_mrp_get_port(br, instance->p_ifindex);
spin_lock_bh(&br->lock);