Skip to content

Commit bfd0423

Browse files
HoratiuVulturkuba-moo
authored andcommitted
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: Nikolay Aleksandrov <[email protected]> Signed-off-by: Horatiu Vultur <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f460019 commit bfd0423

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

include/uapi/linux/mrp_bridge.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ enum br_mrp_tlv_header_type {
6161
BR_MRP_TLV_HEADER_IN_TOPO = 0x7,
6262
BR_MRP_TLV_HEADER_IN_LINK_DOWN = 0x8,
6363
BR_MRP_TLV_HEADER_IN_LINK_UP = 0x9,
64+
BR_MRP_TLV_HEADER_IN_LINK_STATUS = 0xa,
6465
BR_MRP_TLV_HEADER_OPTION = 0x7f,
6566
};
6667

net/bridge/br_mrp.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,8 @@ static bool br_mrp_in_frame(struct sk_buff *skb)
858858
if (hdr->type == BR_MRP_TLV_HEADER_IN_TEST ||
859859
hdr->type == BR_MRP_TLV_HEADER_IN_TOPO ||
860860
hdr->type == BR_MRP_TLV_HEADER_IN_LINK_DOWN ||
861-
hdr->type == BR_MRP_TLV_HEADER_IN_LINK_UP)
861+
hdr->type == BR_MRP_TLV_HEADER_IN_LINK_UP ||
862+
hdr->type == BR_MRP_TLV_HEADER_IN_LINK_STATUS)
862863
return true;
863864

864865
return false;
@@ -1126,9 +1127,9 @@ static int br_mrp_rcv(struct net_bridge_port *p,
11261127
goto no_forward;
11271128
}
11281129
} else {
1129-
/* MIM should forward IntLinkChange and
1130+
/* MIM should forward IntLinkChange/Status and
11301131
* IntTopoChange between ring ports but MIM
1131-
* should not forward IntLinkChange and
1132+
* should not forward IntLinkChange/Status and
11321133
* IntTopoChange if the frame was received at
11331134
* the interconnect port
11341135
*/
@@ -1155,6 +1156,17 @@ static int br_mrp_rcv(struct net_bridge_port *p,
11551156
in_type == BR_MRP_TLV_HEADER_IN_LINK_DOWN))
11561157
goto forward;
11571158

1159+
/* MIC should forward IntLinkStatus frames only to
1160+
* interconnect port if it was received on a ring port.
1161+
* If it is received on interconnect port then, it
1162+
* should be forward on both ring ports
1163+
*/
1164+
if (br_mrp_is_ring_port(p_port, s_port, p) &&
1165+
in_type == BR_MRP_TLV_HEADER_IN_LINK_STATUS) {
1166+
p_dst = NULL;
1167+
s_dst = NULL;
1168+
}
1169+
11581170
/* Should forward the InTopo frames only between the
11591171
* ring ports
11601172
*/

0 commit comments

Comments
 (0)