All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: bridge: mrp: Update ring transitions.
@ 2021-06-04 10:37 ` Horatiu Vultur
  0 siblings, 0 replies; 4+ messages in thread
From: Horatiu Vultur @ 2021-06-04 10:37 UTC (permalink / raw)
  To: roopa, nikolay, davem, kuba, UNGLinuxDriver
  Cc: bridge, netdev, linux-kernel, Horatiu Vultur

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: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 net/bridge/br_mrp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c
index cd2b1e424e54..f7012b7d7ce4 100644
--- a/net/bridge/br_mrp.c
+++ b/net/bridge/br_mrp.c
@@ -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;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Bridge] [PATCH net-next] net: bridge: mrp: Update ring transitions.
@ 2021-06-04 10:37 ` Horatiu Vultur
  0 siblings, 0 replies; 4+ messages in thread
From: Horatiu Vultur @ 2021-06-04 10:37 UTC (permalink / raw)
  To: roopa, nikolay, davem, kuba, UNGLinuxDriver
  Cc: netdev, bridge, linux-kernel, Horatiu Vultur

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: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 net/bridge/br_mrp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c
index cd2b1e424e54..f7012b7d7ce4 100644
--- a/net/bridge/br_mrp.c
+++ b/net/bridge/br_mrp.c
@@ -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;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: bridge: mrp: Update ring transitions.
  2021-06-04 10:37 ` [Bridge] " Horatiu Vultur
@ 2021-06-04 21:50   ` patchwork-bot+netdevbpf
  -1 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-04 21:50 UTC (permalink / raw)
  To: Horatiu Vultur
  Cc: roopa, nikolay, davem, kuba, UNGLinuxDriver, bridge, netdev,
	linux-kernel

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Fri, 4 Jun 2021 12:37:47 +0200 you wrote:
> 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: Horatiu Vultur <horatiu.vultur@microchip.com>
> 
> [...]

Here is the summary with links:
  - [net-next] net: bridge: mrp: Update ring transitions.
    https://git.kernel.org/netdev/net-next/c/fcb34635854a

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bridge] [PATCH net-next] net: bridge: mrp: Update ring transitions.
@ 2021-06-04 21:50   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-04 21:50 UTC (permalink / raw)
  To: Horatiu Vultur
  Cc: netdev, bridge, linux-kernel, UNGLinuxDriver, nikolay, roopa,
	kuba, davem

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Fri, 4 Jun 2021 12:37:47 +0200 you wrote:
> 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: Horatiu Vultur <horatiu.vultur@microchip.com>
> 
> [...]

Here is the summary with links:
  - [net-next] net: bridge: mrp: Update ring transitions.
    https://git.kernel.org/netdev/net-next/c/fcb34635854a

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-04 21:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04 10:37 [PATCH net-next] net: bridge: mrp: Update ring transitions Horatiu Vultur
2021-06-04 10:37 ` [Bridge] " Horatiu Vultur
2021-06-04 21:50 ` patchwork-bot+netdevbpf
2021-06-04 21:50   ` [Bridge] " patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.