1. 08 3月, 2013 11 次提交
    • D
      sfc: allocate more RX buffers per page · 1648a23f
      Daniel Pieczko 提交于
      Allocating 2 buffers per page is insanely inefficient when MTU is 1500
      and PAGE_SIZE is 64K (as it usually is on POWER).  Allocate as many as
      we can fit, and choose the refill batch size at run-time so that we
      still always use a whole page at once.
      
      [bwh: Fix loop condition to allow for compound pages; rebase]
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      1648a23f
    • B
      sfc: Replace efx_rx_is_last_buffer() with a flag · 179ea7f0
      Ben Hutchings 提交于
      This condition is brittle and we have lots of flags to spare.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      179ea7f0
    • D
      sfc: reuse pages to avoid DMA mapping/unmapping costs · 2768935a
      Daniel Pieczko 提交于
      On POWER systems, DMA mapping/unmapping operations are very expensive.
      These changes reduce these costs by trying to reuse DMA mapped pages.
      
      After all the buffers associated with a page have been processed and
      passed up, the page is placed into a ring (if there is room).  For
      each page that is required for a refill operation, a page in the ring
      is examined to determine if its page count has fallen to 1, ie. the
      kernel has released its reference to these packets.  If this is the
      case, the page can be immediately added back into the RX descriptor
      ring, without having to re-map it for DMA.
      
      If the kernel is still holding a reference to this page, it is removed
      from the ring and unmapped for DMA.  Then a new page, which can
      immediately be used by RX buffers in the descriptor ring, is allocated
      and DMA mapped.
      
      The time a page needs to spend in the recycle ring before the kernel
      has released its page references is based on the number of buffers
      that use this page.  As large pages can hold more RX buffers, the RX
      recycle ring can be shorter.  This reduces memory usage on POWER
      systems, while maintaining the performance gain achieved by recycling
      pages, following the driver change to pack more than two RX buffers
      into large pages.
      
      When an IOMMU is not present, the recycle ring can be small to reduce
      memory usage, since DMA mapping operations are inexpensive.
      
      With a small recycle ring, attempting to refill the descriptor queue
      with more buffers than the equivalent size of the recycle ring could
      ultimately lead to memory leaks if page entries in the recycle ring
      were overwritten.  To prevent this, the check to see if the recycle
      ring is full is changed to check if the next entry to be written is
      NULL.
      
      [bwh: Combine and rebase several commits so this is complete
       before the following buffer-packing changes.  Remove module
       parameter.]
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      2768935a
    • B
      sfc: Enable RX DMA scattering where possible · 85740cdf
      Ben Hutchings 提交于
      Enable RX DMA scattering iff an RX buffer large enough for the current
      MTU will not fit into a single page and the NIC supports DMA
      scattering for kernel-mode RX queues.
      
      On Falcon and Siena, the RX_USR_BUF_SIZE field is used as the DMA
      limit for both all RX queues with scatter enabled.  Set it to 1824,
      matching what Onload uses now.
      
      Maintain a statistic for frames truncated due to lack of descriptors
      (rx_nodesc_trunc).  This is distinct from rx_frm_trunc which may be
      incremented when scattering is disabled and implies an over-length
      frame.
      
      Whenever an MTU change causes scattering to be turned on or off,
      update filters that point to the PF queues, but leave others
      unchanged, as VF drivers assume scattering is off.
      
      Add n_frags parameters to various functions, and make them iterate:
      - efx_rx_packet()
      - efx_recycle_rx_buffers()
      - efx_rx_mk_skb()
      - efx_rx_deliver()
      
      Make efx_handle_rx_event() responsible for updating
      efx_rx_queue::removed_count.
      
      Change the RX pipeline state to a starting ring index and number of
      fragments, and make __efx_rx_packet() responsible for clearing it.
      
      Based on earlier versions by David Riddoch and Jon Cooper.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      85740cdf
    • B
      sfc: Update RX buffer address together with length · b74e3e8c
      Ben Hutchings 提交于
      Adjust rx_buf->page_offset when we eat the RX hash prefix.  Remove
      efx_rx_buf_offset(), which is now redundant.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      b74e3e8c
    • B
      sfc: Explicitly prefetch RX hash prefix, not just Ethernet heade · 5036b7c7
      Ben Hutchings 提交于
      Currently we prefetch from the Ethernet header, but we will also read
      the hash prefix.  In practice they should be in the same cache line
      and this won't hurt, but it is still pointless to add on the hash
      prefix size.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      5036b7c7
    • B
      sfc: Replace efx_rx_buf_eh() with simpler efx_rx_buf_va() · b184f16b
      Ben Hutchings 提交于
      efx_rx_buf_va() returns the virtual address of the current start of
      the buffer.  The callers must add the hash prefix size themselves.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      b184f16b
    • B
      sfc: Wrap __efx_rx_packet() with efx_rx_flush_packet() · ff734ef4
      Ben Hutchings 提交于
      The pipeline mechanism will need to change a bit for scattered
      packets.  Add a wrapper to insulate efx_process_channel() from this.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      ff734ef4
    • B
      sfc: Properly distinguish RX buffer and DMA lengths · 272baeeb
      Ben Hutchings 提交于
      Replace efx_nic::rx_buffer_len with efx_nic::rx_dma_len, the maximum
      RX DMA length.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      272baeeb
    • A
      sfc: Remove rx_alloc_method SKB · 97d48a10
      Alexandre Rames 提交于
      [bwh: Remove more dead code, and make efx_ptp_rx() pull the data it
       needs into the header area.]
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      97d48a10
    • B
      sfc: Allow efx_channel_type::receive_skb() to reject a packet · 4a74dc65
      Ben Hutchings 提交于
      Instead of having efx_ptp_rx() call netif_receive_skb() for an invalid
      PTP packet, make it return false for rejected packets and have
      efx_rx_deliver() pass them up.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      4a74dc65
  2. 07 3月, 2013 1 次提交
  3. 26 2月, 2013 2 次提交
  4. 01 12月, 2012 1 次提交
  5. 08 9月, 2012 2 次提交
  6. 17 7月, 2012 1 次提交
  7. 11 7月, 2012 1 次提交
  8. 10 5月, 2012 2 次提交
  9. 07 3月, 2012 1 次提交
  10. 25 2月, 2012 1 次提交
    • B
      sfc: Fix assignment of ip_summed for pre-allocated skbs · ff3bc1e7
      Ben Hutchings 提交于
      When pre-allocating skbs for received packets, we set ip_summed =
      CHECKSUM_UNNCESSARY.  We used to change it back to CHECKSUM_NONE when
      the received packet had an incorrect checksum or unhandled protocol.
      
      Commit bc8acf2c ('drivers/net: avoid
      some skb->ip_summed initializations') mistakenly replaced the latter
      assignment with a DEBUG-only assertion that ip_summed ==
      CHECKSUM_NONE.  This assertion is always false, but it seems no-one
      has exercised this code path in a DEBUG build.
      
      Fix this by moving our assignment of CHECKSUM_UNNECESSARY into
      efx_rx_packet_gro().
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      ff3bc1e7
  11. 16 2月, 2012 2 次提交
    • B
      sfc: Leave interrupts and event queues enabled whenever we can · 9f2cb71c
      Ben Hutchings 提交于
      When SR-IOV is enabled we may receive FLR (Function-Level Reset)
      events, associated queue flush events and requests from VF drivers at
      any time.  Therefore we need to keep event queues and interrupts
      enabled whenever possible.
      
      Currently we stop interrupt-driven event processing before flushing RX
      and TX queues; efx_nic_flush_queues() then polls event queues for
      flush events and discards any others it finds.  Change it to work with
      the regular event handling functions.
      
      Currently efx_start_channel() fills RX queues synchronously when a
      device is brought up.  This could now race with NAPI, so change it to
      send fill events.
      
      This was almost entirely written by Steve Hodgson, formerly
      shodgson@solarflare.com.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      9f2cb71c
    • B
      sfc: Generate RX fill events based on RX queues, not channels · 2ae75dac
      Ben Hutchings 提交于
      This makes it harder to accidentally send such events to TX-only
      channels.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      2ae75dac
  12. 31 1月, 2012 1 次提交
    • B
      sfc: Use a more sensible cast in efx_rx_buf_offset() · 06e63c57
      Ben Hutchings 提交于
      This function returns the page offset of the buffer, which can be
      calculated based on either its DMA address or its virtual address.  It
      used to use the virtual address and we would cast that to unsigned
      long, as anything smaller would result in a compiler warning.  Now
      that it's using the DMA address we should use unsigned int, matching
      the return type.  It is also unnecessary to use __force.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      06e63c57
  13. 27 1月, 2012 2 次提交
  14. 06 1月, 2012 1 次提交
  15. 17 12月, 2011 1 次提交
  16. 04 12月, 2011 1 次提交
  17. 01 11月, 2011 1 次提交
  18. 19 10月, 2011 1 次提交
  19. 23 9月, 2011 1 次提交
  20. 11 8月, 2011 1 次提交
  21. 23 5月, 2011 2 次提交
    • P
      Add appropriate <linux/prefetch.h> include for prefetch users · 70c71606
      Paul Gortmaker 提交于
      After discovering that wide use of prefetch on modern CPUs
      could be a net loss instead of a win, net drivers which were
      relying on the implicit inclusion of prefetch.h via the list
      headers showed up in the resulting cleanup fallout.  Give
      them an explicit include via the following $0.02 script.
      
       =========================================
       #!/bin/bash
       MANUAL=""
       for i in `git grep -l 'prefetch(.*)' .` ; do
       	grep -q '<linux/prefetch.h>' $i
       	if [ $? = 0 ] ; then
       		continue
       	fi
      
       	(	echo '?^#include <linux/?a'
       		echo '#include <linux/prefetch.h>'
       		echo .
       		echo w
       		echo q
       	) | ed -s $i > /dev/null 2>&1
       	if [ $? != 0 ]; then
       		echo $i needs manual fixup
       		MANUAL="$i $MANUAL"
       	fi
       done
       echo ------------------- 8\<----------------------
       echo vi $MANUAL
       =========================================
      Signed-off-by: NPaul <paul.gortmaker@windriver.com>
      [ Fixed up some incorrect #include placements, and added some
        non-network drivers and the fib_trie.c case    - Linus ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      70c71606
    • P
      drivers/net: add prefetch header for prefetch users · c0cba59e
      Paul Gortmaker 提交于
      After discovering that wide use of prefetch on modern CPUs
      could be a net loss instead of a win, net drivers which were
      relying on the implicit inclusion of prefetch.h via the list
      headers showed up in the resulting cleanup fallout.  Give
      them an explicit include via the following $0.02 script.
      
       =========================================
       #!/bin/bash
       MANUAL=""
       for i in `git grep -l 'prefetch(.*)' .` ; do
       	grep -q '<linux/prefetch.h>' $i
       	if [ $? = 0 ] ; then
       		continue
       	fi
      
       	(	echo '?^#include <linux/?a'
       		echo '#include <linux/prefetch.h>'
       		echo .
       		echo w
       		echo q
       	) | ed -s $i > /dev/null 2>&1
       	if [ $? != 0 ]; then
       		echo $i needs manual fixup
       		MANUAL="$i $MANUAL"
       	fi
       done
       echo ------------------- 8\<----------------------
       echo vi $MANUAL
       =========================================
      Signed-off-by: NPaul <paul.gortmaker@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c0cba59e
  22. 05 4月, 2011 1 次提交
  23. 02 4月, 2011 1 次提交
  24. 01 3月, 2011 1 次提交