aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip_fib.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-06-29 04:32:45 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-29 04:36:36 -0400
commit7a9bc9b81a5bc6e44ebc80ef781332e4385083f2 (patch)
tree1342c672823d47bfb112fee63951af9f6a3eb590 /include/net/ip_fib.h
parentb8c8430726e5bd552e01dacc5a44f3f83f7446ca (diff)
ipv4: Elide fib_validate_source() completely when possible.
If rpfilter is off (or the SKB has an IPSEC path) and there are not tclassid users, we don't have to do anything at all when fib_validate_source() is invoked besides setting the itag to zero. We monitor tclassid uses with a counter (modified only under RTNL and marked __read_mostly) and we protect the fib_validate_source() real work with a test against this counter and whether rpfilter is to be done. Having a way to know whether we need no tclassid processing or not also opens the door for future optimized rpfilter algorithms that do not perform full FIB lookups. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip_fib.h')
-rw-r--r--include/net/ip_fib.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 619f68a7185c..3dc7c96bbeab 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -235,6 +235,11 @@ extern int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst,
235 u8 tos, int oif, struct net_device *dev, 235 u8 tos, int oif, struct net_device *dev,
236 struct in_device *idev, u32 *itag); 236 struct in_device *idev, u32 *itag);
237extern void fib_select_default(struct fib_result *res); 237extern void fib_select_default(struct fib_result *res);
238#ifdef CONFIG_IP_ROUTE_CLASSID
239extern int fib_num_tclassid_users;
240#else
241#define fib_num_tclassid_users 0
242#endif
238 243
239/* Exported by fib_semantics.c */ 244/* Exported by fib_semantics.c */
240extern int ip_fib_check_default(__be32 gw, struct net_device *dev); 245extern int ip_fib_check_default(__be32 gw, struct net_device *dev);