1. 26 3月, 2008 3 次提交
  2. 25 3月, 2008 1 次提交
  3. 21 3月, 2008 1 次提交
    • P
      [NET]: Add per-connection option to set max TSO frame size · 82cc1a7a
      Peter P Waskiewicz Jr 提交于
      Update: My mailer ate one of Jarek's feedback mails...  Fixed the
      parameter in netif_set_gso_max_size() to be u32, not u16.  Fixed the
      whitespace issue due to a patch import botch.  Changed the types from
      u32 to unsigned int to be more consistent with other variables in the
      area.  Also brought the patch up to the latest net-2.6.26 tree.
      
      Update: Made gso_max_size container 32 bits, not 16.  Moved the
      location of gso_max_size within netdev to be less hotpath.  Made more
      consistent names between the sock and netdev layers, and added a
      define for the max GSO size.
      
      Update: Respun for net-2.6.26 tree.
      
      Update: changed max_gso_frame_size and sk_gso_max_size from signed to
      unsigned - thanks Stephen!
      
      This patch adds the ability for device drivers to control the size of
      the TSO frames being sent to them, per TCP connection.  By setting the
      netdevice's gso_max_size value, the socket layer will set the GSO
      frame size based on that value.  This will propogate into the TCP
      layer, and send TSO's of that size to the hardware.
      
      This can be desirable to help tune the bursty nature of TSO on a
      per-adapter basis, where one may have 1 GbE and 10 GbE devices
      coexisting in a system, one running multiqueue and the other not, etc.
      
      This can also be desirable for devices that cannot support full 64 KB
      TSO's, but still want to benefit from some level of segmentation
      offloading.
      Signed-off-by: NPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      82cc1a7a
  4. 20 2月, 2008 1 次提交
  5. 14 2月, 2008 2 次提交
  6. 13 2月, 2008 1 次提交
    • M
      [NET]: Fix race in dev_close(). (Bug 9750) · d8b2a4d2
      Matti Linnanvuori 提交于
      There is a race in Linux kernel file net/core/dev.c, function dev_close.
      The function calls function dev_deactivate, which calls function
      dev_watchdog_down that deletes the watchdog timer. However, after that, a
      driver can call netif_carrier_ok, which calls function
      __netdev_watchdog_up that can add the watchdog timer again. Function
      unregister_netdevice calls function dev_shutdown that traps the bug
      !timer_pending(&dev->watchdog_timer). Moving dev_deactivate after
      netif_running() has been cleared prevents function netif_carrier_on
      from calling __netdev_watchdog_up and adding the watchdog timer again.
      Signed-off-by: NMatti Linnanvuori <mattilinnanvuori@yahoo.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d8b2a4d2
  7. 02 2月, 2008 3 次提交
  8. 01 2月, 2008 1 次提交
    • C
      [VLAN]: set_rx_mode support for unicast address list · e83a2ea8
      Chris Leech 提交于
      Reuse the existing logic for multicast list synchronization for the
      unicast address list. The core of dev_mc_sync/unsync are split out as
      __dev_addr_sync/unsync and moved from dev_mcast.c to dev.c.  These are
      then used to implement dev_unicast_sync/unsync as well.
      
      I'm working on cleaning up Intel's FCoE stack, which generates new MAC
      addresses from the fibre channel device id assigned by the fabric as
      per the current draft specification in T11.  When using such a
      protocol in a VLAN environment it would be nice to not always be
      forced into promiscuous mode, assuming the underlying Ethernet driver
      supports multiple unicast addresses as well.
      Signed-off-by: NChris Leech <christopher.leech@intel.com>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      e83a2ea8
  9. 29 1月, 2008 7 次提交
  10. 09 1月, 2008 1 次提交
  11. 21 12月, 2007 1 次提交
  12. 11 12月, 2007 1 次提交
  13. 15 11月, 2007 1 次提交
    • P
      [NET]: Remove notifier block from chain when register_netdevice_notifier fails · c67625a1
      Pavel Emelyanov 提交于
      Commit fcc5a03a:
      
      	[NET]: Allow netdev REGISTER/CHANGENAME events to fail
      
      makes the register_netdevice_notifier() handle the error from the
      NETDEV_REGISTER event, sent to the registering block.
      
      The bad news is that in this case the notifier block is 
      not removed from the list, but the error is returned to the 
      caller. In case the caller is in module init function and 
      handles this error this can abort the module loading. The
      notifier block will be then removed from the kernel, but 
      will be left in the list. Oops :(
      
      I think that the notifier block should be removed from the
      chain in case of error, regardless whether this error is 
      handled by the caller or not. In the worst case (the error 
      is _not_ handled) module will not receive the events any 
      longer.
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c67625a1
  14. 13 11月, 2007 1 次提交
  15. 11 11月, 2007 1 次提交
  16. 01 11月, 2007 1 次提交
  17. 31 10月, 2007 1 次提交
    • D
      [NET]: Fix free_netdev on register_netdev failure. · 93ee31f1
      Daniel Lezcano 提交于
      Point 1:
      The unregistering of a network device schedule a netdev_run_todo.
      This function calls dev->destructor when it is set and the
      destructor calls free_netdev.
      
      Point 2:
      In the case of an initialization of a network device the usual code
      is:
       * alloc_netdev
       * register_netdev
          -> if this one fails, call free_netdev and exit with error.
      
      Point 3:
      In the register_netdevice function at the later state, when the device
      is at the registered state, a call to the netdevice_notifiers is made.
      If one of the notification falls into an error, a rollback to the
      registered state is done using unregister_netdevice.
      
      Conclusion:
      When a network device fails to register during initialization because
      one network subsystem returned an error during a notification call
      chain, the network device is freed twice because of fact 1 and fact 2.
      The second free_netdev will be done with an invalid pointer.
      
      Proposed solution:
      The following patch move all the code of unregister_netdevice *except*
      the call to net_set_todo, to a new function "rollback_registered".
      
      The following functions are changed in this way:
       * register_netdevice: calls rollback_registered when a notification fails
       * unregister_netdevice: calls rollback_register + net_set_todo, the call
                               order to net_set_todo is changed because it is the
                               latest now. Since it justs add an element to a list
                               that should not break anything.
      Signed-off-by: NDaniel Lezcano <dlezcano@fr.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      93ee31f1
  18. 30 10月, 2007 1 次提交
    • D
      [NET]: Fix race between poll_napi() and net_rx_action() · 0a7606c1
      David S. Miller 提交于
      netpoll_poll_lock() synchronizes the ->poll() invocation
      code paths, but once we have the lock we have to make
      sure that NAPI_STATE_SCHED is still set.  Otherwise we
      get:
      
      	cpu 0			cpu 1
      
      	net_rx_action()		poll_napi()
      	netpoll_poll_lock()	... spin on ->poll_lock
      	->poll()
      	  netif_rx_complete
      	netpoll_poll_unlock()	acquire ->poll_lock()
      				->poll()
      				 netif_rx_complete()
      				 CRASH
      
      Based upon a bug report from Tina Yang.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0a7606c1
  19. 27 10月, 2007 1 次提交
    • E
      [NET]: Marking struct pernet_operations __net_initdata was inappropriate · 2b008b0a
      Eric W. Biederman 提交于
      It is not safe to to place struct pernet_operations in a special section.
      We need struct pernet_operations to last until we call unregister_pernet_subsys.
      Which doesn't happen until module unload.
      
      So marking struct pernet_operations is a disaster for modules in two ways.
      - We discard it before we call the exit method it points to.
      - Because I keep struct pernet_operations on a linked list discarding
        it for compiled in code removes elements in the middle of a linked
        list and does horrible things for linked insert.
      
      So this looks safe assuming __exit_refok is not discarded
      for modules.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2b008b0a
  20. 26 10月, 2007 1 次提交
  21. 24 10月, 2007 2 次提交
  22. 22 10月, 2007 2 次提交
  23. 16 10月, 2007 2 次提交
  24. 14 10月, 2007 1 次提交
    • R
      net core: fix kernel-doc for new function parameters · c4ea43c5
      Randy Dunlap 提交于
      Fix networking code kernel-doc for newly added parameters.
      
      Warning(linux-2.6.23-git2//net/core/sock.c:879): No description found for parameter 'net'
      Warning(linux-2.6.23-git2//net/core/dev.c:570): No description found for parameter 'net'
      Warning(linux-2.6.23-git2//net/core/dev.c:594): No description found for parameter 'net'
      Warning(linux-2.6.23-git2//net/core/dev.c:617): No description found for parameter 'net'
      Warning(linux-2.6.23-git2//net/core/dev.c:641): No description found for parameter 'net'
      Warning(linux-2.6.23-git2//net/core/dev.c:667): No description found for parameter 'net'
      Warning(linux-2.6.23-git2//net/core/dev.c:722): No description found for parameter 'net'
      Warning(linux-2.6.23-git2//net/core/dev.c:959): No description found for parameter 'net'
      Warning(linux-2.6.23-git2//net/core/dev.c:1195): No description found for parameter 'dev'
      Warning(linux-2.6.23-git2//net/core/dev.c:2105): No description found for parameter 'n'
      Warning(linux-2.6.23-git2//net/core/dev.c:3272): No description found for parameter 'net'
      Warning(linux-2.6.23-git2//net/core/dev.c:3445): No description found for parameter 'net'
      Warning(linux-2.6.23-git2//include/linux/netdevice.h:1301): No description found for parameter 'cpu'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c4ea43c5
  25. 11 10月, 2007 2 次提交
    • P
      [NET]: Remove double dev->flags checking when calling dev_close() · 9b772652
      Pavel Emelyanov 提交于
      The unregister_netdevice() and dev_change_net_namespace()
      both check for dev->flags to be IFF_UP before calling the
      dev_close(), but the dev_close() checks for IFF_UP itself,
      so remove those unneeded checks.
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9b772652
    • P
      [NETNS]: Move some code into __init section when CONFIG_NET_NS=n · 4665079c
      Pavel Emelyanov 提交于
      With the net namespaces many code leaved the __init section,
      thus making the kernel occupy more memory than it did before.
      Since we have a config option that prohibits the namespace
      creation, the functions that initialize/finalize some netns
      stuff are simply not needed and can be freed after the boot.
      
      Currently, this is almost not noticeable, since few calls
      are no longer in __init, but when the namespaces will be
      merged it will be possible to free more code. I propose to
      use the __net_init, __net_exit and __net_initdata "attributes"
      for functions/variables that are not used if the CONFIG_NET_NS
      is not set to save more space in memory.
      
      The exiting functions cannot just reside in the __exit section,
      as noticed by David, since the init section will have
      references on it and the compilation will fail due to modpost
      checks. These references can exist, since the init namespace
      never dies and the exit callbacks are never called. So I
      introduce the __exit_refok attribute just like it is already
      done with the __init_refok.
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4665079c