* [PATCH] ipv4: fix counter in_slow_tot
@ 2014-02-17 7:23 Duan Jiong
2014-02-17 21:55 ` David Miller
2014-02-18 21:24 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Duan Jiong @ 2014-02-17 7:23 UTC (permalink / raw)
To: David Miller; +Cc: netdev
since commit 89aef8921bf("ipv4: Delete routing cache."), the counter
in_slow_tot can't work correctly.
The counter in_slow_tot increase by one when fib_lookup() return successfully
in ip_route_input_slow(), but actually the dst struct maybe not be created and
cached, so we can increase in_slow_tot after the dst struct is created.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
net/ipv4/route.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 25071b4..9df3819 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1597,6 +1597,7 @@ static int __mkroute_input(struct sk_buff *skb,
rth->rt_gateway = 0;
rth->rt_uses_gateway = 0;
INIT_LIST_HEAD(&rth->rt_uncached);
+ RT_CACHE_STAT_INC(in_slow_tot);
rth->dst.input = ip_forward;
rth->dst.output = ip_output;
@@ -1698,8 +1699,6 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
if (err != 0)
goto no_route;
- RT_CACHE_STAT_INC(in_slow_tot);
-
if (res.type == RTN_BROADCAST)
goto brd_input;
@@ -1768,6 +1767,7 @@ local_input:
rth->rt_gateway = 0;
rth->rt_uses_gateway = 0;
INIT_LIST_HEAD(&rth->rt_uncached);
+ RT_CACHE_STAT_INC(in_slow_tot);
if (res.type == RTN_UNREACHABLE) {
rth->dst.input= ip_error;
rth->dst.error= -err;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] ipv4: fix counter in_slow_tot
2014-02-17 7:23 [PATCH] ipv4: fix counter in_slow_tot Duan Jiong
@ 2014-02-17 21:55 ` David Miller
2014-02-18 21:24 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-02-17 21:55 UTC (permalink / raw)
To: duanj.fnst; +Cc: netdev
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Date: Mon, 17 Feb 2014 15:23:43 +0800
> since commit 89aef8921bf("ipv4: Delete routing cache."), the counter
> in_slow_tot can't work correctly.
>
> The counter in_slow_tot increase by one when fib_lookup() return successfully
> in ip_route_input_slow(), but actually the dst struct maybe not be created and
> cached, so we can increase in_slow_tot after the dst struct is created.
>
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ipv4: fix counter in_slow_tot
2014-02-17 7:23 [PATCH] ipv4: fix counter in_slow_tot Duan Jiong
2014-02-17 21:55 ` David Miller
@ 2014-02-18 21:24 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-02-18 21:24 UTC (permalink / raw)
To: duanj.fnst; +Cc: netdev
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Date: Mon, 17 Feb 2014 15:23:43 +0800
> since commit 89aef8921bf("ipv4: Delete routing cache."), the counter
> in_slow_tot can't work correctly.
>
> The counter in_slow_tot increase by one when fib_lookup() return successfully
> in ip_route_input_slow(), but actually the dst struct maybe not be created and
> cached, so we can increase in_slow_tot after the dst struct is created.
>
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-18 21:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-17 7:23 [PATCH] ipv4: fix counter in_slow_tot Duan Jiong
2014-02-17 21:55 ` David Miller
2014-02-18 21:24 ` David Miller
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.