diff options
author | Andreas Oetken <andreas.oetken@siemens.com> | 2019-05-23 07:57:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-23 12:29:44 -0400 |
commit | d2daa127ed51ac41217962d2b8f9c00be6e9c0d9 (patch) | |
tree | f1f16947d350280b6a76ba08a834a985f184c3a2 /net/hsr | |
parent | 3f6f7a175ad4cf9a6a3dda72d7f5d122107f4b9e (diff) |
hsr: fix don't prune the master node from the node_db
Don't prune the 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 unveiling 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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/hsr')
-rw-r--r-- | net/hsr/hsr_framereg.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) | |||
365 | 365 | ||
366 | rcu_read_lock(); | 366 | rcu_read_lock(); |
367 | list_for_each_entry_rcu(node, &hsr->node_db, mac_list) { | 367 | list_for_each_entry_rcu(node, &hsr->node_db, mac_list) { |
368 | /* Don't prune own node. Neither time_in[HSR_PT_SLAVE_A] | ||
369 | * nor time_in[HSR_PT_SLAVE_B], will ever be updated for | ||
370 | * the master port. Thus the master node will be repeatedly | ||
371 | * pruned leading to packet loss. | ||
372 | */ | ||
373 | if (hsr_addr_is_self(hsr, node->macaddress_A)) | ||
374 | continue; | ||
375 | |||
368 | /* Shorthand */ | 376 | /* Shorthand */ |
369 | time_a = node->time_in[HSR_PT_SLAVE_A]; | 377 | time_a = node->time_in[HSR_PT_SLAVE_A]; |
370 | time_b = node->time_in[HSR_PT_SLAVE_B]; | 378 | time_b = node->time_in[HSR_PT_SLAVE_B]; |