Commit 6302eefc authored by David S. Miller's avatar David S. Miller

Merge davem@nuts.davemloft.net:/disk1/BK/net-2.6

into kernel.bkbits.net:/home/davem/net-2.6
parents 5d12615b 0cf37130
...@@ -1075,6 +1075,20 @@ static struct file_operations pppoe_seq_fops = { ...@@ -1075,6 +1075,20 @@ static struct file_operations pppoe_seq_fops = {
.llseek = seq_lseek, .llseek = seq_lseek,
.release = seq_release, .release = seq_release,
}; };
static int __init pppoe_proc_init(void)
{
struct proc_dir_entry *p;
p = create_proc_entry("pppoe", S_IRUGO, proc_net);
if (!p)
return -ENOMEM;
p->proc_fops = &pppoe_seq_fops;
return 0;
}
#else /* CONFIG_PROC_FS */
static inline int pppoe_proc_init(void) { return 0; }
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_PROC_FS */
/* ->ioctl are set at pppox_create */ /* ->ioctl are set at pppox_create */
...@@ -1111,26 +1125,18 @@ static int __init pppoe_init(void) ...@@ -1111,26 +1125,18 @@ static int __init pppoe_init(void)
if (err) if (err)
goto out; goto out;
#ifdef CONFIG_PROC_FS
{
struct proc_dir_entry *p = create_proc_entry("pppoe", S_IRUGO,
proc_net);
err = -ENOMEM;
if (!p)
goto out_unregister;
p->proc_fops = &pppoe_seq_fops; err = pppoe_proc_init();
err = 0; if (err) {
} unregister_pppox_proto(PX_PROTO_OE);
#endif /* CONFIG_PROC_FS */ goto out;
}
dev_add_pack(&pppoes_ptype); dev_add_pack(&pppoes_ptype);
dev_add_pack(&pppoed_ptype); dev_add_pack(&pppoed_ptype);
register_netdevice_notifier(&pppoe_notifier); register_netdevice_notifier(&pppoe_notifier);
out: out:
return err; return err;
out_unregister:
unregister_pppox_proto(PX_PROTO_OE);
goto out;
} }
static void __exit pppoe_exit(void) static void __exit pppoe_exit(void)
...@@ -1139,9 +1145,7 @@ static void __exit pppoe_exit(void) ...@@ -1139,9 +1145,7 @@ static void __exit pppoe_exit(void)
dev_remove_pack(&pppoes_ptype); dev_remove_pack(&pppoes_ptype);
dev_remove_pack(&pppoed_ptype); dev_remove_pack(&pppoed_ptype);
unregister_netdevice_notifier(&pppoe_notifier); unregister_netdevice_notifier(&pppoe_notifier);
#ifdef CONFIG_PROC_FS
remove_proc_entry("pppoe", proc_net); remove_proc_entry("pppoe", proc_net);
#endif
} }
module_init(pppoe_init); module_init(pppoe_init);
......
...@@ -274,9 +274,6 @@ struct sk_buff { ...@@ -274,9 +274,6 @@ struct sk_buff {
*end; *end;
}; };
#define SK_WMEM_MAX 65535
#define SK_RMEM_MAX 65535
#ifdef __KERNEL__ #ifdef __KERNEL__
/* /*
* Handling routines are only of interest to the kernel * Handling routines are only of interest to the kernel
......
...@@ -37,10 +37,4 @@ struct ipv6_tlv_tnl_enc_lim { ...@@ -37,10 +37,4 @@ struct ipv6_tlv_tnl_enc_lim {
__u8 encap_limit; /* tunnel encapsulation limit */ __u8 encap_limit; /* tunnel encapsulation limit */
} __attribute__ ((packed)); } __attribute__ ((packed));
#ifdef __KERNEL__
#ifdef CONFIG_IPV6_TUNNEL
extern int __init ip6_tunnel_init(void);
extern void ip6_tunnel_cleanup(void);
#endif
#endif
#endif #endif
...@@ -45,8 +45,6 @@ struct ip_tunnel ...@@ -45,8 +45,6 @@ struct ip_tunnel
} while (0) } while (0)
extern int ipip_init(void);
extern int ipgre_init(void);
extern int sit_init(void); extern int sit_init(void);
extern void sit_cleanup(void); extern void sit_cleanup(void);
......
...@@ -1167,6 +1167,10 @@ void neigh_table_init(struct neigh_table *tbl) ...@@ -1167,6 +1167,10 @@ void neigh_table_init(struct neigh_table *tbl)
tbl->entry_size, tbl->entry_size,
0, SLAB_HWCACHE_ALIGN, 0, SLAB_HWCACHE_ALIGN,
NULL, NULL); NULL, NULL);
if (!tbl->kmem_cachep)
panic("cannot create neighbour cache");
tbl->lock = RW_LOCK_UNLOCKED; tbl->lock = RW_LOCK_UNLOCKED;
init_timer(&tbl->gc_timer); init_timer(&tbl->gc_timer);
tbl->gc_timer.data = (unsigned long)tbl; tbl->gc_timer.data = (unsigned long)tbl;
......
...@@ -126,6 +126,16 @@ ...@@ -126,6 +126,16 @@
#include <net/tcp.h> #include <net/tcp.h>
#endif #endif
/* Take into consideration the size of the struct sk_buff overhead in the
* determination of these values, since that is non-constant across
* platforms. This makes socket queueing behavior and performance
* not depend upon such differences.
*/
#define _SK_MEM_PACKETS 256
#define _SK_MEM_OVERHEAD (sizeof(struct sk_buff) + 256)
#define SK_WMEM_MAX (_SK_MEM_OVERHEAD * _SK_MEM_PACKETS)
#define SK_RMEM_MAX (_SK_MEM_OVERHEAD * _SK_MEM_PACKETS)
/* Run time adjustable parameters. */ /* Run time adjustable parameters. */
__u32 sysctl_wmem_max = SK_WMEM_MAX; __u32 sysctl_wmem_max = SK_WMEM_MAX;
__u32 sysctl_rmem_max = SK_RMEM_MAX; __u32 sysctl_rmem_max = SK_RMEM_MAX;
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/net.h> #include <linux/net.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
...@@ -1470,16 +1471,13 @@ static struct rtnetlink_link dnet_rtnetlink_table[RTM_MAX-RTM_BASE+1] = ...@@ -1470,16 +1471,13 @@ static struct rtnetlink_link dnet_rtnetlink_table[RTM_MAX-RTM_BASE+1] =
}; };
#ifdef MODULE static int __initdata addr[2];
static int addr[2]; static int __initdata num;
module_param_array(addr, int, num, 0444);
MODULE_PARM(addr, "2i");
MODULE_PARM_DESC(addr, "The DECnet address of this machine: area,node"); MODULE_PARM_DESC(addr, "The DECnet address of this machine: area,node");
#endif
void __init dn_dev_init(void) void __init dn_dev_init(void)
{ {
#ifdef MODULE
if (addr[0] > 63 || addr[0] < 0) { if (addr[0] > 63 || addr[0] < 0) {
printk(KERN_ERR "DECnet: Area must be between 0 and 63"); printk(KERN_ERR "DECnet: Area must be between 0 and 63");
return; return;
...@@ -1491,7 +1489,6 @@ void __init dn_dev_init(void) ...@@ -1491,7 +1489,6 @@ void __init dn_dev_init(void)
} }
decnet_address = dn_htons((addr[0] << 10) | addr[1]); decnet_address = dn_htons((addr[0] << 10) | addr[1]);
#endif
dn_dev_devices_on(); dn_dev_devices_on();
#ifdef CONFIG_DECNET_SIOCGIFCONF #ifdef CONFIG_DECNET_SIOCGIFCONF
...@@ -1531,18 +1528,3 @@ void __exit dn_dev_cleanup(void) ...@@ -1531,18 +1528,3 @@ void __exit dn_dev_cleanup(void)
dn_dev_devices_off(); dn_dev_devices_off();
} }
#ifndef MODULE
static int __init decnet_setup(char *str)
{
unsigned short area = simple_strtoul(str, &str, 0);
unsigned short node = simple_strtoul(*str > 0 ? ++str : str, &str, 0);
decnet_address = dn_htons(area << 10 | node);
return 1;
}
__setup("decnet=", decnet_setup);
#endif
...@@ -1167,16 +1167,6 @@ static int __init inet_init(void) ...@@ -1167,16 +1167,6 @@ static int __init inet_init(void)
icmp_init(&inet_family_ops); icmp_init(&inet_family_ops);
/* I wish inet_add_protocol had no constructor hook...
I had to move IPIP from net/ipv4/protocol.c :-( --ANK
*/
#ifdef CONFIG_NET_IPIP
ipip_init();
#endif
#ifdef CONFIG_NET_IPGRE
ipgre_init();
#endif
/* /*
* Initialise the multicast router * Initialise the multicast router
*/ */
......
...@@ -1115,7 +1115,13 @@ void __init icmp_init(struct net_proto_family *ops) ...@@ -1115,7 +1115,13 @@ void __init icmp_init(struct net_proto_family *ops)
panic("Failed to create the ICMP control socket.\n"); panic("Failed to create the ICMP control socket.\n");
per_cpu(__icmp_socket, i)->sk->sk_allocation = GFP_ATOMIC; per_cpu(__icmp_socket, i)->sk->sk_allocation = GFP_ATOMIC;
per_cpu(__icmp_socket, i)->sk->sk_sndbuf = SK_WMEM_MAX * 2;
/* Enough space for 2 64K ICMP packets, including
* sk_buff struct overhead.
*/
per_cpu(__icmp_socket, i)->sk->sk_sndbuf =
(2 * ((64 * 1024) + sizeof(struct sk_buff)));
inet = inet_sk(per_cpu(__icmp_socket, i)->sk); inet = inet_sk(per_cpu(__icmp_socket, i)->sk);
inet->uc_ttl = -1; inet->uc_ttl = -1;
inet->pmtudisc = IP_PMTUDISC_DONT; inet->pmtudisc = IP_PMTUDISC_DONT;
......
...@@ -129,6 +129,9 @@ void __init inet_initpeers(void) ...@@ -129,6 +129,9 @@ void __init inet_initpeers(void)
0, SLAB_HWCACHE_ALIGN, 0, SLAB_HWCACHE_ALIGN,
NULL, NULL); NULL, NULL);
if (!peer_cachep)
panic("cannot create inet_peer_cache");
/* All the timers, started at system startup tend /* All the timers, started at system startup tend
to synchronize. Perturb it a bit. to synchronize. Perturb it a bit.
*/ */
......
...@@ -1250,7 +1250,7 @@ static struct inet_protocol ipgre_protocol = { ...@@ -1250,7 +1250,7 @@ static struct inet_protocol ipgre_protocol = {
* And now the modules code and kernel interface. * And now the modules code and kernel interface.
*/ */
int __init ipgre_init(void) static int __init ipgre_init(void)
{ {
int err = -EINVAL; int err = -EINVAL;
...@@ -1288,8 +1288,6 @@ void ipgre_fini(void) ...@@ -1288,8 +1288,6 @@ void ipgre_fini(void)
unregister_netdev(ipgre_fb_tunnel_dev); unregister_netdev(ipgre_fb_tunnel_dev);
} }
#ifdef MODULE
module_init(ipgre_init); module_init(ipgre_init);
#endif
module_exit(ipgre_fini); module_exit(ipgre_fini);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -872,7 +872,7 @@ static struct xfrm_tunnel ipip_handler = { ...@@ -872,7 +872,7 @@ static struct xfrm_tunnel ipip_handler = {
static char banner[] __initdata = static char banner[] __initdata =
KERN_INFO "IPv4 over IPv4 tunneling driver\n"; KERN_INFO "IPv4 over IPv4 tunneling driver\n";
int __init ipip_init(void) static int __init ipip_init(void)
{ {
int err; int err;
...@@ -911,8 +911,6 @@ static void __exit ipip_fini(void) ...@@ -911,8 +911,6 @@ static void __exit ipip_fini(void)
unregister_netdev(ipip_fb_tunnel_dev); unregister_netdev(ipip_fb_tunnel_dev);
} }
#ifdef MODULE
module_init(ipip_init); module_init(ipip_init);
#endif
module_exit(ipip_fini); module_exit(ipip_fini);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -1892,6 +1892,9 @@ void __init ip_mr_init(void) ...@@ -1892,6 +1892,9 @@ void __init ip_mr_init(void)
sizeof(struct mfc_cache), sizeof(struct mfc_cache),
0, SLAB_HWCACHE_ALIGN, 0, SLAB_HWCACHE_ALIGN,
NULL, NULL); NULL, NULL);
if (!mrt_cachep)
panic("cannot allocate ip_mrt_cache");
init_timer(&ipmr_expire_timer); init_timer(&ipmr_expire_timer);
ipmr_expire_timer.function=ipmr_expire_process; ipmr_expire_timer.function=ipmr_expire_process;
register_netdevice_notifier(&ip_mr_notifier); register_netdevice_notifier(&ip_mr_notifier);
......
...@@ -63,12 +63,6 @@ ...@@ -63,12 +63,6 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/system.h> #include <asm/system.h>
#if 0 /*def MODULE*/
static int unloadable; /* XX: Turn to one when all is ok within the
module for allowing unload */
MODULE_PARM(unloadable, "i");
#endif
MODULE_AUTHOR("Cast of dozens"); MODULE_AUTHOR("Cast of dozens");
MODULE_DESCRIPTION("IPv6 protocol stack for Linux"); MODULE_DESCRIPTION("IPv6 protocol stack for Linux");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -557,17 +551,6 @@ struct net_proto_family inet6_family_ops = { ...@@ -557,17 +551,6 @@ struct net_proto_family inet6_family_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
#ifdef MODULE
#if 0 /* FIXME --RR */
int ipv6_unload(void)
{
if (!unloadable) return 1;
/* We keep internally 3 raw sockets */
return atomic_read(&(__this_module.uc.usecount)) - 3;
}
#endif
#endif
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
extern void ipv6_sysctl_register(void); extern void ipv6_sysctl_register(void);
extern void ipv6_sysctl_unregister(void); extern void ipv6_sysctl_unregister(void);
...@@ -788,11 +771,6 @@ static int __init inet6_init(void) ...@@ -788,11 +771,6 @@ static int __init inet6_init(void)
err = ndisc_init(&inet6_family_ops); err = ndisc_init(&inet6_family_ops);
if (err) if (err)
goto ndisc_fail; goto ndisc_fail;
#ifdef CONFIG_IPV6_TUNNEL
err = ip6_tunnel_init();
if (err)
goto ip6_tunnel_fail;
#endif
err = igmp6_init(&inet6_family_ops); err = igmp6_init(&inet6_family_ops);
if (err) if (err)
goto igmp_fail; goto igmp_fail;
...@@ -846,10 +824,6 @@ static int __init inet6_init(void) ...@@ -846,10 +824,6 @@ static int __init inet6_init(void)
igmp6_cleanup(); igmp6_cleanup();
#endif #endif
igmp_fail: igmp_fail:
#ifdef CONFIG_IPV6_TUNNEL
ip6_tunnel_cleanup();
ip6_tunnel_fail:
#endif
ndisc_cleanup(); ndisc_cleanup();
ndisc_fail: ndisc_fail:
icmpv6_cleanup(); icmpv6_cleanup();
...@@ -882,9 +856,6 @@ static void __exit inet6_exit(void) ...@@ -882,9 +856,6 @@ static void __exit inet6_exit(void)
ip6_route_cleanup(); ip6_route_cleanup();
ipv6_packet_cleanup(); ipv6_packet_cleanup();
igmp6_cleanup(); igmp6_cleanup();
#ifdef CONFIG_IPV6_TUNNEL
ip6_tunnel_cleanup();
#endif
ndisc_cleanup(); ndisc_cleanup();
icmpv6_cleanup(); icmpv6_cleanup();
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
......
...@@ -693,7 +693,13 @@ int __init icmpv6_init(struct net_proto_family *ops) ...@@ -693,7 +693,13 @@ int __init icmpv6_init(struct net_proto_family *ops)
sk = per_cpu(__icmpv6_socket, i)->sk; sk = per_cpu(__icmpv6_socket, i)->sk;
sk->sk_allocation = GFP_ATOMIC; sk->sk_allocation = GFP_ATOMIC;
sk->sk_sndbuf = SK_WMEM_MAX * 2;
/* Enough space for 2 64K ICMP packets, including
* sk_buff struct overhead.
*/
sk->sk_sndbuf =
(2 * ((64 * 1024) + sizeof(struct sk_buff)));
sk->sk_prot->unhash(sk); sk->sk_prot->unhash(sk);
} }
......
...@@ -1239,6 +1239,8 @@ void __init fib6_init(void) ...@@ -1239,6 +1239,8 @@ void __init fib6_init(void)
sizeof(struct fib6_node), sizeof(struct fib6_node),
0, SLAB_HWCACHE_ALIGN, 0, SLAB_HWCACHE_ALIGN,
NULL, NULL); NULL, NULL);
if (!fib6_node_kmem)
panic("cannot create fib6_nodes cache");
} }
void __exit fib6_gc_cleanup(void) void __exit fib6_gc_cleanup(void)
......
...@@ -1100,7 +1100,7 @@ static struct inet6_protocol ip6ip6_protocol = { ...@@ -1100,7 +1100,7 @@ static struct inet6_protocol ip6ip6_protocol = {
* Return: 0 on success * Return: 0 on success
**/ **/
int __init ip6_tunnel_init(void) static int __init ip6_tunnel_init(void)
{ {
int err; int err;
...@@ -1131,13 +1131,11 @@ int __init ip6_tunnel_init(void) ...@@ -1131,13 +1131,11 @@ int __init ip6_tunnel_init(void)
* ip6_tunnel_cleanup - free resources and unregister protocol * ip6_tunnel_cleanup - free resources and unregister protocol
**/ **/
void ip6_tunnel_cleanup(void) static void __exit ip6_tunnel_cleanup(void)
{ {
unregister_netdev(ip6ip6_fb_tnl_dev); unregister_netdev(ip6ip6_fb_tnl_dev);
inet6_del_protocol(&ip6ip6_protocol, IPPROTO_IPV6); inet6_del_protocol(&ip6ip6_protocol, IPPROTO_IPV6);
} }
#ifdef MODULE
module_init(ip6_tunnel_init); module_init(ip6_tunnel_init);
module_exit(ip6_tunnel_cleanup); module_exit(ip6_tunnel_cleanup);
#endif
...@@ -1988,6 +1988,9 @@ void __init ip6_route_init(void) ...@@ -1988,6 +1988,9 @@ void __init ip6_route_init(void)
sizeof(struct rt6_info), sizeof(struct rt6_info),
0, SLAB_HWCACHE_ALIGN, 0, SLAB_HWCACHE_ALIGN,
NULL, NULL); NULL, NULL);
if (!ip6_dst_ops.kmem_cachep)
panic("cannot create ip6_dst_cache");
fib6_init(); fib6_init();
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
p = proc_net_create("ipv6_route", 0, rt6_proc_info); p = proc_net_create("ipv6_route", 0, rt6_proc_info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment