1. 22 6月, 2011 3 次提交
  2. 21 6月, 2011 1 次提交
  3. 14 6月, 2011 1 次提交
  4. 13 6月, 2011 1 次提交
    • A
      Delay struct net freeing while there's a sysfs instance refering to it · a685e089
      Al Viro 提交于
      	* 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: NAl Viro <viro@zeniv.linux.org.uk>
      a685e089
  5. 12 6月, 2011 2 次提交
  6. 10 6月, 2011 1 次提交
    • G
      rtnetlink: Compute and store minimum ifinfo dump size · c7ac8679
      Greg Rose 提交于
      The message size allocated for rtnl ifinfo dumps was limited to
      a single page.  This is not enough for additional interface info
      available with devices that support SR-IOV and caused a bug in
      which VF info would not be displayed if more than approximately
      40 VFs were created per interface.
      
      Implement a new function pointer for the rtnl_register service that will
      calculate the amount of data required for the ifinfo dump and allocate
      enough data to satisfy the request.
      Signed-off-by: NGreg Rose <gregory.v.rose@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      c7ac8679
  7. 09 6月, 2011 2 次提交
    • W
      netpoll: prevent netpoll setup on slave devices · 0c1ad04a
      WANG Cong 提交于
      In commit 8d8fc29d
      (netpoll: disable netpoll when enslave a device), we automatically
      disable netpoll when the underlying device is being enslaved,
      we also need to prevent people from setuping netpoll on
      devices that are already enslaved.
      Signed-off-by: NWANG Cong <amwang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c1ad04a
    • A
      v2 ethtool: remove support for ETHTOOL_GRXNTUPLE · bff55273
      Alexander Duyck 提交于
      This change is meant to remove all support for displaying an ntuple as
      strings via ETHTOOL_GRXNTUPLE.  The reason for this change is due to the
      fact that multiple issues have been found including:
       - Multiple buffer overruns for strings being displayed.
       - Incorrect filters displayed, cleared filters with ring of -2 are displayed
       - Setting get_rx_ntuple displays no rules if defined.
       - Endianess wrong on displayed values.
       - Hard limit of 1024 filters makes display functionality extremely limited
      
      The only driver that had supported this interface was ixgbe.  Since it no
      longer uses the interface and due to the issues mentioned above I am
      submitting this patch to remove it.
      
      v2:
      Updated based on comments from Ben Hutchings
       - Left ETH_SS_NTUPLE_FILTERS in code but commented on it being deprecated
       - Removed ethtool_rx_ntuple_list and ethtool_rx_ntuple_flow_spec_container
       - Left ETHTOOL_GRXNTUPLE but commented it as deprecated
      
      Also cleaned up set_rx_ntuple since there is no flow spec container to
      maintain we can drop all the code for the alloc and free of it and just
      return ops->set_rx_ntuple().
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Acked-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bff55273
  8. 07 6月, 2011 2 次提交
  9. 06 6月, 2011 1 次提交
  10. 03 6月, 2011 1 次提交
    • K
      net: tracepoint of net_dev_xmit sees freed skb and causes panic · ec764bf0
      Koki Sanagi 提交于
      Because there is a possibility that skb is kfree_skb()ed and zero cleared
      after ndo_start_xmit, we should not see the contents of skb like skb->len and
      skb->dev->name after ndo_start_xmit. But trace_net_dev_xmit does that
      and causes panic by NULL pointer dereference.
      This patch fixes trace_net_dev_xmit not to see the contents of skb directly.
      
      If you want to reproduce this panic,
      
      1. Get tracepoint of net_dev_xmit on
      2. Create 2 guests on KVM
      2. Make 2 guests use virtio_net
      4. Execute netperf from one to another for a long time as a network burden
      5. host will panic(It takes about 30 minutes)
      Signed-off-by: NKoki Sanagi <sanagi.koki@jp.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ec764bf0
  11. 28 5月, 2011 1 次提交
  12. 27 5月, 2011 2 次提交
  13. 26 5月, 2011 2 次提交
  14. 25 5月, 2011 3 次提交
    • S
      net: fix get_net_ns_by_fd for !CONFIG_NET_NS · 956c9207
      Stephen Rothwell 提交于
      After merging the final tree, today's linux-next build (powerpc
      ppc44x_defconfig) failed like this:
      
      net/built-in.o: In function `get_net_ns_by_fd':
      (.text+0x11976): undefined reference to `netns_operations'
      net/built-in.o: In function `get_net_ns_by_fd':
      (.text+0x1197a): undefined reference to `netns_operations'
      
      netns_operations is only available if CONFIG_NET_NS is set ...
      
      Caused by commit f0630529 ("net: Allow setting the network namespace
      by fd").
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      956c9207
    • E
      net: fix __dst_destroy_metrics_generic() · b30c516f
      Eric Dumazet 提交于
      dst_default_metrics is readonly, we dont want to kfree() it later.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b30c516f
    • E
      net: use synchronize_rcu_expedited() · be3fc413
      Eric Dumazet 提交于
      synchronize_rcu() is very slow in various situations (HZ=100,
      CONFIG_NO_HZ=y, CONFIG_PREEMPT=n)
      
      Extract from my (mostly idle) 8 core machine :
      
       synchronize_rcu() in 99985 us
       synchronize_rcu() in 79982 us
       synchronize_rcu() in 87612 us
       synchronize_rcu() in 79827 us
       synchronize_rcu() in 109860 us
       synchronize_rcu() in 98039 us
       synchronize_rcu() in 89841 us
       synchronize_rcu() in 79842 us
       synchronize_rcu() in 80151 us
       synchronize_rcu() in 119833 us
       synchronize_rcu() in 99858 us
       synchronize_rcu() in 73999 us
       synchronize_rcu() in 79855 us
       synchronize_rcu() in 79853 us
      
      When we hold RTNL mutex, we would like to spend some cpu cycles but not
      block too long other processes waiting for this mutex.
      
      We also want to setup/dismantle network features as fast as possible at
      boot/shutdown time.
      
      This patch makes synchronize_net() call the expedited version if RTNL is
      locked.
      
      synchronize_rcu_expedited() typical delay is about 20 us on my machine.
      
       synchronize_rcu_expedited() in 18 us
       synchronize_rcu_expedited() in 18 us
       synchronize_rcu_expedited() in 18 us
       synchronize_rcu_expedited() in 18 us
       synchronize_rcu_expedited() in 20 us
       synchronize_rcu_expedited() in 16 us
       synchronize_rcu_expedited() in 20 us
       synchronize_rcu_expedited() in 18 us
       synchronize_rcu_expedited() in 18 us
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      CC: Ben Greear <greearb@candelatech.com>
      Reviewed-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      be3fc413
  15. 24 5月, 2011 1 次提交
  16. 23 5月, 2011 4 次提交
  17. 21 5月, 2011 1 次提交
    • L
      sanitize <linux/prefetch.h> usage · 268bb0ce
      Linus Torvalds 提交于
      Commit e66eed65 ("list: remove prefetching from regular list
      iterators") removed the include of prefetch.h from list.h, which
      uncovered several cases that had apparently relied on that rather
      obscure header file dependency.
      
      So this fixes things up a bit, using
      
         grep -L linux/prefetch.h $(git grep -l '[^a-z_]prefetchw*(' -- '*.[ch]')
         grep -L 'prefetchw*(' $(git grep -l 'linux/prefetch.h' -- '*.[ch]')
      
      to guide us in finding files that either need <linux/prefetch.h>
      inclusion, or have it despite not needing it.
      
      There are more of them around (mostly network drivers), but this gets
      many core ones.
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      268bb0ce
  18. 20 5月, 2011 1 次提交
  19. 19 5月, 2011 1 次提交
    • D
      ipv4: Kill RT_CACHE_DEBUG · 6882f933
      David S. Miller 提交于
      It's way past it's usefulness.  And this gets rid of a bunch
      of stray ->rt_{dst,src} references.
      
      Even the comment documenting the macro was inaccurate (stated
      default was 1 when it's 0).
      
      If reintroduced, it should be done properly, with dynamic debug
      facilities.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6882f933
  20. 18 5月, 2011 4 次提交
  21. 17 5月, 2011 2 次提交
  22. 14 5月, 2011 2 次提交
    • P
      net:set valid name before calling ndo_init() · 0696c3a8
      Peter Pan(潘卫平) 提交于
      In commit 1c5cae81 (net: call dev_alloc_name from register_netdevice),
      a bug of bonding was involved, see example 1 and 2.
      
      In register_netdevice(), the name of net_device is not valid until
      dev_get_valid_name() is called. But dev->netdev_ops->ndo_init(that is
      bond_init) is called before dev_get_valid_name(),
      and it uses the invalid name of net_device.
      
      I think register_netdevice() should make sure that the name of net_device is
      valid before calling ndo_init().
      
      example 1:
      modprobe bonding
      ls  /proc/net/bonding/bond%d
      
      ps -eLf
      root      3398     2  3398  0    1 21:34 ?        00:00:00 [bond%d]
      
      example 2:
      modprobe bonding max_bonds=3
      
      [  170.100292] bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
      [  170.101090] bonding: Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.
      [  170.102469] ------------[ cut here ]------------
      [  170.103150] WARNING: at /home/pwp/net-next-2.6/fs/proc/generic.c:586 proc_register+0x126/0x157()
      [  170.104075] Hardware name: VirtualBox
      [  170.105065] proc_dir_entry 'bonding/bond%d' already registered
      [  170.105613] Modules linked in: bonding(+) sunrpc ipv6 uinput microcode ppdev parport_pc parport joydev e1000 pcspkr i2c_piix4 i2c_core [last unloaded: bonding]
      [  170.108397] Pid: 3457, comm: modprobe Not tainted 2.6.39-rc2+ #14
      [  170.108935] Call Trace:
      [  170.109382]  [<c0438f3b>] warn_slowpath_common+0x6a/0x7f
      [  170.109911]  [<c051a42a>] ? proc_register+0x126/0x157
      [  170.110329]  [<c0438fc3>] warn_slowpath_fmt+0x2b/0x2f
      [  170.110846]  [<c051a42a>] proc_register+0x126/0x157
      [  170.111870]  [<c051a4dd>] proc_create_data+0x82/0x98
      [  170.112335]  [<f94e6af6>] bond_create_proc_entry+0x3f/0x73 [bonding]
      [  170.112905]  [<f94dd806>] bond_init+0x77/0xa5 [bonding]
      [  170.113319]  [<c0721ac6>] register_netdevice+0x8c/0x1d3
      [  170.113848]  [<f94e0e30>] bond_create+0x6c/0x90 [bonding]
      [  170.114322]  [<f94f4763>] bonding_init+0x763/0x7b1 [bonding]
      [  170.114879]  [<c0401240>] do_one_initcall+0x76/0x122
      [  170.115317]  [<f94f4000>] ? 0xf94f3fff
      [  170.115799]  [<c0463f1e>] sys_init_module+0x1286/0x140d
      [  170.116879]  [<c07c6d9f>] sysenter_do_call+0x12/0x28
      [  170.117404] ---[ end trace 64e4fac3ae5fff1a ]---
      [  170.117924] bond%d: Warning: failed to register to debugfs
      [  170.128728] ------------[ cut here ]------------
      [  170.129360] WARNING: at /home/pwp/net-next-2.6/fs/proc/generic.c:586 proc_register+0x126/0x157()
      [  170.130323] Hardware name: VirtualBox
      [  170.130797] proc_dir_entry 'bonding/bond%d' already registered
      [  170.131315] Modules linked in: bonding(+) sunrpc ipv6 uinput microcode ppdev parport_pc parport joydev e1000 pcspkr i2c_piix4 i2c_core [last unloaded: bonding]
      [  170.133731] Pid: 3457, comm: modprobe Tainted: G        W   2.6.39-rc2+ #14
      [  170.134308] Call Trace:
      [  170.134743]  [<c0438f3b>] warn_slowpath_common+0x6a/0x7f
      [  170.135305]  [<c051a42a>] ? proc_register+0x126/0x157
      [  170.135820]  [<c0438fc3>] warn_slowpath_fmt+0x2b/0x2f
      [  170.137168]  [<c051a42a>] proc_register+0x126/0x157
      [  170.137700]  [<c051a4dd>] proc_create_data+0x82/0x98
      [  170.138174]  [<f94e6af6>] bond_create_proc_entry+0x3f/0x73 [bonding]
      [  170.138745]  [<f94dd806>] bond_init+0x77/0xa5 [bonding]
      [  170.139278]  [<c0721ac6>] register_netdevice+0x8c/0x1d3
      [  170.139828]  [<f94e0e30>] bond_create+0x6c/0x90 [bonding]
      [  170.140361]  [<f94f4763>] bonding_init+0x763/0x7b1 [bonding]
      [  170.140927]  [<c0401240>] do_one_initcall+0x76/0x122
      [  170.141494]  [<f94f4000>] ? 0xf94f3fff
      [  170.141975]  [<c0463f1e>] sys_init_module+0x1286/0x140d
      [  170.142463]  [<c07c6d9f>] sysenter_do_call+0x12/0x28
      [  170.142974] ---[ end trace 64e4fac3ae5fff1b ]---
      [  170.144949] bond%d: Warning: failed to register to debugfs
      Signed-off-by: NWeiping Pan <panweiping3@gmail.com>
      Reviewed-by: NJiri Pirko <jpirko@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0696c3a8
    • A
      ethtool: Added support for FW dump · 29dd54b7
      Anirban Chakraborty 提交于
      Added code to take FW dump via ethtool. Dump level can be controlled via setting the
      dump flag. A get function is provided to query the current setting of the dump flag.
      Dump data is obtained from the driver via a separate get function.
      
      Changes from v3:
      Fixed buffer length issue in ethtool_get_dump_data function.
      Updated kernel doc for ethtool_dump struct and get_dump_flag function.
      
      Changes from v2:
      Provided separate commands for get flag and data.
      Check for minimum of the two buffer length obtained via ethtool and driver and
      use that for dump buffer
      Pass up the driver return error codes up to the caller.
      Added kernel doc comments.
      Signed-off-by: NAnirban Chakraborty <anirban.chakraborty@qlogic.com>
      Reviewed-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      29dd54b7
  23. 13 5月, 2011 1 次提交