]> git.karo-electronics.de Git - karo-tx-linux.git/commit
sfc: Properly sync RX DMA buffer when it is not the last in the page
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 20 Dec 2012 18:48:20 +0000 (18:48 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Mar 2013 19:17:25 +0000 (12:17 -0700)
commitcf14e115d0e34be7d4a393f032019b9408e863b5
treeb57eb5ab541292bc7a722faa84164be80aa6b09d
parentaa94bf27d464126a42212d486211946f93d21b00
sfc: Properly sync RX DMA buffer when it is not the last in the page

[ Upstream commit 3a68f19d7afb80f548d016effbc6ed52643a8085 ]

We may currently allocate two RX DMA buffers to a page, and only unmap
the page when the second is completed.  We do not sync the first RX
buffer to be completed; this can result in packet loss or corruption
if the last RX buffer completed in a NAPI poll is the first in a page
and is not DMA-coherent.  (In the middle of a NAPI poll, we will
handle the following RX completion and unmap the page *before* looking
at the content of the first buffer.)

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/sfc/rx.c