forked from Minki/linux
cd38557d78
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> |
||
---|---|---|
.. | ||
bitfield.h | ||
efx.c | ||
efx.h | ||
enum.h | ||
ethtool.c | ||
falcon_boards.c | ||
falcon_xmac.c | ||
falcon.c | ||
filter.c | ||
filter.h | ||
io.h | ||
Kconfig | ||
mac.h | ||
Makefile | ||
mcdi_mac.c | ||
mcdi_pcol.h | ||
mcdi_phy.c | ||
mcdi.c | ||
mcdi.h | ||
mdio_10g.c | ||
mdio_10g.h | ||
mtd.c | ||
net_driver.h | ||
nic.c | ||
nic.h | ||
phy.h | ||
qt202x_phy.c | ||
regs.h | ||
rx.c | ||
selftest.c | ||
selftest.h | ||
siena.c | ||
spi.h | ||
tenxpress.c | ||
tx.c | ||
txc43128_phy.c | ||
workarounds.h |