1. 17 5月, 2011 1 次提交
  2. 12 4月, 2011 1 次提交
    • B
      sfc: Do not use efx_process_channel_now() in online self-test · d4fabcc8
      Ben Hutchings 提交于
      During self-tests we use efx_process_channel_now() to handle
      completion and other events synchronously.  This disables interrupts
      and NAPI processing for the channel in question, but it may still be
      interrupted by another channel.  A single socket may receive packets
      from multiple net devices or even multiple channels of the same net
      device, so this can result in deadlock on a socket lock.
      
      Receiving packets in process context will also result in incorrect
      classification by the network cgroup classifier.
      
      Therefore, we must only use efx_process_channel_now() in the offline
      loopback tests (which never deliver packets up the stack) and not for
      the online interrupt and event tests.
      
      For the interrupt test, there is no reason to process events.  We
      only care that an interrupt is raised.
      
      For the event test, we want to know whether events have been received,
      and there may be many events ahead of the one we inject.  Therefore
      remove efx_channel::magic_count and instead test whether
      efx_channel::eventq_read_ptr advances.  This is currently an event
      queue index and might wrap around to exactly the same value, resulting
      in a false negative.  Therefore move the masking to efx_event() and
      efx_nic_eventq_read_ack() so that it cannot wrap within the time of
      the test.
      
      The event test also tries to diagnose failures by checking whether an
      event was delivered without causing an interrupt.  Add and use a
      helper function that only does this.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      d4fabcc8
  3. 01 3月, 2011 2 次提交
  4. 16 2月, 2011 1 次提交
    • B
      sfc: Add TX queues for high-priority traffic · 94b274bf
      Ben Hutchings 提交于
      Implement the ndo_setup_tc() operation with 2 traffic classes.
      
      Current Solarstorm controllers do not implement TX queue priority, but
      they do allow queues to be 'paced' with an enforced delay between
      packets.  Paced and unpaced queues are scheduled in round-robin within
      two separate hardware bins (paced queues with a large delay may be
      placed into a third bin temporarily, but we won't use that).  If there
      are queues in both bins, the TX scheduler will alternate between them.
      
      If we make high-priority queues unpaced and best-effort queues paced,
      and high-priority queues are mostly empty, a single high-priority queue
      can then instantly take 50% of the packet rate regardless of how many
      of the best-effort queues have descriptors outstanding.
      
      We do not actually want an enforced delay between packets on best-
      effort queues, so we set the pace value to a reserved value that
      actually results in a delay of 0.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      94b274bf
  5. 08 12月, 2010 1 次提交
    • B
      sfc: Fix crash in legacy onterrupt handler during ring reallocation · 94dec6a2
      Ben Hutchings 提交于
      If we are using a legacy interrupt, our IRQ may be shared and our
      interrupt handler may be called even though interrupts are disabled on
      the NIC. When we change ring sizes, we reallocate the event queue and
      the interrupt handler may use an invalid pointer when called for
      another device's interrupt.
      
      Maintain a legacy_irq_enabled flag and test that at the top of the
      interrupt handler.  Note that this problem results from the need to
      work around broken INT_ISR0 reads, and does not affect the legacy
      interrupt handler for Falcon A1.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      94dec6a2
  6. 07 12月, 2010 1 次提交
    • B
      sfc: Use TX push whenever adding descriptors to an empty queue · cd38557d
      Ben Hutchings 提交于
      Whenever we add DMA descriptors to a TX ring and update the ring
      pointer, the TX DMA engine must first read the new DMA descriptors and
      then start reading packet data.  However, all released Solarflare 10G
      controllers have a 'TX push' feature that allows us to reduce latency
      by writing the first new DMA descriptor along with the pointer update.
      This is only useful when the queue is empty.  The hardware should
      ignore the pushed descriptor if the queue is not empty, but this check
      is buggy, so we must do it in software.
      
      In order to tell whether a TX queue is empty, we need to compare the
      previous transmission count (write_count) and completion count
      (read_count).  However, if we do that every time we update the ring
      pointer then read_count may ping-pong between the caches of two CPUs
      running the transmission and completion paths for the queue.
      Therefore, we split the check for an empty queue between the
      completion path and the transmission path:
      
      - Add an empty_read_count field representing a point at which the
        completion path saw the TX queue as empty.
      - Add an old_write_count field for use on the completion path.
      - On the completion path, whenever read_count reaches or passes
        old_write_count the TX queue may be empty.  We then read
        write_count, set empty_read_count if read_count == write_count,
        and update old_write_count.
      - On the transmission path, we read empty_read_count.  If it's set, we
        compare it with the value of write_count before the current set of
        descriptors was added.  If they match, the queue really is empty and
        we can use TX push.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      cd38557d
  7. 04 12月, 2010 1 次提交
  8. 21 10月, 2010 1 次提交
  9. 27 9月, 2010 1 次提交
  10. 22 9月, 2010 1 次提交
  11. 11 9月, 2010 5 次提交
  12. 01 7月, 2010 1 次提交
  13. 25 6月, 2010 2 次提交
  14. 02 6月, 2010 3 次提交
    • S
      sfc: Remove efx_rx_queue::add_lock · 90d683af
      Steve Hodgson 提交于
      Ensure that efx_fast_push_rx_descriptors() must only run
      from efx_process_channel() [NAPI], or when napi_disable()
      has been executed.
      
      Reimplement the slow fill by sending an event to the
      channel, so that NAPI runs, and hanging the subsequent
      fast fill off the event handler. Replace the sfc_refill
      workqueue and delayed work items with a timer. We do
      not need to stop this timer in efx_flush_all() because
      it's safe to send the event always; receiving it will
      be delayed until NAPI is restarted.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      90d683af
    • S
      sfc: Allow DRV_GEN events to be used outside of selftests · d730dc52
      Steve Hodgson 提交于
      Formerly, efx_test_eventq_irq() assumed it was the only user of
      driver generated events. Allow it to interoperate with other users.
      
      We can create more than 16 channels, so align event codes with
      a multiple of 256 not 16.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d730dc52
    • S
      sfc: Workaround flush failures on Falcon B0 · fd371e32
      Steve Hodgson 提交于
      Under certain conditions a PHY may backpressure Falcon B0
      in such a way that flushes timeout. In normal circumstances
      the phy poller would fix the PHY, and the flush could complete.
      
      But efx_nic_flush_queues() is always called after efx_stop_all(),
      so the poller has been stopped. Even if this weren't the case,
      how long would we have to wait for the poller to fix this? And
      several callers of efx_nic_flush_queues() are about to reset
      the device anyway - so we don't need to do anything.
      
      Work around this bug by scheduling a reset. Ensure that the
      MAC is never rewired back into the datapath before the reset
      runs (we already ignore all rx events anyway).
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fd371e32
  15. 29 4月, 2010 6 次提交
  16. 04 2月, 2010 2 次提交
  17. 24 12月, 2009 1 次提交
  18. 30 11月, 2009 3 次提交