route.c (862b82c6f960cc61274d370aa78ce1112f92a83e) route.c (8dbde28d9711475adfe0e9c88505e38743cdc2a7)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * ROUTE - implementation of the IP router.
7 *
8 * Version: $Id: route.c,v 1.103 2002/01/12 07:44:09 davem Exp $

--- 2844 unchanged lines hidden (view full) ---

2853 .proc_handler = &proc_dointvec_jiffies,
2854 .strategy = &sysctl_jiffies,
2855 },
2856 { .ctl_name = 0 }
2857};
2858#endif
2859
2860#ifdef CONFIG_NET_CLS_ROUTE
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * ROUTE - implementation of the IP router.
7 *
8 * Version: $Id: route.c,v 1.103 2002/01/12 07:44:09 davem Exp $

--- 2844 unchanged lines hidden (view full) ---

2853 .proc_handler = &proc_dointvec_jiffies,
2854 .strategy = &sysctl_jiffies,
2855 },
2856 { .ctl_name = 0 }
2857};
2858#endif
2859
2860#ifdef CONFIG_NET_CLS_ROUTE
2861struct ip_rt_acct *ip_rt_acct;
2861struct ip_rt_acct *ip_rt_acct __read_mostly;
2862
2862
2863/* This code sucks. But you should have seen it before! --RR */
2864
2865/* IP route accounting ptr for this logical cpu number. */
2863/* IP route accounting ptr for this logical cpu number. */
2866#define IP_RT_ACCT_CPU(i) (ip_rt_acct + i * 256)
2864#define IP_RT_ACCT_CPU(cpu) (per_cpu_ptr(ip_rt_acct, cpu))
2867
2868#ifdef CONFIG_PROC_FS
2869static int ip_rt_acct_read(char *buffer, char **start, off_t offset,
2870 int length, int *eof, void *data)
2871{
2872 unsigned int i;
2873
2874 if ((offset & 3) || (length & 3))

--- 43 unchanged lines hidden (view full) ---

2918int __init ip_rt_init(void)
2919{
2920 int rc = 0;
2921
2922 rt_hash_rnd = (int) ((num_physpages ^ (num_physpages>>8)) ^
2923 (jiffies ^ (jiffies >> 7)));
2924
2925#ifdef CONFIG_NET_CLS_ROUTE
2865
2866#ifdef CONFIG_PROC_FS
2867static int ip_rt_acct_read(char *buffer, char **start, off_t offset,
2868 int length, int *eof, void *data)
2869{
2870 unsigned int i;
2871
2872 if ((offset & 3) || (length & 3))

--- 43 unchanged lines hidden (view full) ---

2916int __init ip_rt_init(void)
2917{
2918 int rc = 0;
2919
2920 rt_hash_rnd = (int) ((num_physpages ^ (num_physpages>>8)) ^
2921 (jiffies ^ (jiffies >> 7)));
2922
2923#ifdef CONFIG_NET_CLS_ROUTE
2926 {
2927 int order;
2928 for (order = 0;
2929 (PAGE_SIZE << order) < 256 * sizeof(struct ip_rt_acct) * NR_CPUS; order++)
2930 /* NOTHING */;
2931 ip_rt_acct = (struct ip_rt_acct *)__get_free_pages(GFP_KERNEL, order);
2924 ip_rt_acct = __alloc_percpu(256 * sizeof(struct ip_rt_acct));
2932 if (!ip_rt_acct)
2933 panic("IP: failed to allocate ip_rt_acct\n");
2925 if (!ip_rt_acct)
2926 panic("IP: failed to allocate ip_rt_acct\n");
2934 memset(ip_rt_acct, 0, PAGE_SIZE << order);
2935 }
2936#endif
2937
2938 ipv4_dst_ops.kmem_cachep =
2939 kmem_cache_create("ip_dst_cache", sizeof(struct rtable), 0,
2940 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
2941
2942 ipv4_dst_blackhole_ops.kmem_cachep = ipv4_dst_ops.kmem_cachep;
2943

--- 58 unchanged lines hidden ---
2927#endif
2928
2929 ipv4_dst_ops.kmem_cachep =
2930 kmem_cache_create("ip_dst_cache", sizeof(struct rtable), 0,
2931 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
2932
2933 ipv4_dst_blackhole_ops.kmem_cachep = ipv4_dst_ops.kmem_cachep;
2934

--- 58 unchanged lines hidden ---