diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-26 07:14:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-26 18:50:39 -0400 |
commit | c6cffba4ffa26a8ffacd0bb9f3144e34f20da7de (patch) | |
tree | b67532a74343d42bcf8784b8e32d7cf6d69313db /include/net/route.h | |
parent | 4487e64de63b8e42efe5a5543871c42c5a5859d9 (diff) |
ipv4: Fix input route performance regression.
With the routing cache removal we lost the "noref" code paths on
input, and this can kill some routing workloads.
Reinstate the noref path when we hit a cached route in the FIB
nexthops.
With help from Eric Dumazet.
Reported-by: Alexander Duyck <alexander.duyck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/route.h')
-rw-r--r-- | include/net/route.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/include/net/route.h b/include/net/route.h index c29ef2733f2d..8c52bc6f1c90 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <net/inet_sock.h> | 30 | #include <net/inet_sock.h> |
31 | #include <linux/in_route.h> | 31 | #include <linux/in_route.h> |
32 | #include <linux/rtnetlink.h> | 32 | #include <linux/rtnetlink.h> |
33 | #include <linux/rcupdate.h> | ||
33 | #include <linux/route.h> | 34 | #include <linux/route.h> |
34 | #include <linux/ip.h> | 35 | #include <linux/ip.h> |
35 | #include <linux/cache.h> | 36 | #include <linux/cache.h> |
@@ -157,8 +158,22 @@ static inline struct rtable *ip_route_output_gre(struct net *net, struct flowi4 | |||
157 | return ip_route_output_key(net, fl4); | 158 | return ip_route_output_key(net, fl4); |
158 | } | 159 | } |
159 | 160 | ||
160 | extern int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src, | 161 | extern int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 src, |
161 | u8 tos, struct net_device *devin); | 162 | u8 tos, struct net_device *devin); |
163 | |||
164 | static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src, | ||
165 | u8 tos, struct net_device *devin) | ||
166 | { | ||
167 | int err; | ||
168 | |||
169 | rcu_read_lock(); | ||
170 | err = ip_route_input_noref(skb, dst, src, tos, devin); | ||
171 | if (!err) | ||
172 | skb_dst_force(skb); | ||
173 | rcu_read_unlock(); | ||
174 | |||
175 | return err; | ||
176 | } | ||
162 | 177 | ||
163 | extern void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu, | 178 | extern void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu, |
164 | int oif, u32 mark, u8 protocol, int flow_flags); | 179 | int oif, u32 mark, u8 protocol, int flow_flags); |