1. 13 12月, 2013 6 次提交
    • B
      sfc: Associate primary and secondary functions of controller · 0bcf4a64
      Ben Hutchings 提交于
      The primary function of an EF10 controller will share its clock
      device with other functions in the same domain (which we call
      secondary functions).  To this end, we need to associate functions
      on the same controller.
      
      We do not control probe order, so allow primary and secondary
      functions to appear in any order.  Maintain global lists of all
      primary functions and of unassociated secondary functions,
      and a list of secondary functions on each primary function.
      
      Use the VPD serial number to tell whether functions are part of the
      same controller.  VPD will not be readable by virtual functions, so
      this may need to be revisited later.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      0bcf4a64
    • J
      sfc: Add RX packet timestamping for EF10 · bd9a265d
      Jon Cooper 提交于
      The EF10 firmware can optionally insert RX timestamps in the packet
      prefix.  These only include the clock minor value.  We must also
      enable periodic time sync events on each event queue which provide
      the high bits of the clock value.
      
      [bwh: Combined and rebased several changes.
       Added the above description and some sanity checks for inline vs
       separate timestamps.
       Changed efx_rx_skb_attach_timestamp() to read the packet prefix
       from the skb head area.]
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      bd9a265d
    • B
      8349f7f6
    • B
    • E
      sfc: Log all unexpected MCDI errors · 1e0b8120
      Edward Cree 提交于
      Split each of efx_mcdi_rpc, efx_mcdi_rpc_finish, and efx_mcdi_rpc_async into
      a normal and a _quiet version; made the former log MCDI errors with
      netif_err (and include the raw MCDI error code), and the latter never log
      them at all.  Changed various callers; any where some errors are expected
      (but others are not) call the _quiet version and then if necessary log the
      MCDI error themselves.  Said logging is done by new efx_mcdi_display_error.
      
      Callers of efx_mcdi_rpc*_quiet functions which may want to log the error
      need to ensure that their outbuf is big enough to hold an MCDI error; to
      this end, they now use MCDI_DECLARE_BUF_OUT_OR_ERR, which always allocates
      at least 8 bytes.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      1e0b8120
    • J
      sfc: Add MC BISTs to ethtool offline self test on EF10 · 74cd60a4
      Jon Cooper 提交于
      To run BISTs the MC goes down in to a special mode where it will only
      respond to MCDI from the testing PF, and TX, RX and event queues are
      torn down. Other PFs get a message as it goes down to tell them it's
      going down.
      
      When the other PFs get this message, they check the soft status
      register to tell when the MC has rebooted after BIST mode and they can
      start recovery.
      
      [bwh: Convert the test result to 1 or -1 as for earlier NICs]
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      74cd60a4
  2. 07 12月, 2013 3 次提交
  3. 08 10月, 2013 1 次提交
    • B
      sfc: Only bind to EF10 functions with the LinkCtrl and Trusted flags · ecb1c9cc
      Ben Hutchings 提交于
      Although we do not yet enable multiple PFs per port, it is possible
      that a board will be reconfigured to enable them while the driver has
      not yet been updated to fully support this.
      
      The most obvious problem is that multiple functions may try to set
      conflicting link settings.  But we will also run into trouble if the
      firmware doesn't consider us fully trusted.  So, abort probing unless
      both the LinkCtrl and Trusted flags are set for this function.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      ecb1c9cc
  4. 21 9月, 2013 2 次提交
  5. 30 8月, 2013 6 次提交
  6. 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
  7. 22 8月, 2013 9 次提交
  8. 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
  9. 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
  10. 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
  11. 19 9月, 2012 2 次提交