* [PATCH] ipv4: Get peer more cheaply in rt_init_metrics().
@ 2011-03-05 5:26 David Miller
2011-03-05 6:46 ` Eric Dumazet
0 siblings, 1 reply; 2+ messages in thread
From: David Miller @ 2011-03-05 5:26 UTC (permalink / raw)
To: netdev
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);
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ipv4: Get peer more cheaply in rt_init_metrics().
2011-03-05 5:26 [PATCH] ipv4: Get peer more cheaply in rt_init_metrics() David Miller
@ 2011-03-05 6:46 ` Eric Dumazet
0 siblings, 0 replies; 2+ messages in thread
From: Eric Dumazet @ 2011-03-05 6:46 UTC (permalink / raw)
To: David Miller; +Cc: netdev
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-05 6:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox