Commit bfd04232 authored by Horatiu Vultur's avatar Horatiu Vultur Committed by Jakub Kicinski

bridge: mrp: Implement LC mode for MRP

Extend MRP to support LC mode(link check) for the interconnect port.
This applies only to the interconnect ring.

Opposite to RC mode(ring check) the LC mode is using CFM frames to
detect when the link goes up or down and based on that the userspace
will need to react.
One advantage of the LC mode over RC mode is that there will be fewer
frames in the normal rings. Because RC mode generates InTest on all
ports while LC mode sends CFM frame only on the interconnect port.

All 4 nodes part of the interconnect ring needs to have the same mode.
And it is not possible to have running LC and RC mode at the same time
on a node.

Whenever the MIM starts it needs to detect the status of the other 3
nodes in the interconnect ring so it would send a frame called
InLinkStatus, on which the clients needs to reply with their link
status.

This patch adds InLinkStatus frame type and extends existing rules on
how to forward this frame.
Acked-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
Link: https://lore.kernel.org/r/20201124082525.273820-1-horatiu.vultur@microchip.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent f460019b
......@@ -61,6 +61,7 @@ enum br_mrp_tlv_header_type {
BR_MRP_TLV_HEADER_IN_TOPO = 0x7,
BR_MRP_TLV_HEADER_IN_LINK_DOWN = 0x8,
BR_MRP_TLV_HEADER_IN_LINK_UP = 0x9,
BR_MRP_TLV_HEADER_IN_LINK_STATUS = 0xa,
BR_MRP_TLV_HEADER_OPTION = 0x7f,
};
......
......@@ -858,7 +858,8 @@ static bool br_mrp_in_frame(struct sk_buff *skb)
if (hdr->type == BR_MRP_TLV_HEADER_IN_TEST ||
hdr->type == BR_MRP_TLV_HEADER_IN_TOPO ||
hdr->type == BR_MRP_TLV_HEADER_IN_LINK_DOWN ||
hdr->type == BR_MRP_TLV_HEADER_IN_LINK_UP)
hdr->type == BR_MRP_TLV_HEADER_IN_LINK_UP ||
hdr->type == BR_MRP_TLV_HEADER_IN_LINK_STATUS)
return true;
return false;
......@@ -1126,9 +1127,9 @@ static int br_mrp_rcv(struct net_bridge_port *p,
goto no_forward;
}
} else {
/* MIM should forward IntLinkChange and
/* MIM should forward IntLinkChange/Status and
* IntTopoChange between ring ports but MIM
* should not forward IntLinkChange and
* should not forward IntLinkChange/Status and
* IntTopoChange if the frame was received at
* the interconnect port
*/
......@@ -1155,6 +1156,17 @@ static int br_mrp_rcv(struct net_bridge_port *p,
in_type == BR_MRP_TLV_HEADER_IN_LINK_DOWN))
goto forward;
/* MIC should forward IntLinkStatus frames only to
* interconnect port if it was received on a ring port.
* If it is received on interconnect port then, it
* should be forward on both ring ports
*/
if (br_mrp_is_ring_port(p_port, s_port, p) &&
in_type == BR_MRP_TLV_HEADER_IN_LINK_STATUS) {
p_dst = NULL;
s_dst = NULL;
}
/* Should forward the InTopo frames only between the
* ring ports
*/
......
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