From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 10/15] ipv4: Cache input routes in fib_info nexthops.
Date: Wed, 18 Jul 2012 12:27:55 -0700 [thread overview]
Message-ID: <1342639675.2013.18.camel@joe2Laptop> (raw)
In-Reply-To: <20120718.112413.1969496621247659288.davem@davemloft.net>
On Wed, 2012-07-18 at 11:24 -0700, David Miller wrote:
> Caching input routes is slightly simpler than output routes, since we
> don't need to be concerned with nexthop exceptions. (locally
> destined, and routed packets, never trigger PMTU events or redirects
> that will be processed by us).
[]
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
[]
> @@ -1355,11 +1357,11 @@ static int __mkroute_input(struct sk_buff *skb,
[]
> + do_cache = false;
> + if (res->fi) {
> + if (!(flags & RTCF_DIRECTSRC) && !itag) {
> + rth = FIB_RES_NH(*res).nh_rth_input;
> + if (rth) {
> + dst_use(&rth->dst, jiffies);
> + goto out;
> + }
> + do_cache = true;
> + }
> + }
[]
> @@ -1568,8 +1580,20 @@ brd_input:
[]
> + do_cache = false;
> + if (res.fi) {
> + if (!(flags & RTCF_DIRECTSRC) && !itag) {
> + rth = FIB_RES_NH(res).nh_rth_input;
> + if (rth) {
> + dst_use(&rth->dst, jiffies);
> + goto set_and_out;
> + }
> + do_cache = true;
> + }
> + }
Maybe a helper like:
if (some_do_cache_name(rth, res, itag, flags, &do_cache))
goto foo;
next prev parent reply other threads:[~2012-07-18 19:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-18 18:24 [PATCH 10/15] ipv4: Cache input routes in fib_info nexthops David Miller
2012-07-18 19:27 ` Joe Perches [this message]
2012-07-18 19:30 ` David Miller
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=1342639675.2013.18.camel@joe2Laptop \
--to=joe@perches.com \
--cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.