From: Cong Wang <amwang@redhat.com>
To: Debabrata Banerjee <dbavatar@gmail.com>
Cc: netdev@vger.kernel.org, "Banerjee,
Debabrata" <dbanerje@akamai.com>,
"David S. Miller" <davem@davemloft.net>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Patrick McHardy <kaber@trash.net>
Subject: Re: [PATCH 1/2] ipv6: do not hold route table lock when send ndisc probe
Date: Tue, 21 Aug 2012 11:44:03 +0800 [thread overview]
Message-ID: <1345520643.12468.6.camel@cr0> (raw)
In-Reply-To: <CAATkVEzKuTeUbU75B6EoSfFvGVsz_eK47XNWmsP5KcCvjTDEDA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Hi, Debabrata,
Could you help to test the attached patch below?
Thanks!
[-- Attachment #2: ipv6-deadlock.diff --]
[-- Type: text/x-patch, Size: 1563 bytes --]
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index eb3f1e4..cd141a5 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -440,9 +440,26 @@ out:
}
#ifdef CONFIG_IPV6_ROUTER_PREF
+struct ndisc_work {
+ struct work_struct work;
+ struct in6_addr mcaddr;
+ struct in6_addr target;
+ struct net_device *dev;
+};
+
+static void queue_ndisc(struct work_struct *work)
+{
+ struct ndisc_work *nw =
+ container_of(work, struct ndisc_work, work);
+ ndisc_send_ns(nw->dev, NULL, &nw->target, &nw->mcaddr, NULL);
+ kfree(nw);
+}
+
static void rt6_probe(struct rt6_info *rt)
{
struct neighbour *neigh;
+ struct ndisc_work *nw;
+
/*
* Okay, this does not seem to be appropriate
* for now, however, we need to check if it
@@ -457,15 +474,18 @@ static void rt6_probe(struct rt6_info *rt)
read_lock_bh(&neigh->lock);
if (!(neigh->nud_state & NUD_VALID) &&
time_after(jiffies, neigh->updated + rt->rt6i_idev->cnf.rtr_probe_interval)) {
- struct in6_addr mcaddr;
- struct in6_addr *target;
neigh->updated = jiffies;
read_unlock_bh(&neigh->lock);
- target = (struct in6_addr *)&neigh->primary_key;
- addrconf_addr_solict_mult(target, &mcaddr);
- ndisc_send_ns(rt->dst.dev, NULL, target, &mcaddr, NULL);
+ nw = kmalloc(sizeof(*nw), GFP_ATOMIC);
+ if (nw) {
+ memcpy(&nw->target, &neigh->primary_key, sizeof(struct in6_addr));
+ addrconf_addr_solict_mult(&nw->target, &nw->mcaddr);
+ nw->dev = rt->dst.dev;
+ INIT_WORK(&nw->work, queue_ndisc);
+ schedule_work(&nw->work);
+ }
} else {
read_unlock_bh(&neigh->lock);
}
next prev parent reply other threads:[~2012-08-21 3:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-17 7:11 [PATCH 1/2] ipv6: do not hold route table lock when send ndisc probe Cong Wang
2012-08-17 7:11 ` [PATCH 2/2] ipv6: remove some useless RCU read lock Cong Wang
2012-08-17 18:54 ` [PATCH 1/2] ipv6: do not hold route table lock when send ndisc probe Debabrata Banerjee
2012-08-20 12:15 ` Cong Wang
2012-08-21 3:44 ` Cong Wang [this message]
2012-08-22 16:04 ` Banerjee, Debabrata
2012-08-23 9:11 ` Cong Wang
2012-08-23 16:10 ` Eric Dumazet
2012-08-24 9:15 ` Cong Wang
2012-08-24 9:44 ` Eric Dumazet
2012-08-24 10:45 ` Cong Wang
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=1345520643.12468.6.camel@cr0 \
--to=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=dbanerje@akamai.com \
--cc=dbavatar@gmail.com \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--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).