1. 29 3月, 2008 3 次提交
  2. 26 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. 06 3月, 2008 1 次提交
  5. 01 3月, 2008 2 次提交
  6. 14 2月, 2008 1 次提交
  7. 01 2月, 2008 1 次提交
  8. 29 1月, 2008 9 次提交
  9. 13 11月, 2007 1 次提交
  10. 07 11月, 2007 2 次提交
    • P
      [NET]: Clean proto_(un)register from in-code ifdefs · b733c007
      Pavel Emelyanov 提交于
      The struct proto has the per-cpu "inuse" counter, which is handled
      with a special care. All the handling code hides under the ifdef
      CONFIG_SMP and it introduces some code duplication and makes it
      look worse than it could.
      
      Clean this.
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b733c007
    • E
      [NET]: Define infrastructure to keep 'inuse' changes in an efficent SMP/NUMA way. · 286ab3d4
      Eric Dumazet 提交于
      "struct proto" currently uses an array stats[NR_CPUS] to track change on
      'inuse' sockets per protocol.
      
      If NR_CPUS is big, this means we use a big memory area for this.
      Moreover, all this memory area is located on a single node on NUMA
      machines, increasing memory pressure on the boot node.
      
      In this patch, I tried to :
      
      - Keep a fast !CONFIG_SMP implementation
      - Keep a fast CONFIG_SMP implementation for often used protocols
      (tcp,udp,raw,...)
      - Introduce a NUMA efficient implementation
      
      Some helper macros are defined in include/net/sock.h
      These macros take into account CONFIG_SMP
      
      If a "struct proto" is declared without using DEFINE_PROTO_INUSE /
      REF_PROTO_INUSE
      macros, it will automatically use a default implementation, using a
      dynamically allocated percpu zone.
      This default implementation will be NUMA efficient, but might use 32/64
      bytes per possible cpu
      because of current alloc_percpu() implementation.
      However it still should be better than previous implementation based on
      stats[NR_CPUS] field.
      
      When a "struct proto" is changed to use the new macros, we use a single
      static "int" percpu variable,
      lowering the memory and cpu costs, still preserving NUMA efficiency.
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      286ab3d4
  11. 01 11月, 2007 8 次提交
  12. 26 10月, 2007 1 次提交
  13. 20 10月, 2007 1 次提交
  14. 18 10月, 2007 2 次提交
  15. 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
  16. 11 10月, 2007 4 次提交
    • E
      [NET]: Make the device list and device lookups per namespace. · 881d966b
      Eric W. Biederman 提交于
      This patch makes most of the generic device layer network
      namespace safe.  This patch makes dev_base_head a
      network namespace variable, and then it picks up
      a few associated variables.  The functions:
      dev_getbyhwaddr
      dev_getfirsthwbytype
      dev_get_by_flags
      dev_get_by_name
      __dev_get_by_name
      dev_get_by_index
      __dev_get_by_index
      dev_ioctl
      dev_ethtool
      dev_load
      wireless_process_ioctl
      
      were modified to take a network namespace argument, and
      deal with it.
      
      vlan_ioctl_set and brioctl_set were modified so their
      hooks will receive a network namespace argument.
      
      So basically anthing in the core of the network stack that was
      affected to by the change of dev_base was modified to handle
      multiple network namespaces.  The rest of the network stack was
      simply modified to explicitly use &init_net the initial network
      namespace.  This can be fixed when those components of the network
      stack are modified to handle multiple network namespaces.
      
      For now the ifindex generator is left global.
      
      Fundametally ifindex numbers are per namespace, or else
      we will have corner case problems with migration when
      we get that far.
      
      At the same time there are assumptions in the network stack
      that the ifindex of a network device won't change.  Making
      the ifindex number global seems a good compromise until
      the network stack can cope with ifindex changes when
      you change namespaces, and the like.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      881d966b
    • E
      [NET]: Make socket creation namespace safe. · 1b8d7ae4
      Eric W. Biederman 提交于
      This patch passes in the namespace a new socket should be created in
      and has the socket code do the appropriate reference counting.  By
      virtue of this all socket create methods are touched.  In addition
      the socket create methods are modified so that they will fail if
      you attempt to create a socket in a non-default network namespace.
      
      Failing if we attempt to create a socket outside of the default
      network namespace ensures that as we incrementally make the network stack
      network namespace aware we will not export functionality that someone
      has not audited and made certain is network namespace safe.
      Allowing us to partially enable network namespaces before all of the
      exotic protocols are supported.
      
      Any protocol layers I have missed will fail to compile because I now
      pass an extra parameter into the socket creation code.
      
      [ Integrated AF_IUCV build fixes from Andrew Morton... -DaveM ]
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1b8d7ae4
    • E
      [NET]: Make /proc/net per network namespace · 457c4cbc
      Eric W. Biederman 提交于
      This patch makes /proc/net per network namespace.  It modifies the global
      variables proc_net and proc_net_stat to be per network namespace.
      The proc_net file helpers are modified to take a network namespace argument,
      and all of their callers are fixed to pass &init_net for that argument.
      This ensures that all of the /proc/net files are only visible and
      usable in the initial network namespace until the code behind them
      has been updated to be handle multiple network namespaces.
      
      Making /proc/net per namespace is necessary as at least some files
      in /proc/net depend upon the set of network devices which is per
      network namespace, and even more files in /proc/net have contents
      that are relevant to a single network namespace.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      457c4cbc
    • J
      [NET]: Change type of owner in sock_lock_t to int, rename · d2e9117c
      John Heffner 提交于
      The type of owner in sock_lock_t is currently (struct sock_iocb *),
      presumably for historical reasons.  It is never used as this type, only
      tested as NULL or set to (void *)1.  For clarity, this changes it to type
      int, and renames to owned, to avoid any possible type casting errors.
      Signed-off-by: NJohn Heffner <jheffner@psc.edu>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d2e9117c
  17. 15 9月, 2007 1 次提交
    • D
      [NET]: Fix two issues wrt. SO_BINDTODEVICE. · 4878809f
      David S. Miller 提交于
      1) Comments suggest that setting optlen to zero will unbind
         the socket from whatever device it might be attached to.  This
         hasn't been the case since at least 2.2.x because the first thing
         this function does is return -EINVAL if 'optlen' is less than
         sizeof(int).
      
         This check also means that passing in a two byte string doesn't
         work so well.  It's almost as if this code was testing with "eth?"
         patterned strings and nothing else :-)
      
         Fix this by breaking the logic of this facility out into a
         seperate function which validates optlen more appropriately.
      
         The optlen==0 and small string cases now work properly.
      
      2) We should reset the cached route of the socket after we have made
         the device binding changes, not before.
      
      Reported by Ben Greear.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4878809f