[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190405173136.18050-15-m-karicheri2@ti.com>
Date: Fri, 5 Apr 2019 13:31:36 -0400
From: Murali Karicheri <m-karicheri2@...com>
To: <davem@...emloft.net>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <arvid.brodin@...en.se>,
<a-kramer@...com>
Subject: [PATCH net 14/14] net: hsr: Fix node prune function for forget time expiry
From: Aaron Kramer <a-kramer@...com>
HSR should forget nodes after configured node forget time expiry based
on HSR_NODE_FORGET_TIME. As part of hsr_prune_nodes(), code checks to
see if entries are to be flushed out if not heard for longer than forget
time. But currently hsr_prune_nodes() is called only once during device
creation. Restart the timer at the end of hsr_prune_nodes() so that
hsr_prune_nodes() gets called periodically and forgotten entries are
removed from node table.
Signed-off-by: Aaron Kramer <a-kramer@...com>
Signed-off-by: Murali Karicheri <m-karicheri2@...com>
---
net/hsr/hsr_framereg.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c
index a3cc30ac8a5a..9fa9abd83018 100644
--- a/net/hsr/hsr_framereg.c
+++ b/net/hsr/hsr_framereg.c
@@ -405,6 +405,10 @@ void hsr_prune_nodes(struct timer_list *t)
}
}
rcu_read_unlock();
+
+ /* Restart timer */
+ mod_timer(&hsr->prune_timer,
+ jiffies + msecs_to_jiffies(PRUNE_PERIOD));
}
void *hsr_get_next_node(struct hsr_priv *hsr, void *_pos,
--
2.17.0
Powered by blists - more mailing lists