1. 30 8月, 2013 5 次提交
  2. 28 8月, 2013 4 次提交
    • D
      sfc: use MCDI epoch flag to improve MC reboot detection in the driver · d36a08b4
      Daniel Pieczko 提交于
      The Huntington MC will reject all MCDI requests after an MC reboot until it sees
      one with the NOT_EPOCH flag clear.  This flag is set by default for all requests,
      and then cleared on the first request after we detect that an MC reboot has
      occurred.
      
      The old MCDI_STATUS_DELAY_COUNT gave a timeout of 10ms, which was not long enough
      for the driver to detect that a reboot had occurred based on the warm boot count
      while calling efx_mcdi_poll_reboot() from the loop in efx_mcdi_ev_death().
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      d36a08b4
    • A
      sfc: Add EF10 support for TX/RX DMA error events handling. · 3de82b91
      Alexandre Rames 提交于
      Also, since we handle all DMA errors in the same way, merge
      RESET_TYPE_(RX|TX)_DESC_FETCH into RESET_TYPE_DMA_ERROR.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      3de82b91
    • B
      sfc: Delegate MAC/NIC statistic description to efx_nic_type · cd0ecc9a
      Ben Hutchings 提交于
      Various hardware statistics that are available for Siena are
      unavailable or meaningless for Falcon.  Huntington adds further to the
      NIC-type-specific statistics, as it has different MAC blocks from
      Falcon/Siena.
      
      All NIC types still provide most statistics by DMA, and use
      little-endian byte order.
      
      Therefore:
      1. Add some general utility functions for reporting hardware statistics,
         efx_nic_describe_stats() and efx_nic_update_stats().
      2. Add an efx_nic_type::describe_stats operation to get the number and
         names of statistics, implemented using efx_nic_describe_stats()
      3. Change efx_nic_type::update_stats to store the core statistics
         (struct rtnl_link_stats64) or full statistics (array of u64) in a
         caller-provided buffer.  Use efx_nic_update_stats() to aid in the
         implementation.
      4. Rename struct efx_ethtool_stat to struct efx_sw_stat_desc and
         EFX_ETHTOOL_NUM_STATS to EFX_ETHTOOL_SW_STAT_COUNT.
      5. Remove efx_nic::mac_stats and struct efx_mac_stats.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      cd0ecc9a
    • B
      sfc: Move MTD operations into efx_nic_type · 45a3fd55
      Ben Hutchings 提交于
      Merge the per-NIC-type MTD probe selection and struct efx_mtd_ops into
      struct efx_nic_type.  Move the implementations into the appropriate
      source files.
      
      Several NVRAM functions are now only called from MTD operations which
      are now implemented in the same file (falcon.c or mcdi.c).  There is no
      need for them to be extern, or to be defined at all if CONFIG_SFC_MTD
      is not enabled, so move them into the #ifdef CONFIG_SFC_MTD sections
      in those files.
      
      Most of the SPI-related definitions are also only used in falcon.c,
      so move them there.  Put the remainder of spi.h into nic.h (which
      previously included it).
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      45a3fd55
  3. 22 8月, 2013 9 次提交
  4. 21 8月, 2013 3 次提交
    • B
      sfc: Ensure MCDI buffers, but not lengths, are dword aligned · 9528b921
      Ben Hutchings 提交于
      We currently require that MCDI request and response lengths are
      multiples of 4 bytes, because we will copy dwords in and out of shared
      memory and we want to be sure we won't read or write out of bounds.
      But all we really need to know is that there is sufficient padding for
      that.  Also, we should ensure that buffers are dword-aligned, as on
      some architectures misaligned access will result in data corruption or
      a crash.
      
      Change the buffer type to array-of-efx_dword_t and remove the
      requirement that the lengths are multiples of 4.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      9528b921
    • B
      sfc: Use proper macros to declare and access MCDI arrays · c5bb0e98
      Ben Hutchings 提交于
      A few functions are using heap buffers; change them to use stack
      buffers as we really don't need to resort to the heap for a 252
      byte buffer in process context.
      
      MC_CMD_MEMCPY is quite weird in that it can use inline data placed in
      the request buffer after the array of records.  Thus there are two
      variable-length arrays and we can't use the normal accessors for
      the second.  So we have to use _MCDI_PTR() in efx_sriov_memcpy().
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      c5bb0e98
    • B
      sfc: Introduce and use MCDI_DECLARE_BUF macro · 59cfc479
      Ben Hutchings 提交于
      MCDI_DECLARE_BUF declares a variable as an MCDI buffer of the
      requested length, adding any necessary padding.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      59cfc479
  5. 25 4月, 2013 1 次提交
    • B
      sfc: Fix naming of MTD partitions for FPGA bitfiles · 89cc80a4
      Ben Hutchings 提交于
      efx_mcdi_get_board_cfg() uses a buffer for the firmware response that
      is only large enough to hold subtypes for the originally defined set
      of NVRAM partitions.  Longer responses are truncated, and we may read
      off the end of the buffer when copying out subtypes for additional
      partitions.  In particular, this can result in the MTD partition for
      an FPGA bitfile being named e.g. 'eth5 sfc_fpga:00' when it should be
      'eth5 sfc_fpga:01'.  This means the firmware update tool (sfupdate)
      can't tell which bitfile should be written to the partition.
      
      Correct the response buffer size.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      89cc80a4
  6. 01 12月, 2012 3 次提交
    • B
      sfc: Fix timekeeping in efx_mcdi_poll() · ebf98e79
      Ben Hutchings 提交于
      efx_mcdi_poll() uses get_seconds() to read the current time and to
      implement a polling timeout.  The use of this function was chosen
      partly because it could easily be replaced in a co-sim environment
      with a macro that read the simulated time.
      
      Unfortunately the real get_seconds() returns the system time (real
      time) which is subject to adjustment by e.g. ntpd.  If the system time
      is adjusted forward during a polled MCDI operation, the effective
      timeout can be shorter than the intended 10 seconds, resulting in a
      spurious failure.  It is also possible for a backward adjustment to
      delay detection of a areal failure.
      
      Use jiffies instead, and change MCDI_RPC_TIMEOUT to be denominated in
      jiffies.  Also correct rounding of the timeout: check time > finish
      (or rather time_after(time, finish)) and not time >= finish.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      ebf98e79
    • B
      sfc: Reset driver's MAC stats after MC reboot seen · 876be083
      Ben Hutchings 提交于
      If the MC reboots then the stats it reports to us will have been
      reset.  We need to reset ours to get efx_update_diff_stat() working
      properly.
      
      (Ideally we would maintain stats across the reboot, but as this should
      only happen immediately after a firmware upgrade it's not really worth
      the trouble.)
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      876be083
    • B
      sfc: Fix check for failure of MC_CMD_FLUSH_RX_QUEUES · bbec969b
      Ben Hutchings 提交于
      efx_mcdi_rpc_start() returns a negative value on error or zero on
      success.  However one caller that can't properly handle failure then
      does WARN_ON(rc > 0).  Change it to WARN_ON(rc < 0).
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      bbec969b
  7. 19 9月, 2012 4 次提交
  8. 08 9月, 2012 1 次提交
  9. 17 7月, 2012 1 次提交
  10. 16 2月, 2012 1 次提交
    • B
      sfc: Add SR-IOV back-end support for SFC9000 family · cd2d5b52
      Ben Hutchings 提交于
      On the SFC9000 family, each port has 1024 Virtual Interfaces (VIs),
      each with an RX queue, a TX queue, an event queue and a mailbox
      register.  These may be assigned to up to 127 SR-IOV virtual functions
      per port, with up to 64 VIs per VF.
      
      We allocate an extra channel (IRQ and event queue only) to receive
      requests from VF drivers.
      
      There is a per-port limit of 4 concurrent RX queue flushes, and queue
      flushes may be initiated by the MC in response to a Function Level
      Reset (FLR) of a VF.  Therefore, when SR-IOV is in use, we submit all
      flush requests via the MC.
      
      The RSS indirection table is shared with VFs, so the number of RX
      queues used in the PF is limited to the number of VIs per VF.
      
      This is almost entirely the work of Steve Hodgson, formerly
      shodgson@solarflare.com.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      cd2d5b52
  11. 27 1月, 2012 4 次提交
  12. 10 1月, 2012 2 次提交
  13. 11 8月, 2011 1 次提交
  14. 12 5月, 2011 1 次提交
    • B
      sfc: Always map MCDI shared memory as uncacheable · 747df225
      Ben Hutchings 提交于
      We enabled write-combining for memory-mapped registers in commit
      65f0b417, but inhibited it for the
      MCDI shared memory where this is not supported.  However,
      write-combining mappings also allow read-reordering, which may also
      be a problem.
      
      I found that when an SFC9000-family controller is connected to an
      Intel 3000 chipset, and write-combining is enabled, the controller
      stops responding to PCIe read requests during driver initialisation
      while the driver is polling for completion of an MCDI command.  This
      results in an NMI and system hang.  Adding read memory barriers
      between all reads to the shared memory area appears to reduce but not
      eliminate the probability of this.
      
      We have not yet established whether this is a bug in our BIU or in the
      PCIe bridge.  For now, work around by mapping the shared memory area
      separately.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      747df225