linux/drivers/net/sfc
Ben Hutchings cd38557d78 sfc: Use TX push whenever adding descriptors to an empty queue
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: Ben Hutchings <bhutchings@solarflare.com>
2010-12-06 23:00:07 +00:00
..
bitfield.h sfc: Update version, copyright dates, authors 2009-11-29 17:23:58 -08:00
efx.c sfc: Store MAC address from NVRAM in net_device::perm_addr 2010-12-03 09:08:11 -08:00
efx.h sfc: make functions static 2010-10-21 03:09:43 -07:00
enum.h sfc: Update version, copyright dates, authors 2009-11-29 17:23:58 -08:00
ethtool.c sfc: Remove unnecessary inclusion of various private header files 2010-12-03 09:08:07 -08:00
falcon_boards.c sfc: Move xmac_poll_required into struct falcon_nic_data 2010-12-03 09:08:09 -08:00
falcon_xmac.c sfc: Move xmac_poll_required into struct falcon_nic_data 2010-12-03 09:08:09 -08:00
falcon.c sfc: Store MAC address from NVRAM in net_device::perm_addr 2010-12-03 09:08:11 -08:00
filter.c drivers/net: use vzalloc() 2010-11-27 22:53:38 -08:00
filter.h sfc: Add filter table management 2010-09-21 14:58:00 -07:00
io.h sfc: Remove locking from implementation of efx_writeo_paged() 2010-12-06 22:58:41 +00:00
Kconfig sfc: Add support for SFC9000 family (2) 2009-11-29 17:23:57 -08:00
mac.h sfc: make functions static 2010-10-21 03:09:43 -07:00
Makefile sfc: Add support for SFE4003 board and TXC43128 PHY 2010-09-22 13:26:45 -07:00
mcdi_mac.c sfc: Implement message level control 2010-06-24 22:13:22 -07:00
mcdi_pcol.h sfc: Update MCDI protocol definitions 2010-04-28 12:44:37 -07:00
mcdi_phy.c sfc: Remove unnecessary inclusion of various private header files 2010-12-03 09:08:07 -08:00
mcdi.c sfc: Fix event based MCDI completion and MC REBOOT/CMDDONE ordering issue 2010-12-03 09:08:05 -08:00
mcdi.h sfc: make functions static 2010-10-21 03:09:43 -07:00
mdio_10g.c sfc: Remove unnecessary inclusion of various private header files 2010-12-03 09:08:07 -08:00
mdio_10g.h sfc: Implement message level control 2010-06-24 22:13:22 -07:00
mtd.c sfc: Move SPI state to struct falcon_nic_data 2010-12-03 09:08:07 -08:00
net_driver.h sfc: Use TX push whenever adding descriptors to an empty queue 2010-12-06 23:00:07 +00:00
nic.c sfc: Use TX push whenever adding descriptors to an empty queue 2010-12-06 23:00:07 +00:00
nic.h sfc: Update kernel-doc to match earlier move of Toeplitz hash key 2010-12-03 09:08:09 -08:00
phy.h sfc: Add support for SFE4003 board and TXC43128 PHY 2010-09-22 13:26:45 -07:00
qt202x_phy.c sfc: Clear RXIN_SEL when soft-resetting QT2025C 2010-12-03 09:08:04 -08:00
regs.h sfc: Add filter table management 2010-09-21 14:58:00 -07:00
rx.c sfc: Make the dmaq size a run-time setting (rather than compile-time) 2010-09-10 12:27:33 -07:00
selftest.c sfc: make functions static 2010-10-21 03:09:43 -07:00
selftest.h sfc: Create multiple TX queues 2010-04-28 12:44:44 -07:00
siena.c sfc: Store MAC address from NVRAM in net_device::perm_addr 2010-12-03 09:08:11 -08:00
spi.h sfc: Move SPI state to struct falcon_nic_data 2010-12-03 09:08:07 -08:00
tenxpress.c sfc: Remove unnecessary inclusion of various private header files 2010-12-03 09:08:07 -08:00
tx.c sfc: Use TX push whenever adding descriptors to an empty queue 2010-12-06 23:00:07 +00:00
txc43128_phy.c sfc: Add support for SFE4003 board and TXC43128 PHY 2010-09-22 13:26:45 -07:00
workarounds.h sfc: Remove support for SFN4111T, SFT9001 and Falcon GMAC 2010-09-22 13:26:45 -07:00