From: David Miller <davem@davemloft.net>
To: netdev@vger.kernel.org
Subject: [v3 RFC PATCH 3/8] ipv4: Set DST_NOCACHE in rt_dst_alloc().
Date: Wed, 02 Mar 2011 17:01:59 -0800 (PST) [thread overview]
Message-ID: <20110302.170159.27813493.davem@davemloft.net> (raw)
Instead of using a read/modify/write in rt_finalize().
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/ipv4/route.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index dac8adc..efefefa 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -492,11 +492,6 @@ void rt_cache_flush(struct net *net, int delay)
static struct rtable *rt_finalize(struct rtable *rt, struct sk_buff *skb)
{
- /* To avoid expensive rcu stuff for this uncached dst, we set
- * DST_NOCACHE so that dst_release() can free dst without
- * waiting a grace period.
- */
- rt->dst.flags |= DST_NOCACHE;
if (rt->rt_type == RTN_UNICAST || rt_is_output_route(rt)) {
int err = arp_bind_neighbour(&rt->dst);
if (err) {
@@ -1103,7 +1098,11 @@ static struct rtable *rt_dst_alloc(bool nopolicy, bool noxfrm)
if (rt) {
rt->dst.obsolete = -1;
- rt->dst.flags = DST_HOST |
+ /* To avoid expensive rcu stuff for this uncached dst, we set
+ * DST_NOCACHE so that dst_release() can free dst without
+ * waiting a grace period.
+ */
+ rt->dst.flags = DST_NOCACHE | DST_HOST |
(nopolicy ? DST_NOPOLICY : 0) |
(noxfrm ? DST_NOXFRM : 0);
}
--
1.7.4.1
reply other threads:[~2011-03-03 1:01 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=20110302.170159.27813493.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.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).