public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [IGMP Discuss] Should we use one lock for struct ip_mc_list ?
@ 2022-09-08  3:40 Hangbin Liu
  0 siblings, 0 replies; only message in thread
From: Hangbin Liu @ 2022-09-08  3:40 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Hideaki YOSHIFUJI, David Ahern, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Liu Jian, Taehee Yoo, Jiri Benc

Hi,

When reviewing commit 23d2b94043ca ("igmp: Add ip_mc_list lock in
ip_check_mc_rcu"). Jiri pointed that struct ip_mc_list is protected by
different lock.

In function ip_check_mc_rcu() and ip_mc_del_src(), the struct ip_mc_list
in in_dev->mc_list is protected by the lock of struct ip_mc_list itself.

But in function igmpv3_send_cr, the ip_mc_list in in_dev->mc_tomb is
protected by in_dev->mc_tomb_lock.

This is no clear doc about what is protected by ip_mc_list->lock.

Is it OK for a single field that be protected by different locks?

Taehee did an update for MLD by using one mc_lock in commit 63ed8de4be81
("mld: add mc_lock for protecting per-interface mld data"). Should we also
do this on IGMP?

Thanks
Hangbin

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-08  3:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-08  3:40 [IGMP Discuss] Should we use one lock for struct ip_mc_list ? Hangbin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox