public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	David Ahern <dsahern@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Liu Jian <liujian56@huawei.com>, Taehee Yoo <ap420073@gmail.com>,
	Jiri Benc <jbenc@redhat.com>
Subject: [IGMP Discuss] Should we use one lock for struct ip_mc_list ?
Date: Thu, 8 Sep 2022 11:40:21 +0800	[thread overview]
Message-ID: <YxlkJc+QHfDAc95s@Laptop-X1> (raw)

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

                 reply	other threads:[~2022-09-08  3:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YxlkJc+QHfDAc95s@Laptop-X1 \
    --to=liuhangbin@gmail.com \
    --cc=ap420073@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=jbenc@redhat.com \
    --cc=kuba@kernel.org \
    --cc=liujian56@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox