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 = {
.llseek = seq_lseek,
.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 */
/* ->ioctl are set at pppox_create */
......@@ -1111,26 +1125,18 @@ static int __init pppoe_init(void)
if (err)
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;
err = pppoe_proc_init();
if (err) {
unregister_pppox_proto(PX_PROTO_OE);
goto out;
}
p->proc_fops = &pppoe_seq_fops;
err = 0;
}
#endif /* CONFIG_PROC_FS */
dev_add_pack(&pppoes_ptype);
dev_add_pack(&pppoed_ptype);
register_netdevice_notifier(&pppoe_notifier);
out:
return err;
out_unregister:
unregister_pppox_proto(PX_PROTO_OE);
goto out;
}
static void __exit pppoe_exit(void)
......@@ -1139,9 +1145,7 @@ static void __exit pppoe_exit(void)
dev_remove_pack(&pppoes_ptype);
dev_remove_pack(&pppoed_ptype);
unregister_netdevice_notifier(&pppoe_notifier);
#ifdef CONFIG_PROC_FS
remove_proc_entry("pppoe", proc_net);
#endif
}
module_init(pppoe_init);
......
......@@ -274,9 +274,6 @@ struct sk_buff {
*end;
};
#define SK_WMEM_MAX 65535
#define SK_RMEM_MAX 65535
#ifdef __KERNEL__
/*
* Handling routines are only of interest to the kernel
......
......@@ -37,10 +37,4 @@ struct ipv6_tlv_tnl_enc_lim {
__u8 encap_limit; /* tunnel encapsulation limit */
} __attribute__ ((packed));
#ifdef __KERNEL__
#ifdef CONFIG_IPV6_TUNNEL
extern int __init ip6_tunnel_init(void);
extern void ip6_tunnel_cleanup(void);
#endif
#endif
#endif
......@@ -45,8 +45,6 @@ struct ip_tunnel
} while (0)
extern int ipip_init(void);
extern int ipgre_init(void);
extern int sit_init(void);
extern void sit_cleanup(void);
......
......@@ -1167,6 +1167,10 @@ void neigh_table_init(struct neigh_table *tbl)
tbl->entry_size,
0, SLAB_HWCACHE_ALIGN,
NULL, NULL);
if (!tbl->kmem_cachep)
panic("cannot create neighbour cache");
tbl->lock = RW_LOCK_UNLOCKED;
init_timer(&tbl->gc_timer);
tbl->gc_timer.data = (unsigned long)tbl;
......
......@@ -126,6 +126,16 @@
#include <net/tcp.h>
#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. */
__u32 sysctl_wmem_max = SK_WMEM_MAX;
__u32 sysctl_rmem_max = SK_RMEM_MAX;
......
......@@ -26,6 +26,7 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/net.h>
#include <linux/netdevice.h>
......@@ -1470,16 +1471,13 @@ static struct rtnetlink_link dnet_rtnetlink_table[RTM_MAX-RTM_BASE+1] =
};
#ifdef MODULE
static int addr[2];
MODULE_PARM(addr, "2i");
static int __initdata addr[2];
static int __initdata num;
module_param_array(addr, int, num, 0444);
MODULE_PARM_DESC(addr, "The DECnet address of this machine: area,node");
#endif
void __init dn_dev_init(void)
{
#ifdef MODULE
if (addr[0] > 63 || addr[0] < 0) {
printk(KERN_ERR "DECnet: Area must be between 0 and 63");
return;
......@@ -1491,7 +1489,6 @@ void __init dn_dev_init(void)
}
decnet_address = dn_htons((addr[0] << 10) | addr[1]);
#endif
dn_dev_devices_on();
#ifdef CONFIG_DECNET_SIOCGIFCONF
......@@ -1531,18 +1528,3 @@ void __exit dn_dev_cleanup(void)
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)
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
*/
......
......@@ -1115,7 +1115,13 @@ void __init icmp_init(struct net_proto_family *ops)
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_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->uc_ttl = -1;
inet->pmtudisc = IP_PMTUDISC_DONT;
......
......@@ -129,6 +129,9 @@ void __init inet_initpeers(void)
0, SLAB_HWCACHE_ALIGN,
NULL, NULL);
if (!peer_cachep)
panic("cannot create inet_peer_cache");
/* All the timers, started at system startup tend
to synchronize. Perturb it a bit.
*/
......
......@@ -1250,7 +1250,7 @@ static struct inet_protocol ipgre_protocol = {
* And now the modules code and kernel interface.
*/
int __init ipgre_init(void)
static int __init ipgre_init(void)
{
int err = -EINVAL;
......@@ -1288,8 +1288,6 @@ void ipgre_fini(void)
unregister_netdev(ipgre_fb_tunnel_dev);
}
#ifdef MODULE
module_init(ipgre_init);
#endif
module_exit(ipgre_fini);
MODULE_LICENSE("GPL");
......@@ -872,7 +872,7 @@ static struct xfrm_tunnel ipip_handler = {
static char banner[] __initdata =
KERN_INFO "IPv4 over IPv4 tunneling driver\n";
int __init ipip_init(void)
static int __init ipip_init(void)
{
int err;
......@@ -911,8 +911,6 @@ static void __exit ipip_fini(void)
unregister_netdev(ipip_fb_tunnel_dev);
}
#ifdef MODULE
module_init(ipip_init);
#endif
module_exit(ipip_fini);
MODULE_LICENSE("GPL");
......@@ -1892,6 +1892,9 @@ void __init ip_mr_init(void)
sizeof(struct mfc_cache),
0, SLAB_HWCACHE_ALIGN,
NULL, NULL);
if (!mrt_cachep)
panic("cannot allocate ip_mrt_cache");
init_timer(&ipmr_expire_timer);
ipmr_expire_timer.function=ipmr_expire_process;
register_netdevice_notifier(&ip_mr_notifier);
......
......@@ -63,12 +63,6 @@
#include <asm/uaccess.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_DESCRIPTION("IPv6 protocol stack for Linux");
MODULE_LICENSE("GPL");
......@@ -557,17 +551,6 @@ struct net_proto_family inet6_family_ops = {
.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
extern void ipv6_sysctl_register(void);
extern void ipv6_sysctl_unregister(void);
......@@ -788,11 +771,6 @@ static int __init inet6_init(void)
err = ndisc_init(&inet6_family_ops);
if (err)
goto ndisc_fail;
#ifdef CONFIG_IPV6_TUNNEL
err = ip6_tunnel_init();
if (err)
goto ip6_tunnel_fail;
#endif
err = igmp6_init(&inet6_family_ops);
if (err)
goto igmp_fail;
......@@ -846,10 +824,6 @@ static int __init inet6_init(void)
igmp6_cleanup();
#endif
igmp_fail:
#ifdef CONFIG_IPV6_TUNNEL
ip6_tunnel_cleanup();
ip6_tunnel_fail:
#endif
ndisc_cleanup();
ndisc_fail:
icmpv6_cleanup();
......@@ -882,9 +856,6 @@ static void __exit inet6_exit(void)
ip6_route_cleanup();
ipv6_packet_cleanup();
igmp6_cleanup();
#ifdef CONFIG_IPV6_TUNNEL
ip6_tunnel_cleanup();
#endif
ndisc_cleanup();
icmpv6_cleanup();
#ifdef CONFIG_SYSCTL
......
......@@ -693,7 +693,13 @@ int __init icmpv6_init(struct net_proto_family *ops)
sk = per_cpu(__icmpv6_socket, i)->sk;
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);
}
......
......@@ -1239,6 +1239,8 @@ void __init fib6_init(void)
sizeof(struct fib6_node),
0, SLAB_HWCACHE_ALIGN,
NULL, NULL);
if (!fib6_node_kmem)
panic("cannot create fib6_nodes cache");
}
void __exit fib6_gc_cleanup(void)
......
......@@ -1100,7 +1100,7 @@ static struct inet6_protocol ip6ip6_protocol = {
* Return: 0 on success
**/
int __init ip6_tunnel_init(void)
static int __init ip6_tunnel_init(void)
{
int err;
......@@ -1131,13 +1131,11 @@ int __init ip6_tunnel_init(void)
* 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);
inet6_del_protocol(&ip6ip6_protocol, IPPROTO_IPV6);
}
#ifdef MODULE
module_init(ip6_tunnel_init);
module_exit(ip6_tunnel_cleanup);
#endif
......@@ -1988,6 +1988,9 @@ void __init ip6_route_init(void)
sizeof(struct rt6_info),
0, SLAB_HWCACHE_ALIGN,
NULL, NULL);
if (!ip6_dst_ops.kmem_cachep)
panic("cannot create ip6_dst_cache");
fib6_init();
#ifdef CONFIG_PROC_FS
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