Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
commit 982ba6840eb7050ca290daaaa651309253d450ad Merge: 888f60e5 d3be478f Author: Sven Eckelmann sven@narfation.org Date: Tue Oct 15 19:58:34 2019 +0200
Merge branch 'maint'
982ba6840eb7050ca290daaaa651309253d450ad net/batman-adv/bat_iv_ogm.c | 86 ++++++++++++++++++++++++++--------------- net/batman-adv/bat_v_ogm.c | 25 +++++++----- net/batman-adv/hard-interface.c | 2 + net/batman-adv/types.h | 15 +++++-- 4 files changed, 83 insertions(+), 45 deletions(-)
diff --cc net/batman-adv/bat_v_ogm.c index 24d00a97,74452e93..8033f24f --- a/net/batman-adv/bat_v_ogm.c +++ b/net/batman-adv/bat_v_ogm.c @@@ -22,10 -23,8 +23,9 @@@ #include <linux/random.h> #include <linux/rculist.h> #include <linux/rcupdate.h> - #include <linux/rtnetlink.h> #include <linux/skbuff.h> #include <linux/slab.h> +#include <linux/spinlock.h> #include <linux/stddef.h> #include <linux/string.h> #include <linux/types.h> @@@ -370,34 -231,14 +370,35 @@@ static void batadv_v_ogm_send(struct wo struct batadv_priv_bat_v *bat_v; struct batadv_priv *bat_priv;
- rtnl_lock(); bat_v = container_of(work, struct batadv_priv_bat_v, ogm_wq.work); bat_priv = container_of(bat_v, struct batadv_priv, bat_v); + + mutex_lock(&bat_priv->bat_v.ogm_buff_mutex); batadv_v_ogm_send_softif(bat_priv); - rtnl_unlock(); + mutex_unlock(&bat_priv->bat_v.ogm_buff_mutex); }
+/** + * batadv_v_ogm_aggr_work() - OGM queue periodic task per interface + * @work: work queue item + * + * Emits aggregated OGM message in regular intervals. + */ +void batadv_v_ogm_aggr_work(struct work_struct *work) +{ + struct batadv_hard_iface_bat_v *batv; + struct batadv_hard_iface *hard_iface; + + batv = container_of(work, struct batadv_hard_iface_bat_v, aggr_wq.work); + hard_iface = container_of(batv, struct batadv_hard_iface, bat_v); + + spin_lock_bh(&hard_iface->bat_v.aggr_list_lock); + batadv_v_ogm_aggr_send(hard_iface); + spin_unlock_bh(&hard_iface->bat_v.aggr_list_lock); + + batadv_v_ogm_start_queue_timer(hard_iface); +} + /** * batadv_v_ogm_iface_enable() - prepare an interface for B.A.T.M.A.N. V * @hard_iface: the interface to prepare