1. 13 12月, 2013 3 次提交
  2. 07 12月, 2013 1 次提交
  3. 21 9月, 2013 1 次提交
  4. 30 8月, 2013 3 次提交
  5. 28 8月, 2013 2 次提交
  6. 23 8月, 2013 1 次提交
  7. 22 8月, 2013 2 次提交
  8. 05 7月, 2013 1 次提交
    • B
      sfc: Fix memory leak when discarding scattered packets · 734d4e15
      Ben Hutchings 提交于
      Commit 2768935a ('sfc: reuse pages to avoid DMA mapping/unmapping
      costs') did not fully take account of DMA scattering which was
      introduced immediately before.  If a received packet is invalid and
      must be discarded, we only drop a reference to the first buffer's
      page, but we need to drop a reference for each buffer the packet
      used.
      
      I think this bug was missed partly because efx_recycle_rx_buffers()
      was not renamed and so no longer does what its name says.  It does not
      change the state of buffers, but only prepares the underlying pages
      for recycling.  Rename it accordingly.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      734d4e15
  9. 25 6月, 2013 4 次提交
  10. 15 5月, 2013 2 次提交
    • B
      sfc: Reduce RX scatter buffer size, and reduce alignment if appropriate · 950c54df
      Ben Hutchings 提交于
      efx_start_datapath() asserts that we can fit 2 RX scatter buffers plus
      a software structure, each appropriately aligned, into a single page.
      Where L1_CACHE_BYTES == 256 and PAGE_SIZE == 4096, which is the case
      on s390, this assertion fails.
      
      The current scatter buffer size is also not a multiple of 64 or 128,
      which are more common cache line sizes.  If we can make both the start
      and end of a scatter buffer cache-aligned, this will reduce the need
      for read-modify-write operations on inter- processor links.
      
      Fix the alignment by reducing EFX_RX_USR_BUF_SIZE to 2048 - 256 ==
      1792.  (We could use 2048 - L1_CACHE_BYTES, but EFX_RX_USR_BUF_SIZE
      also affects user-level networking where a larger amount of
      housekeeping data may be needed.  Although this version of the driver
      does not support user-level networking, I prefer to keep scattering
      behaviour consistent with the out-of-tree version.)
      
      This still doesn't fix the s390 build because like most architectures
      it has NET_IP_ALIGN == 2.  When NET_IP_ALIGN != 0 we cannot achieve
      cache line alignment at either the start or end of a scatter buffer,
      so there is actually no point in padding the buffers to a multiple of
      the cache line size.  All we need is 4-byte alignment of the network
      header, so do that.
      
      Adjust the assertions accordingly.
      Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Reported-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Acked-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      950c54df
    • B
      sfc: Delete EFX_PAGE_IP_ALIGN, equivalent to NET_IP_ALIGN · c14ff2ea
      Ben Hutchings 提交于
      The two architectures that define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
      (powerpc and x86) now both define NET_IP_ALIGN as 0, so there is no
      need for this optimisation any more.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c14ff2ea
  11. 18 3月, 2013 1 次提交
  12. 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
  13. 07 3月, 2013 1 次提交
  14. 26 2月, 2013 2 次提交
  15. 01 12月, 2012 1 次提交
  16. 08 9月, 2012 2 次提交
  17. 17 7月, 2012 1 次提交
  18. 11 7月, 2012 1 次提交