b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Taehee Yoo <ap420073@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>,
	netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org
Cc: jwi@linux.ibm.com, kgraul@linux.ibm.com, hca@linux.ibm.com,
	gor@linux.ibm.com, borntraeger@de.ibm.com,
	mareklindner@neomailbox.ch, sw@simonwunderlich.de, a@unstable.cc,
	sven@narfation.org, yoshfuji@linux-ipv6.org, dsahern@kernel.org,
	linux-s390@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org,
	xiyou.wangcong@gmail.com
Subject: Re: [PATCH net-next v3 5/7] mld: convert ifmcaddr6 to RCU
Date: Tue, 30 Mar 2021 12:41:40 +0900	[thread overview]
Message-ID: <f054971d-8be0-92ba-009b-9681e08f841c@gmail.com> (raw)
In-Reply-To: <6262890a-7789-e3dd-aa04-58e5e06499dc@gmail.com>

On 2021. 3. 30. 오전 4:56, Eric Dumazet wrote:
 >
 >

Hi Eric,
Thank you for the review!

 > On 3/25/21 5:16 PM, Taehee Yoo wrote:
 >> The ifmcaddr6 has been protected by inet6_dev->lock(rwlock) so that
 >> the critical section is atomic context. In order to switch this context,
 >> changing locking is needed. The ifmcaddr6 actually already protected by
 >> RTNL So if it's converted to use RCU, its control path context can be
 >> switched to sleepable.
 >>
 >
 > I do not really understand the changelog.
 >
 > You wanted to convert from RCU to RTNL, right ?

The purpose of this is to use both RCU and RTNL.
In the control path, ifmcaddr6 is protected by RTNL
(setsockopt_needs_rtnl() in the do_ipv6_setsockopt())
And in the data path, ifmcaddr6 will be protected by RCU.

But ifmcaddr6 is already protected by RTNL in the control path.
So, this patch is to convert ifmcaddr6 to RCU only for datapath.
Therefore, by this patch, ifmcaddr6 will be protected by both RTNL and RCU.

I'm so sorry for this strange changelog.

 >
 > Also :
 >
 >> @@ -571,13 +573,9 @@ int ip6_mc_msfget(struct sock *sk, struct 
group_filter *gsf,
 >>   	if (!ipv6_addr_is_multicast(group))
 >>   		return -EINVAL;
 >>
 >> -	rcu_read_lock();
 >> -	idev = ip6_mc_find_dev_rcu(net, group, gsf->gf_interface);
 >> -
 >> -	if (!idev) {
 >> -		rcu_read_unlock();
 >> +	idev = ip6_mc_find_dev_rtnl(net, group, gsf->gf_interface);
 >> +	if (!idev)
 >>   		return -ENODEV;
 >> -	}
 >>
 >
 > I do not see RTNL being acquired before entering ip6_mc_msfget()
 >

Thank you so much for catching this.
I will send a patch to fix this problem!

Thanks a lot!
Taehee Yoo

  reply	other threads:[~2021-03-30  3:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 16:16 [PATCH net-next v3 0/7] mld: change context from atomic to sleepable Taehee Yoo
2021-03-25 16:16 ` [PATCH net-next v3 1/7] mld: convert from timer to delayed work Taehee Yoo
2021-03-25 16:16 ` [PATCH net-next v3 2/7] mld: get rid of inet6_dev->mc_lock Taehee Yoo
2021-03-25 16:16 ` [PATCH net-next v3 3/7] mld: convert ipv6_mc_socklist->sflist to RCU Taehee Yoo
2021-03-25 16:16 ` [PATCH net-next v3 4/7] mld: convert ip6_sf_list " Taehee Yoo
2021-03-25 16:16 ` [PATCH net-next v3 5/7] mld: convert ifmcaddr6 " Taehee Yoo
2021-03-29 19:56   ` Eric Dumazet
2021-03-30  3:41     ` Taehee Yoo [this message]
2021-03-25 16:16 ` [PATCH net-next v3 6/7] mld: add new workqueues for process mld events Taehee Yoo
2021-03-25 16:16 ` [PATCH net-next v3 7/7] mld: add mc_lock for protecting per-interface mld data Taehee Yoo
2021-03-30 11:59   ` Eric Dumazet
2021-03-30 12:24     ` Eric Dumazet
2021-03-30 15:01       ` Taehee Yoo
2021-03-25 16:24 ` [PATCH net-next v3 0/7] mld: change context from atomic to sleepable Taehee Yoo

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=f054971d-8be0-92ba-009b-9681e08f841c@gmail.com \
    --to=ap420073@gmail.com \
    --cc=a@unstable.cc \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=borntraeger@de.ibm.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=eric.dumazet@gmail.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=jwi@linux.ibm.com \
    --cc=kgraul@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mareklindner@neomailbox.ch \
    --cc=netdev@vger.kernel.org \
    --cc=sven@narfation.org \
    --cc=sw@simonwunderlich.de \
    --cc=xiyou.wangcong@gmail.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;
as well as URLs for NNTP newsgroup(s).