1. 25 8月, 2012 11 次提交
    • B
      sfc: Keep disabled NICs quiescent during suspend/resume · 6032fb56
      Ben Hutchings 提交于
      Currently we ignore and clear the disabled state.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      6032fb56
    • B
      sfc: Hold the RTNL lock for more of the suspend/resume cycle · 61da026d
      Ben Hutchings 提交于
      I don't think these PM functions can race with userland net device
      operations, but it's much easier to reason about locking if state is
      consistently guarded by the same lock.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      61da026d
    • B
      sfc: Change state names to be clearer, and comment them · f16aeea0
      Ben Hutchings 提交于
      STATE_INIT and STATE_FINI are equivalent and represent incompletely
      initialised states; combine them as STATE_UNINIT.
      
      Rename STATE_RUNNING to STATE_READY, to avoid confusion with
      netif_running() and IFF_RUNNING.
      
      The comments do not quite match current usage, but this will be
      corrected in subsequent fixes.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      f16aeea0
    • B
      9714284f
    • B
      sfc: Replace tso_state::full_packet_space with ip_base_len · 53cb13c6
      Ben Hutchings 提交于
      We only use tso_state::full_packet_space to calculate the IPv4 tot_len
      or IPv6 payload_len, not to set tso_state::packet_space.  Replace it
      with an ip_base_len field holding the value of tot_len or payload_len
      before including the TCP payload, which is much more useful when
      constructing the new headers.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      53cb13c6
    • B
      sfc: Simplify TSO header buffer allocation · f7251a9c
      Ben Hutchings 提交于
      TSO header buffers contain a control structure immediately followed by
      the packet headers, and are kept on a free list when not in use.  This
      complicates buffer management and tends to result in cache read misses
      when we recycle such buffers (particularly if DMA-coherent memory
      requires caches to be disabled).
      
      Replace the free list with a simple mapping by descriptor index.  We
      know that there is always a payload descriptor between any two
      descriptors with TSO header buffers, so we can allocate only one
      such buffer for each two descriptors.
      
      While we're at it, use a standard error code for allocation failure,
      not -1.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      f7251a9c
    • B
      sfc: Stop TX queues before they fill up · 14bf718f
      Ben Hutchings 提交于
      We now have a definite upper bound on the number of descriptors per
      skb; use that to stop the queue when the next packet might not fit.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      14bf718f
    • B
      sfc: Refactor struct efx_tx_buffer to use a flags field · 7668ff9c
      Ben Hutchings 提交于
      Add a flags field to struct efx_tx_buffer, replacing the
      continuation and map_single booleans.
      
      Since a single descriptor cannot be both a TSO header and the last
      descriptor for an skb, unionise efx_tx_buffer::{skb,tsoh} and add
      flags for validity of these fields.
      
      Clear all flags in free buffers (whereas previously the continuation
      flag would be set).
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      7668ff9c
    • B
      net: Set device operstate at registration time · 8f4cccbb
      Ben Hutchings 提交于
      The operstate of a device is initially IF_OPER_UNKNOWN and is updated
      asynchronously by linkwatch after each change of carrier state
      reported by the driver.  The default carrier state of a net device is
      on, and this will never be changed on drivers that do not support
      carrier detection, thus the operstate remains IF_OPER_UNKNOWN.
      
      For devices that do support carrier detection, the driver must set the
      carrier state to off initially, then poll the hardware state when the
      device is opened.  However, we must not activate linkwatch for a
      unregistered device, and commit b4730016 ('net: Do not fire linkwatch
      events until the device is registered.') ensured that we don't.  But
      this means that the operstate for many devices that support carrier
      detection remains IF_OPER_UNKNOWN when it should be IF_OPER_DOWN.
      
      The same issue exists with the dormant state.
      
      The proper initialisation sequence, avoiding a race with opening of
      the device, is:
      
              rtnl_lock();
              rc = register_netdevice(dev);
              if (rc)
                      goto out_unlock;
              netif_carrier_off(dev); /* or netif_dormant_on(dev) */
              rtnl_unlock();
      
      but it seems silly that this should have to be repeated in so many
      drivers.  Further, the operstate seen immediately after opening the
      device may still be IF_OPER_UNKNOWN due to the asynchronous nature of
      linkwatch.
      
      Commit 22604c86 ('net: Fix for initial link state in 2.6.28') attempted
      to fix this by setting the operstate synchronously, but it was
      reverted as it could lead to deadlock.
      
      This initialises the operstate synchronously at registration time
      only.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8f4cccbb
    • T
      net/fsl: introduce Freescale 10G MDIO driver · 9f35a734
      Timur Tabi 提交于
      Similar to fsl_pq_mdio.c, this driver is for the 10G MDIO controller on
      Freescale Frame Manager Ethernet controllers.
      Signed-off-by: NTimur Tabi <timur@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9f35a734
    • N
      cls_cgroup: Allow classifier cgroups to have their classid reset to 0 · 3afa6d00
      Neil Horman 提交于
      The network classifier cgroup initalizes each cgroups instance classid value to
      0.  However, the sock_update_classid function only updates classid's in sockets
      if the tasks cgroup classid is not zero, and if it differs from the current
      classid.  The later check is to prevent cache line dirtying, but the former is
      detrimental, as it prevents resetting a classid for a cgroup to 0.  While this
      is not a common action, it has administrative usefulness (if the admin wants to
      disable classification of a certain group temporarily for instance).
      
      Easy fix, just remove the zero check.  Tested successfully by myself
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      CC: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3afa6d00
  2. 24 8月, 2012 3 次提交
  3. 23 8月, 2012 26 次提交