[3.11.y.z extended stable] Patch "ipv4: fix counter in_slow_tot" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Wed Feb 26 12:23:57 UTC 2014


This is a note to let you know that I have just added a patch titled

    ipv4: fix counter in_slow_tot

to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From f4575eefc8ef769d8abd36091e7b5c64dd7a3c6e Mon Sep 17 00:00:00 2001
From: Duan Jiong <duanj.fnst at cn.fujitsu.com>
Date: Mon, 17 Feb 2014 15:23:43 +0800
Subject: ipv4: fix counter in_slow_tot

commit a6254864c08109c66a194612585afc0439005286 upstream.

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 at cn.fujitsu.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques at canonical.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 52e15e8..a8bcc22 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1598,6 +1598,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;
@@ -1699,8 +1700,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;

@@ -1769,6 +1768,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.9.0





More information about the kernel-team mailing list