summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2008-04-16[NETNS]: Make netns refconting debug like a socket one.Denis V. Lunev2-16/+28
Make release_net/hold_net noop for performance-hungry people. This is a debug staff and should be used in the debug mode only. Add check for net != NULL in hold/release calls. This will be required later on. [ Added minor simplifications suggested by Brian Haley. -DaveM ] Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IP6TUNNEL]: Allow to create IP6 tunnels in net namespaces.Pavel Emelyanov1-0/+3
And no need in some IPPROTO_XXX enabling, since ipv6 code doesn't have any filtering. So, just set proper net and mark device with NETNS_LOCAL. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IP6TUNNEL]: Use proper net instead of init_net stubs.Pavel Emelyanov1-11/+15
All the ip_route_output_key(), dev_get_by_...() and ipv6_chk_addr() calls are now stubbed with init_net. Fortunately, all the places already have where to get the proper net from. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IP6TUNNEL]: Make tunnels hashes per-net.Pavel Emelyanov1-29/+34
Move hashes in the struct ip6_tnl_net, replace tnls_xxx[] with ip6n->tnlx_xxx[] and handle init and exit appropriately. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IP6TUNNEL]: Make the fallback tunnel device per-net.Pavel Emelyanov1-24/+24
All the code, that reference it already has the ip6_tnl_net pointer, so s/ip6_fb_tnl_dev/ip6n->fb_tnl_dev/ and move creation/releasing code into net init/exit ops. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IP6TUNNEL]: Use proper net in hash-lookup functions.Pavel Emelyanov1-2/+2
Calls to ip6_tnl_lookup were stubbed with init_net - give them a proper one. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IP6TUNNEL]: Add (ip6_tnl_)net argument to some calls.Pavel Emelyanov1-19/+28
Hashes and fallback device used in them will be per-net. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IP6TUNNEL]: Introduce empty ip6_tnl_net structure and net ops.Pavel Emelyanov1-0/+49
Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[SIT]: Allow for IPPROTO_IPV6 protocol in namespaces.Pavel Emelyanov1-0/+1
This makes sit-generated traffic enter the namespace. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[SIT]: Allow to create SIT tunnels in net namespaces.Pavel Emelyanov1-0/+3
Set proper net and mark a new device as NETNS_LOCAL before registering. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[SIT]: Use proper net in routing calls.Pavel Emelyanov1-5/+6
I.e. replace init_net stubs in ip_route_output_key() calls. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[SIT]: Make tunnels hashes per-net.Pavel Emelyanov1-20/+25
Just move all the hashes on the sit_net structure and patch the rest of the code appropriately. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[SIT]: Make the fallback tunnel device per-netPavel Emelyanov1-32/+29
Allocate and register one in sit_init_net, use sitn->fb_tunnel_dev over the code and unregister one in sit_exit_net. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[SIT]: Use proper net in hash-lookup functions.Pavel Emelyanov1-2/+2
Replace introduced in the previous patch init_net stubs with the proper net pointer. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[SIT]: Add net/sit_net argument to some functions.Pavel Emelyanov1-19/+30
... to make them prepared for future hashes and fallback device move on the struct sit_net. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[SIT]: Introduce empty struct sit_net and init/exit net ops.Pavel Emelyanov1-0/+50
Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[GRE]: Allow for IPPROTO_GRE protocol in namespaces.Pavel Emelyanov1-0/+1
This one was also disabled by default for sanity. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[GRE]: Allow to create IPGRE tunnels in net namespaces.Pavel Emelyanov1-0/+3
I.e. set the proper net and mark as NETNS_LOCAL. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[GRE]: Use proper net in routing calls.Pavel Emelyanov1-6/+6
As for the IPIP tunnel, there are some ip_route_output_key() calls in there that require a proper net so give one to them. And a proper net for the __get_dev_by_index hanging around. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[GRE]: Make tunnels hashes per-net.Pavel Emelyanov1-34/+31
Very similar to what was done for the IPIP code. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[GRE]: Make the fallback tunnel device per-net.Pavel Emelyanov1-31/+32
Everything is prepared for this change now. Create on in init callback, use it over the code and destroy on net exit. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[GRE]: Use proper net in hash-lookup functions.Pavel Emelyanov1-2/+2
This is the part#2 of the patch #2 - get the proper net for these functions. This change in a separate patch in order not to get lost in a large previous patch. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[GRE]: Add net/gre_net argument to some functions.Pavel Emelyanov1-19/+32
The fallback device and hashes are to become per-net, but many code doesn't have anything to get the struct net pointer from. So pass the proper net there with an extra argument. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[GRE]: Introduce empty ipgre_net structure and net init/exit ops.Pavel Emelyanov1-0/+49
Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IPIP]: Allow for IPPROTO_IPIP protocol in namespaces.Pavel Emelyanov1-0/+1
This one was disabled by default for sanity. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IPIP]: Allow to create IPIP tunnels in net namespaces.Pavel Emelyanov1-0/+3
Set the proper net before calling register_netdev and disable the tunnel device netns changing. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IPIP]: Use proper net in (mostly) routing calls.Pavel Emelyanov1-5/+5
There are some ip_route_output_key() calls in there that require a proper net so give one to them. Besides - give a proper net to a single __get_dev_by_index call in ipip_tunnel_bind_dev(). Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IPIP]: Make tunnels hashes per net.Pavel Emelyanov1-32/+36
Either net or ipip_net already exists in all the required places, so just use one. Besides, tune net_init and net_exit calls to respectively initialize the hashes and destroy devices. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IPIP]: Use proper net in hash-lookup functions.Pavel Emelyanov1-2/+2
This is the part#2 of the previous patch - get the proper net for these functions. I make it in a separate patch, so that this change does not get lost in a large previous patch. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IPIP]: Add net/ipip_net argument to some functions.Pavel Emelyanov1-19/+25
The hashes of tunnels will be per-net too, so prepare all the functions that uses them for this change by adding an argument. Use init_net temporarily in places, where the net does not exist explicitly yet. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IPIP]: Make the fallback tunnel device per-net.Pavel Emelyanov1-32/+35
Create on in ipip_init_net(), use it all over the code (the proper place to get the net from already exists) and destroy in ipip_net_exit(). Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[IPIP]: Introduce empty ipip_net structure and net init/exit ops.Pavel Emelyanov1-0/+50
Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[VLAN]: Handle vlan devices net namespace changing.Pavel Emelyanov1-5/+8
When van device is moved to another namespace proc files, related to this device, should also change one. Use the netdev REGISTER and UNREGISTER event handlers for this. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[VLAN]: Allow vlan devices registration in net namespaces.Pavel Emelyanov3-8/+4
This one is similar to what I've done for TUN - set the proper net after device allocation and clean VLANs on net exit (use the rtnl_kill_links helper finally). Plus, drop explicit init_net usage and net != &init_net checks. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[VLAN]: Make the vlan_name_type per-net.Pavel Emelyanov3-9/+16
This includes moving one on the struct vlan_net and s/vlan_name_type/vn->name_type/ over the code. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[VLAN]: Make the /proc/net/vlan/conf file show per-net info.Pavel Emelyanov1-5/+8
It is created in a proper net, so make is show info, related to this particular net. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[VLAN]: Create proc entries in the proper net.Pavel Emelyanov2-27/+23
The proc_vlan_dir and proc_vlan_conf migrate on the struct vlan_net and their creation uses the struct net. The devices' entries use the corresponding device's net. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[VLAN]: Add a net argument to proc init and cleanup calls.Pavel Emelyanov3-15/+22
All proc files will be created in each net, so prepare them for this change now, not to mess it with real creation patch. The net != &init_net checks in them are for git-bisect sanity, but I will drop them soon. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[VLAN]: Introduce the vlan_net structure and init/exit net ops.Pavel Emelyanov2-0/+51
Unlike TUN, it is empty from the very beginning, and will be eventually populated later. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[VLAN]: Tag vlan_group_device with net device, not ifindex.Pavel Emelyanov2-12/+14
Currently vlan group is searched using one key - the ifindex. We'll have to lookup the vlan_group by two keys - ifindex and net. Turning the vlan_group lookup key to struct net_device pointer will make this process easier. Besides, this will eliminate one more place in the networking, that assumes that indexes are unique in the kernel. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[RTNL]: Introduce the rtnl_kill_links helper.Pavel Emelyanov2-8/+22
This one is responsible for calling ->dellink on each net device found in net to help with vlan net_exit hook in the nearest future. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[RTNL]: Relax for_each_netdev_safe in __rtnl_link_unregister.Pavel Emelyanov1-2/+2
Each potential list_del (happening from inside a ->dellink call) is followed by goto restart, so there's no need in _safe iteration. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[TUN]: Allow to register tun devices in namespace.Pavel Emelyanov1-0/+4
This is basically means that a net is set for a new device, but actually also involves two more steps: 1. mark the tun device as "local", i.e. do not allow for it to move across namespaces. This is done so, since tun device is most often associated to some file (and thus to some process) and moving the device alone is not valid while keeping the file and the process outside. The need in ability to move a detached persistent device is to be investigated later. 2. get the tun device's net when tun becomes attached and put one when it becomes detached. This is needed to handle the case when a task owning the tun dies, but a files lives for some more time - in this case we must not allow for net to be freed, since its exit hook will spoil that file's private data by unregistering the tun from under tun_chr_close. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[TUN]: Make the tun_dev_list per-net.Pavel Emelyanov1-18/+19
Remove the static tun_dev_list and replace its occurrences in driver with per-net one. It is used in two places - in tun_set_iff and tun_cleanup. In the first case it's legal to use current net_ns. In the cleanup call - move the loop, that unregisters all devices in net exit hook. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[TUN]: Introduce the tun_net structure and init/exit net ops.Pavel Emelyanov1-1/+52
This is the first step in making tuntap devices work in net namespaces. The structure mentioned is pointed by generic net pointer with tun_net_id id, and tun driver fills one on its load. It will contain only the tun devices list. So declare this structure and introduce net init and exit hooks. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[TCP]: Remove superflushious skb == write_queue_tail() checkIlpo Järvinen1-1/+1
Needed can only be more strict than what was checked by the earlier common case check for non-tail skbs, thus cwnd_len <= needed will never match in that case anyway. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[ETHTOOL]: Add support for large eepromsMandeep Singh Baines1-28/+36
Currently, it is not possible to read/write to an eeprom larger than 128k in size because the buffer used for temporarily storing the eeprom contents is allocated using kmalloc. kmalloc can only allocate a maximum of 128k depending on architecture. Modified ethtool_get/set_eeprom to only allocate a page of memory and then copy the eeprom a page at a time. Updated original patch as per suggestions from Joe Perches. Signed-off-by: Mandeep Singh Baines <msb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16CAN: use hrtimers in can-bcm protocolOliver Hartkopp1-121/+130
Make use of hrtimers to support high resolution capabilities, when provided by the system clocksource. The conversion to hrtimers additionally discovered and solved an unlikely race condition that has been reproduced under (unrealistic) massive receive load, which can only be produced on vcan software devices. [ Fix printf format warnings on 64-bit -DaveM ] Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[TIPC]: Enhance validation of format on incoming messagesAllan Stephens1-12/+77
This patch ensures that TIPC properly handles incoming messages that have incorrect or unexpected formats. Most significantly, it now ensures that each sl_buff has at least as much data as the message header indicates it should, and that the entire message header is stored contiguously; this prevents TIPC from accidentally accessing memory that is not part of the sk_buff. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-16[TIPC]: Force linearization of non-linear sk_buffsAllan Stephens2-0/+18
This patch allows TIPC to process incoming messages that are stored in a fragmented sk_buff, by forcing the linearization of any such messages it receives. Note: This is an interim solution to allow TIPC to operate with Ethernet devices that generate non-linear buffers (such as the gianfar driver), until such time as the rest of TIPC is enhanced to handle sk_buffs with multiple data areas. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>