1. 16 7月, 2014 1 次提交
  2. 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
  3. 13 2月, 2014 1 次提交
  4. 13 12月, 2013 11 次提交
  5. 07 12月, 2013 1 次提交
  6. 01 11月, 2013 1 次提交
    • A
      sfc: Fix DMA unmapping issue with firmware assisted TSO · 2acdb92e
      Alexandre Rames 提交于
      When using firmware assisted TSO, we use a single DMA mapping for
      the linear area of a TSO skb.
      
      We still have to segment the super-packet and insert a descriptor
      containing the original headers before each segment of payload, so we
      can unmap the linear area only after the last segment is completed.
      The unmapping information for the linear area is therefore associated
      with the last header descriptor.
      
      We calculate the DMA address to unmap from using the map length and
      the invariant that the end of the DMA mapping matches the end of
      the data referenced by the last descriptor.  But this invariant is
      broken when there is TCP payload in the linear area.
      
      Fix this by adding and using an explicit dma_offset field.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      2acdb92e
  7. 21 9月, 2013 2 次提交
    • J
      sfc: Use TX PIO for sufficiently small packets · ee45fd92
      Jon Cooper 提交于
      Sufficiently small linear packets can be copied into the PIO buffer
      with a single call to memcpy_toio().  Non-linear packets require an
      intermediate cache-line-sized buffer.
      
      [bwh: I wrote the first version of this, but Jon did the hard work to
       handle non-linear packets.]
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      ee45fd92
    • B
      sfc: Allocate and link PIO buffers; map them with write-combining · 183233be
      Ben Hutchings 提交于
      Try to allocate a segment of PIO buffer to each TX channel.  If
      allocation fails, log an error but continue.
      
      PIO buffers must be mapped separately from the NIC registers, with
      write-combining enabled.  Where the host page size is 4K, we could
      potentially map each VI's registers and PIO buffer separately.
      However, this would add significant complexity, and we also need to
      support architectures such as POWER which have a greater page size.
      So make a single contiguous write-combining mapping after the
      uncacheable mapping, aligned to the host page size, and link PIO
      buffers there.  Where necessary, allocate additional VIs within
      the write-combining mapping purely for access to PIO buffers.
      
      Link all TX buffers to TX queues and the additional VIs in
      efx_ef10_dimension_resources() and in efx_ef10_init_nic() after
      an MC reboot.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      183233be
  8. 30 8月, 2013 7 次提交
  9. 28 8月, 2013 6 次提交
  10. 23 8月, 2013 4 次提交
    • B
      sfc: Eliminate struct efx_mtd · b766630b
      Ben Hutchings 提交于
      Currently we use struct efx_mtd to represent a physical NVRAM device
      and struct efx_mtd_partition to represent a partition on that device.
      But this only really makes sense for Falcon, as we don't know or care
      whether MC-managed NVRAM partitions are on one or more physical
      devices.  It complicates iteration and provides little benefit.
      Therefore:
      
      - Replace the pointer to efx_mtd in mtd_info::priv with a pointer to efx_nic
      - Move the falcon_spi_device pointer into the union in struct efx_mtd_partition
      - Move the device name to efx_mtd_partition::dev_type_name
      - Move the efx_mtd_ops pointer to efx_nic::mtd_ops
      - Make efx_nic::mtd_list a list of partitions
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      b766630b
    • B
      sfc: Cleanup Falcon-arch simple MAC filter state · 964e6135
      Ben Hutchings 提交于
      On Falcon we implement MAC filtering requested by the stack using the
      MAC wrapper's single unicast filter and multicast hash filter.  Siena
      is very similar, though MAC configuration is mediated by the MC.
      
      Since MCDI operations may sleep, reconfiguration is deferred from
      ndo_set_rx_mode to a work item.  However, it still updates the private
      variables describing the filter state synchronously.  Contrary to
      comments, the later use of these variables is not protected using the
      address lock, resulting in race conditions.
      
      Move the state update to a new function
      efx_farch_filter_sync_rx_mode() and make the Falcon-arch MAC
      configuration functions call that, so that its use is consistently
      serialised by the mac_lock.
      
      Invert and rename the promiscuous flag to the more accurate
      unicast_filter, and comment that both this and multicast_hash are
      not used on EF10.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      964e6135
    • B
      sfc: Make most filter operations NIC-type-specific · add72477
      Ben Hutchings 提交于
      Aside from accelerated RFS, there is almost nothing that can be shared
      between the filter table implementations for the Falcon architecture
      and EF10.
      
      Move the few shared functions into efx.c and rx.c and the rest into
      farch.c.  Introduce efx_nic_type operations for the implementation and
      inline wrapper functions that call these.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      add72477
    • B
      sfc: Split Falcon-arch-specific and common filter state · 6d661cec
      Ben Hutchings 提交于
      Move the common state from struct efx_filter_state into struct efx_nic.
      Rename struct efx_filter_state to efx_farch_filter_state and change
      the type of efx_nic::filter_state to void *.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      6d661cec
  11. 22 8月, 2013 5 次提交
    • B
      sfc: Do not assume efx_nic_type::ev_fini is idempotent · be3fc09c
      Ben Hutchings 提交于
      efx_fini_eventq() needs to be idempotent but EF10 firmware is
      picky about queue states.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      be3fc09c
    • B
      sfc: Get rid of per-NIC-type phys_addr_channels and mem_map_size · b105798f
      Ben Hutchings 提交于
      EF10 functions don't have a fixed BAR size, and the minimum is not
      large enough for all the queues we might want to allocate.  We have to
      find out the BAR size at run-time, and therefore phys_addr_channels
      and mem_map_size cannot be defined per-NIC-type.
      
      Change efx_nic_type::mem_map_size to a function pointer which is
      called to find the wanted memory map size (before probe).
      
      Replace efx_nic_type::phys_addr_channels with efx_nic::max_channels,
      to be initialised by the probe function.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      b105798f
    • 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
    • B
      sfc: Move and rename Falcon/Siena common NIC operations · 86094f7f
      Ben Hutchings 提交于
      Add efx_nic_type operations for the many efx_nic functions that need
      to be implemented different on EF10.  For now, change most of the
      existing efx_nic_*() functions into inline wrappers.  As a later step,
      we may be able to improve branch prediction for operations used on the
      fast path by copying the pointers into each queue/channel structure.
      
      Move the Falcon/Siena implementations to new file farch.c and rename
      the functions and static data to use a prefix of 'efx_farch_'.
      
      Move efx_may_push_tx_desc() to nic.h, as the EF10 TX code will also
      use it.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      86094f7f
    • B
      sfc: Refactor queue teardown sequence to allow for EF10 flush behaviour · e42c3d85
      Ben Hutchings 提交于
      Currently efx_stop_datapath() will try to flush our DMA queues (if DMA
      is enabled), then finalise software and hardware state for each queue.
      However, for EF10 we must ask the MC to finalise each queue, which
      implicitly starts flushing it, and then wait for the flush events.
      We therefore need to delegate more of this to the NIC type.
      
      Combine all the hardware operations into a new NIC-type operation
      efx_nic_type::fini_dmaq, and call this before tearing down the
      software state and buffers for all the DMA queues.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      e42c3d85