LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH V3] hsr: fix don't prune the master node from the node_db
@ 2019-05-23  7:02 Andreas Oetken
  2019-05-23  9:02 ` Sergei Shtylyov
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Oetken @ 2019-05-23  7:02 UTC (permalink / raw)
  Cc: andreas, m-karicheri2, a-kramer, Andreas Oetken, Arvid Brodin,
	David S. Miller, netdev, linux-kernel

Don't prune master node in the hsr_prune_nodes function.
Neither time_in[HSR_PT_SLAVE_A], nor time_in[HSR_PT_SLAVE_B],
will ever be updated by hsr_register_frame_in for the master port.
Thus the master node will be repeatedly pruned leading to
repeated packet loss.
This bug never appeared because the hsr_prune_nodes function
was only called once. Since commit 5150b45fd355
("net: hsr: Fix node prune function for forget time expiry") this issue
is fixed unvealing the issue described above.

Fixes: 5150b45fd355 ("net: hsr: Fix node prune function for forget time expiry")
Signed-off-by: Andreas Oetken <andreas.oetken@siemens.com>
Tested-by: Murali Karicheri <m-karicheri2@ti.com>
---
 net/hsr/hsr_framereg.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c
index 9fa9abd83018..2d7a19750436 100644
--- a/net/hsr/hsr_framereg.c
+++ b/net/hsr/hsr_framereg.c
@@ -365,6 +365,14 @@ void hsr_prune_nodes(struct timer_list *t)
 
 	rcu_read_lock();
 	list_for_each_entry_rcu(node, &hsr->node_db, mac_list) {
+		/* Don't prune own node. Neither time_in[HSR_PT_SLAVE_A]
+		 * nor time_in[HSR_PT_SLAVE_B], will ever be updated for
+		 * the master port. Thus the master node will be repeatedly
+		 * pruned leading to packet loss.
+		 */
+		if (hsr_addr_is_self(hsr, node->macaddress_A))
+			continue;
+
 		/* Shorthand */
 		time_a = node->time_in[HSR_PT_SLAVE_A];
 		time_b = node->time_in[HSR_PT_SLAVE_B];
-- 
2.20.1


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

* Re: [PATCH V3] hsr: fix don't prune the master node from the node_db
  2019-05-23  7:02 [PATCH V3] hsr: fix don't prune the master node from the node_db Andreas Oetken
@ 2019-05-23  9:02 ` Sergei Shtylyov
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2019-05-23  9:02 UTC (permalink / raw)
  To: Andreas Oetken
  Cc: andreas, m-karicheri2, a-kramer, Arvid Brodin, David S. Miller,
	netdev, linux-kernel

Hello!

On 23.05.2019 10:02, Andreas Oetken wrote:

> Don't prune master node in the hsr_prune_nodes function.
> Neither time_in[HSR_PT_SLAVE_A], nor time_in[HSR_PT_SLAVE_B],
> will ever be updated by hsr_register_frame_in for the master port.
> Thus the master node will be repeatedly pruned leading to
> repeated packet loss.
> This bug never appeared because the hsr_prune_nodes function
> was only called once. Since commit 5150b45fd355
> ("net: hsr: Fix node prune function for forget time expiry") this issue
> is fixed unvealing the issue described above.
            ^^^^^^^^^
    My spellchecker trips on this word. I think it should be either 
"unveiling" or "revealing"...

>  Fixes: 5150b45fd355 ("net: hsr: Fix node prune function for forget time expiry")
> Signed-off-by: Andreas Oetken <andreas.oetken@siemens.com>
> Tested-by: Murali Karicheri <m-karicheri2@ti.com>
[...]

MBR, Sergei

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

end of thread, other threads:[~2019-05-23  9:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23  7:02 [PATCH V3] hsr: fix don't prune the master node from the node_db Andreas Oetken
2019-05-23  9:02 ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).