提交 fcb34635 编写于 作者: H Horatiu Vultur 提交者: David S. Miller

net: bridge: mrp: Update ring transitions.

According to the standard IEC 62439-2, the number of transitions needs
to be counted for each transition 'between' ring state open and ring
state closed and not from open state to closed state.

Therefore fix this for both ring and interconnect ring.
Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ecb06058
......@@ -627,8 +627,7 @@ int br_mrp_set_ring_state(struct net_bridge *br,
if (!mrp)
return -EINVAL;
if (mrp->ring_state == BR_MRP_RING_STATE_CLOSED &&
state->ring_state != BR_MRP_RING_STATE_CLOSED)
if (mrp->ring_state != state->ring_state)
mrp->ring_transitions++;
mrp->ring_state = state->ring_state;
......@@ -715,8 +714,7 @@ int br_mrp_set_in_state(struct net_bridge *br, struct br_mrp_in_state *state)
if (!mrp)
return -EINVAL;
if (mrp->in_state == BR_MRP_IN_STATE_CLOSED &&
state->in_state != BR_MRP_IN_STATE_CLOSED)
if (mrp->in_state != state->in_state)
mrp->in_transitions++;
mrp->in_state = state->in_state;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册