From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] ipv4: Get peer more cheaply in rt_init_metrics().
Date: Sat, 05 Mar 2011 07:46:44 +0100 [thread overview]
Message-ID: <1299307604.2758.67.camel@edumazet-laptop> (raw)
In-Reply-To: <20110304.212636.226786422.davem@davemloft.net>
Le vendredi 04 mars 2011 à 21:26 -0800, David Miller écrit :
> We know this is a new route object, so doing atomics and
> stuff makes no sense at all.
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
> net/ipv4/route.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 6c87403..9794a2c 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -1759,9 +1759,9 @@ static void rt_init_metrics(struct rtable *rt, struct fib_info *fi)
> if (rt->fl.flags & FLOWI_FLAG_PRECOW_METRICS)
> create = 1;
>
> - rt_bind_peer(rt, create);
> - peer = rt->peer;
> + rt->peer = peer = inet_getpeer_v4(rt->rt_dst, create);
> if (peer) {
> + rt->rt_peer_genid = rt_peer_genid();
> if (inet_metrics_new(peer))
> memcpy(peer->metrics, fi->fib_metrics,
> sizeof(u32) * RTAX_MAX);
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
prev parent reply other threads:[~2011-03-05 6:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-05 5:26 [PATCH] ipv4: Get peer more cheaply in rt_init_metrics() David Miller
2011-03-05 6:46 ` Eric Dumazet [this message]
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=1299307604.2758.67.camel@edumazet-laptop \
--to=eric.dumazet@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox