summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorBen Hutchings2013-02-27 17:50:38 +0100
committerBen Hutchings2013-03-12 18:07:56 +0100
commitfae8563b25f73dc584a07bcda7a82750ff4f7672 (patch)
tree3a3722b4905ad3de3cc467108290ae4a779249f7 /drivers/net
parentsfc: Correct efx_rx_buffer::page_offset when EFX_PAGE_IP_ALIGN != 0 (diff)
downloadkernel-qcow2-linux-fae8563b25f73dc584a07bcda7a82750ff4f7672.tar.gz
kernel-qcow2-linux-fae8563b25f73dc584a07bcda7a82750ff4f7672.tar.xz
kernel-qcow2-linux-fae8563b25f73dc584a07bcda7a82750ff4f7672.zip
sfc: Only use TX push if a single descriptor is to be written
Using TX push when notifying the NIC of multiple new descriptors in the ring will very occasionally cause the TX DMA engine to re-use an old descriptor. This can result in a duplicated or partly duplicated packet (new headers with old data), or an IOMMU page fault. This does not happen when the pushed descriptor is the only one written. TX push also provides little latency benefit when a packet requires more than one descriptor. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/sfc/nic.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/nic.c b/drivers/net/ethernet/sfc/nic.c
index 0ad790cc473c..eaa8e874a3cb 100644
--- a/drivers/net/ethernet/sfc/nic.c
+++ b/drivers/net/ethernet/sfc/nic.c
@@ -376,7 +376,8 @@ efx_may_push_tx_desc(struct efx_tx_queue *tx_queue, unsigned int write_count)
return false;
tx_queue->empty_read_count = 0;
- return ((empty_read_count ^ write_count) & ~EFX_EMPTY_COUNT_VALID) == 0;
+ return ((empty_read_count ^ write_count) & ~EFX_EMPTY_COUNT_VALID) == 0
+ && tx_queue->write_count - write_count == 1;
}
/* For each entry inserted into the software descriptor ring, create a