aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/appletalk
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@redhat.com>2014-12-11 18:02:17 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-11 21:15:06 -0500
commita0750138704a63834bac065c24d227c08768a019 (patch)
tree3d766919775414c5e8a9737995aa1d0eef9f7829 /drivers/net/appletalk
parent1077fa36f23e259858caf6f269a47393a5aff523 (diff)
r8169: Use dma_rmb() and dma_wmb() for DescOwn checks
The r8169 use a pair of wmb() calls when setting up the descriptor rings. The first is to synchronize the descriptor data with the descriptor status, and the second is to synchronize the descriptor status with the use of the MMIO doorbell to notify the device that descriptors are ready. This can come at a heavy price on some systems, and is not really necessary on systems such as x86 as a simple barrier() would suffice to order store/store accesses. As such we can replace the first memory barrier with dma_wmb() to reduce the cost for these accesses. In addition the r8169 uses a rmb() to prevent compiler optimization in the cleanup paths, however by moving the barrier down a few lines and replacing it with a dma_rmb() we should be able to use it to guarantee descriptor accesses do not occur until the device has updated the DescOwn bit from its end. One last change I made is to move the update of cur_tx in the xmit path to after the wmb. This way we can guarantee the device and all CPUs should see the DescOwn update before they see the cur_tx value update. Cc: Realtek linux nic maintainers <nic_swsd@realtek.com> Cc: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/appletalk')
0 files changed, 0 insertions, 0 deletions