diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2013-02-27 16:50:38 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-28 12:06:01 -0700 |
commit | 9bb104c28a389c39812b15b39672aa87b91bcd79 (patch) | |
tree | cd5c52c4ad573d67d603b2a04da8aaafe4521389 /drivers | |
parent | ad0c4a9fa31036fefb30385edfbd1feb8971de97 (diff) | |
download | kernel_samsung_aries-9bb104c28a389c39812b15b39672aa87b91bcd79.zip kernel_samsung_aries-9bb104c28a389c39812b15b39672aa87b91bcd79.tar.gz kernel_samsung_aries-9bb104c28a389c39812b15b39672aa87b91bcd79.tar.bz2 |
sfc: Only use TX push if a single descriptor is to be written
[ Upstream commit fae8563b25f73dc584a07bcda7a82750ff4f7672 ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/sfc/nic.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/sfc/nic.c b/drivers/net/sfc/nic.c index 854df4e..4949004 100644 --- a/drivers/net/sfc/nic.c +++ b/drivers/net/sfc/nic.c @@ -370,7 +370,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 |