1. 01 12月, 2012 1 次提交
    • B
      sfc: Really disable flow control while flushing · d5e8cc6c
      Ben Hutchings 提交于
      Receiving pause frames can block TX queue flushes.  Earlier changes
      work around this by reconfiguring the MAC during flushes for VFs, but
      during flushes for the PF we would only change the fc_disable counter.
      Unless the MAC is reconfigured for some other reason during the flush
      (which I would not expect to happen) this had no effect at all.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      d5e8cc6c
  2. 02 10月, 2012 1 次提交
    • B
      sfc: Fix null function pointer in efx_sriov_channel_type · 726ba0e1
      Ben Hutchings 提交于
      Commit c31e5f9f ('sfc: Add channel specific receive_skb handler and
      post_remove callback') added the function pointer field
      efx_channel_type::post_remove and an unconditional call through it.
      
      This field should have been initialised to efx_channel_dummy_op_void
      in the existing instances of efx_channel_type, but this was only done
      in efx_default_channel_type.  Consequently, if a device has SR-IOV
      enabled then removing the driver or device will result in an oops.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      726ba0e1
  3. 19 9月, 2012 1 次提交
    • B
      sfc: Avoid generating over-length MC_CMD_FLUSH_RX_QUEUES request · 45078374
      Ben Hutchings 提交于
      MCDI supports requests up to 252 bytes long, which is only enough to
      pass 63 RX queue IDs to MC_CMD_FLUSH_RX_QUEUES.  However a VF may have
      up to 64 RX queues, and if we try to flush them all we will generate
      an over-length request and BUG() in efx_mcdi_copyin().  Currently
      all VF drivers limit themselves to 32 RX queues, so reducing the
      limit to 63 does no harm.
      
      Also add a BUILD_BUG_ON in efx_mcdi_flush_rxqs() so we remember to
      deal with the same problem there if EFX_MAX_CHANNELS is increased.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      45078374
  4. 07 3月, 2012 1 次提交
  5. 23 2月, 2012 1 次提交
    • B
      sfc: Correct validation of peer_page_count in efx_vfdi_set_status_page() · 01cb543d
      Ben Hutchings 提交于
      efx_vfdi_set_status_page() validates the peer page count by
      calculating the size of a request containing that many addresses and
      comparing that with the maximum valid request size (4KB).  The
      calculation involves a multiplication that may overflow on a 32-bit
      system.
      
      We use kcalloc() to allocate memory to store the addresses; that also
      does a multiplication and it does check for integer overflow, so any
      values larger than 0x1fffffff will be rejected.  However, values in
      the range [0x1fffffffc, 0x1fffffff] pass boh tests and result in an
      attempt to allocate nearly 4GB on the heap.  This should be rejected
      rather quickly as it's obviously impossible on a 32-bit system, and
      indeed the maximum possible heap allocation is 32MB.  Still, let's
      make absolutely sure by fixing the initial validation.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      01cb543d
  6. 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