1. 22 7月, 2015 1 次提交
  2. 28 5月, 2015 3 次提交
  3. 22 5月, 2015 2 次提交
  4. 10 5月, 2015 4 次提交
    • S
      sfc: Bind the sfc driver to any available VF's · 6f7f8aa6
      Shradha Shah 提交于
      Add the device ID of the VF to the PCI device ID table.
      
      Added a boolean flag is_vf in efx_nic_type to differentiate
      between a VF and PF at probe time. This flag is useful in later
      patches while setting MAC address specially in the
      PCI-passthrough case.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6f7f8aa6
    • E
      sfc: Cope with permissions enforcement added to firmware for SR-IOV · 267d9d73
      Edward Cree 提交于
      * Accept EPERM in some simple cases, the following cases are handled:
      1) efx_mcdi_read_assertion()
      Unprivileged PCI functions aren't allowed to GET_ASSERTS.
      We return success as it's up to the primary PF to deal with asserts.
      2) efx_mcdi_mon_probe() in efx_ef10_probe()
      Unprivileged PCI functions aren't allowed to read sensor info, and
      worrying about sensor data is the primary PF's job.
      3) phy_op->reconfigure() in efx_init_port() and efx_reset_up()
      Unprivileged functions aren't allowed to MC_CMD_SET_LINK, they just have
      to accept the settings (including flow-control, which is what
      efx_init_port() is worried about) they've been given.
      4) Fallback to GET_WORKAROUNDS in efx_ef10_probe()
      Unprivileged PCI functions aren't allowed to set workarounds. So if
      efx_mcdi_set_workaround() fails EPERM, use efx_mcdi_get_workarounds()
      to find out if workaround_35388 is enabled.
      5) If DRV_ATTACH gets EPERM, try without specifying fw-variant
      Unprivileged PCI functions have to use a FIRMWARE_ID of 0xffffffff
      (MC_CMD_FW_DONT_CARE).
      6) Don't try to exit_assertion unless one had fired
      Previously we called efx_mcdi_exit_assertion even if
      efx_mcdi_read_assertion had received MC_CMD_GET_ASSERTS_FLAGS_NO_FAILS.
      This is unnecessary, and the resulting MC_CMD_REBOOT, even if the
      AFTER_ASSERTION flag made it a no-op, would fail EPERM for unprivileged
      PCI functions.
      So make efx_mcdi_read_assertion return whether an assert happened, and only
      call efx_mcdi_exit_assertion if it has.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      267d9d73
    • D
      sfc: Record [rt]x_dpcpu_fw_id in EF10 nic_data · 8d9f9dd4
      Daniel Pieczko 提交于
      The (future) code to add/remove vswitches and vports will be
      dependent on the firmware variant.
      To simplify the checking of the firmware variant, record
      values for rx_dpcpu_fw_id and tx_dpcpu_fw_id in EF10 nic_data.
      
      There was only one place where this was previously used:
      efx_mcdi_print_fwver() in ethtool.c.
      The MC_CMD_GET_CAPABILITIES can be replaced and the values from
      nic_data used instead.
      
      Note that the printing of "?" if the MC command fails or if the
      outlength is incorrect no longer apply, because errors are returned
      in efx_ef10_init_datapath_caps() in both of these cases.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d9f9dd4
    • S
      sfc: Own header for nic-specific sriov functions, single instance of... · 7fa8d547
      Shradha Shah 提交于
      sfc: Own header for nic-specific sriov functions, single instance of netdev_ops and sriov removed from Falcon code
      
      By putting all the efx_{siena,ef10}_sriov_* declarations in
      {siena,ef10}_sriov.h, ensure they cannot be called from nic-generic code.
      Also fixes up an instance of this, where mcdi.c was calling
      efx_siena_sriov_flr.
      
      The single instance of netdev_ops should call general high level
      functions that can then call something adapter specific in efx_nic_type.
      We should only do adapter specialisation via efx_nic_type.
      
      Removal of sriov functionality from the Falcon code means that tests
      are needed for the presence of some callbacks.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7fa8d547
  5. 09 4月, 2015 2 次提交
  6. 07 11月, 2014 1 次提交
  7. 17 4月, 2014 1 次提交
    • E
      sfc:On MCDI timeout, issue an FLR (and mark MCDI to fail-fast) · e283546c
      Edward Cree 提交于
      When an MCDI command times out (whether or not we find it
      completed when we poll), call efx_mcdi_abandon(), which tells
      all subsequent MCDI calls to fail-fast, and queues up an FLR.
      
      Because an FLR doesn't lead to receiving any reboot even from
      the MC (unlike most other types of reset), we have to call
      efx_ef10_reset_mc_allocations.
      In efx_start_all(), if a reset (of any kind) is pending, we
      bail out.
      Without this, attempts to reconfigure (e.g. change mtu) can
      cause driver/mc state inconsistency if the first MCDI call
      triggers an FLR.
      
      For similar reasons, on EF10, in
      efx_reset_down(method=RESET_TYPE_MCDI_TIMEOUT), set the number
      of active queues to zero before calling efx_stop_all().
      And, on farch, in efx_reset_up(method=RESET_TYPE_MCDI_TIMEOUT),
      set active_queues and flushes pending & outstanding to zero.
      
      efx_mcdi_mode_{poll,event}() should not take us out of fail-fast
       mode. Instead, this is done by efx_mcdi_reset() after the FLR
      completes.
      
      The new FLR reset_type RESET_TYPE_MCDI_TIMEOUT doesn't really
      fit into the hierarchy of reset 'scopes' whereby efx_reset()
      decides some resets subsume others.  Thus, it uses separate logic.
      
      Also, fixed up some inconsistency around RESET_TYPE_MC_BIST,
      which was in the wrong place in that hierarchy.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e283546c
  8. 11 3月, 2014 1 次提交
  9. 22 1月, 2014 1 次提交
  10. 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
  11. 07 12月, 2013 3 次提交
  12. 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
  13. 21 9月, 2013 2 次提交
  14. 30 8月, 2013 6 次提交
  15. 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
  16. 22 8月, 2013 2 次提交
    • B
      sfc: Fix race in completion handling · 369327fa
      Ben Hutchings 提交于
      When we poll for MCDI request completion, we don't hold the interface
      lock while setting the response fields in struct efx_mcdi_iface.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      369327fa
    • B
      sfc: Add support for MCDI v2 · df2cd8af
      Ben Hutchings 提交于
      MCDI v2 adds a second header dword with wider command and length
      fields.  It also defines extra error codes.
      
      Change the fallback error number for unknown MCDI error codes from EIO
      to EPROTO.  EIO is treated as indicating the MCDI transport has failed
      and we need to reset the function, which is rather drastic.
      
      v2 error codes and lengths don't fit into completion events, so for a
      v2-capable transport, always read the response header rather then
      using the event fields.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      df2cd8af