1. 03 Jun, 2013 1 commit
    • Timo Teräs's avatar
      ipv4: use separate genid for next hop exceptions · 5aad1de5
      Timo Teräs authored
      commit 13d82bf5 (ipv4: Fix flushing of cached routing informations)
      added the support to flush learned pmtu information.
      However, using rt_genid is quite heavy as it is bumped on route
      add/change and multicast events amongst other places. These can
      happen quite often, especially if using dynamic routing protocols.
      While this is ok with routes (as they are just recreated locally),
      the pmtu information is learned from remote systems and the icmp
      notification can come with long delays. It is worthy to have separate
      genid to avoid excessive pmtu resets.
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarTimo Teräs <timo.teras@iki.fi>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  2. 05 Apr, 2013 1 commit
  3. 20 Nov, 2012 1 commit
    • Eric W. Biederman's avatar
      proc: Usable inode numbers for the namespace file descriptors. · 98f842e6
      Eric W. Biederman authored
      Assign a unique proc inode to each namespace, and use that
      inode number to ensure we only allocate at most one proc
      inode for every namespace in proc.
      A single proc inode per namespace allows userspace to test
      to see if two processes are in the same namespace.
      This has been a long requested feature and only blocked because
      a naive implementation would put the id in a global space and
      would ultimately require having a namespace for the names of
      namespaces, making migration and certain virtualization tricks
      We still don't have per superblock inode numbers for proc, which
      appears necessary for application unaware checkpoint/restart and
      migrations (if the application is using namespace file descriptors)
      but that is now allowd by the design if it becomes important.
      I have preallocated the ipc and uts initial proc inode numbers so
      their structures can be statically initialized.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
  4. 18 Nov, 2012 4 commits
  5. 05 Oct, 2012 1 commit
  6. 19 Sep, 2012 1 commit
  7. 18 Sep, 2012 1 commit
  8. 15 Aug, 2012 1 commit
  9. 09 Aug, 2012 2 commits
  10. 16 Jul, 2012 1 commit
    • Andrey Vagin's avatar
      net: make sock diag per-namespace · 51d7cccf
      Andrey Vagin authored
      Before this patch sock_diag works for init_net only and dumps
      information about sockets from all namespaces.
      This patch expands sock_diag for all name-spaces.
      It creates a netlink kernel socket for each netns and filters
      data during dumping.
      v2: filter accoding with netns in all places
          remove an unused variable.
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: James Morris <jmorris@namei.org>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      CC: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarAndrew Vagin <avagin@openvz.org>
      Acked-by: default avatarPavel Emelyanov <xemul@parallels.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  11. 23 Apr, 2012 1 commit
  12. 20 Apr, 2012 4 commits
  13. 11 Dec, 2011 1 commit
  14. 26 Jul, 2011 1 commit
  15. 01 Jul, 2011 1 commit
    • Thomas Graf's avatar
      rtnl: provide link dump consistency info · 4e985ada
      Thomas Graf authored
      This patch adds a change sequence counter to each net namespace
      which is bumped whenever a netdevice is added or removed from
      the list. If such a change occurred while a link dump took place,
      the dump will have the NLM_F_DUMP_INTR flag set in the first
      message which has been interrupted and in all subsequent messages
      of the same dump.
      Note that links may still be modified or renamed while a dump is
      taking place but we can guarantee for userspace to receive a
      complete list of links and not miss any.
      I have added 500 VLAN netdevices to make sure the dump is split
      over multiple messages. Then while continuously dumping links in
      one process I also continuously deleted and re-added a dummy
      netdevice in another process. Multiple dumps per seconds have
      had the NLM_F_DUMP_INTR flag set.
      I guess we can wait for Johannes patch to hit net-next via the
      wireless tree.  I just wanted to give this some testing right away.
      Signed-off-by: default avatarThomas Graf <tgraf@infradead.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  16. 12 Jun, 2011 1 commit
    • Al Viro's avatar
      Delay struct net freeing while there's a sysfs instance refering to it · a685e089
      Al Viro authored
      	* new refcount in struct net, controlling actual freeing of the memory
      	* new method in kobj_ns_type_operations (->drop_ns())
      	* ->current_ns() semantics change - it's supposed to be followed by
      corresponding ->drop_ns().  For struct net in case of CONFIG_NET_NS it bumps
      the new refcount; net_drop_ns() decrements it and calls net_free() if the
      last reference has been dropped.  Method renamed to ->grab_current_ns().
      	* old net_free() callers call net_drop_ns() instead.
      	* sysfs_exit_ns() is gone, along with a large part of callchain
      leading to it; now that the references stored in ->ns[...] stay valid we
      do not need to hunt them down and replace them with NULL.  That fixes
      problems in sysfs_lookup() and sysfs_readdir(), along with getting rid
      of sb->s_instances abuse.
      	Note that struct net *shutdown* logics has not changed - net_cleanup()
      is called exactly when it used to be called.  The only thing postponed by
      having a sysfs instance refering to that struct net is actual freeing of
      memory occupied by struct net.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
  17. 27 May, 2011 1 commit
  18. 10 May, 2011 1 commit
  19. 14 Mar, 2011 1 commit
  20. 12 Jan, 2011 1 commit
  21. 25 Oct, 2010 1 commit
  22. 17 Oct, 2010 1 commit
    • Eric Dumazet's avatar
      netns: reorder fields in struct net · 8e602ce2
      Eric Dumazet authored
      In a network bench, I noticed an unfortunate false sharing between
      'loopback_dev' and 'count' fields in "struct net".
      'count' is written each time a socket is created or destroyed, while
      loopback_dev might be often read in routing code.
      Move loopback_dev in a read mostly section of "struct net"
      Note: struct netns_xfrm is cache line aligned on SMP.
      (It contains a "struct dst_ops")
      Move it at the end to avoid holes, and reduce sizeof(struct net) by 128
      bytes on ia32.
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  23. 12 Mar, 2010 1 commit
  24. 13 Jan, 2010 1 commit
  25. 03 Dec, 2009 1 commit
  26. 01 Dec, 2009 3 commits
    • Eric W. Biederman's avatar
      net: remove [un]register_pernet_gen_... and update the docs. · 65c0cfaf
      Eric W. Biederman authored
      No that all of the callers have been updated to set fields in
      struct pernet_operations, and simplified to let the network
      namespace core handle the allocation and freeing of the storage
      for them, remove the surpurpflous methods and update the docs
      to the new style.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Eric W. Biederman's avatar
      net: Automatically allocate per namespace data. · f875bae0
      Eric W. Biederman authored
      To get the full benefit of batched network namespace cleanup netowrk
      device deletion needs to be performed by the generic code.  When
      using register_pernet_gen_device and freeing the data in exit_net
      it is impossible to delay allocation until after exit_net has called
      as the device uninit methods are no longer safe.
      To correct this, and to simplify working with per network namespace data
      I have moved allocation and deletion of per network namespace data into
      the network namespace core.  The core now frees the data only after
      all of the network namespace exit routines have run.
      Now it is only required to set the new fields .id and .size
      in the pernet_operations structure if you want network namespace
      data to be managed for you automatically.
      This makes the current register_pernet_gen_device and
      register_pernet_gen_subsys routines unnecessary.  For the moment
      I have left them as compatibility wrappers in net_namespace.h
      They will be removed once all of the users have been updated.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Eric W. Biederman's avatar
      net: Batch network namespace destruction. · 2b035b39
      Eric W. Biederman authored
      It is fairly common to kill several network namespaces at once.  Either
      because they are nested one inside the other or because they are cooperating
      in multiple machine networking experiments.  As the network stack control logic
      does not parallelize easily batch up multiple network namespaces existing
      To get the full benefit of batching the virtual network devices to be
      removed must be all removed in one batch.  For that purpose I have added
      a loop after the last network device operations have run that batches
      up all remaining network devices and deletes them.
      An extra benefit is that the reorganization slightly shrinks the size
      of the per network namespace data structures replaceing a work_struct
      with a list_head.
      In a trivial test with 4K namespaces this change reduced the cost of
      a destroying 4K namespaces from 7+ minutes (at 12% cpu) to 44 seconds
      (at 60% cpu).  The bulk of that 44s was spent in inet_twsk_purge.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  27. 24 Oct, 2009 1 commit
  28. 07 Oct, 2009 1 commit
    • Johannes Berg's avatar
      wext: refactor · 3d23e349
      Johannes Berg authored
      Refactor wext to
       * split out iwpriv handling
       * split out iwspy handling
       * split out procfs support
       * allow cfg80211 to have wireless extensions compat code
      After this, drivers need to
       - select WIRELESS_EXT	- for wext support
       - select WEXT_PRIV	- for iwpriv support
       - select WEXT_SPY	- for iwspy support
      except cfg80211 -- which gets new hooks in wext-core.c
      and can then get wext handlers without CONFIG_WIRELESS_EXT.
      Wireless extensions procfs support is auto-selected
      based on PROC_FS and anything that requires the wext core
      (i.e. WIRELESS_EXT or CFG80211_WEXT).
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
  29. 20 Jul, 2009 1 commit
  30. 15 Jul, 2009 1 commit
  31. 12 Jul, 2009 1 commit