Skip to content

Commit

Permalink
batman-adv: mcast: shorten multicast tt/tvlv worker spinlock section
Browse files Browse the repository at this point in the history
It is not necessary to hold the mla_lock spinlock during the whole
multicast tt/tvlv worker callback. Just holding it during the checks and
updates of the bat_priv stored multicast flags and mla_list is enough.

Therefore this patch splits batadv_mcast_mla_tvlv_update() in two:
batadv_mcast_mla_flags_get() at the beginning of the worker to gather
and calculate the new multicast flags, which does not need any locking
as it neither reads from nor writes to bat_priv->mcast.

And batadv_mcast_mla_flags_update() at the end of the worker which
commits the newly calculated flags and lists to bat_priv->mcast and
therefore needs the lock.

Signed-off-by: Linus Lüssing <[email protected]>
Signed-off-by: Sven Eckelmann <[email protected]>
Signed-off-by: Simon Wunderlich <[email protected]>
  • Loading branch information
T-X authored and simonwunderlich committed May 25, 2019
1 parent 68a600d commit 6bc4544
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 151 deletions.
Loading

0 comments on commit 6bc4544

Please sign in to comment.