]> git.baikalelectronics.ru Git - kernel.git/commit
fm10k/igb/ixgbe: Use dma_rmb on Rx descriptor reads
authorAlexander Duyck <alexander.h.duyck@redhat.com>
Thu, 11 Dec 2014 23:02:28 +0000 (15:02 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Dec 2014 02:15:06 +0000 (21:15 -0500)
commit13a5cd562e08d4d824213fcc7fe2d33280df77e5
treea4962667802529c26231f4768c0233a15f9e9e4c
parent6d68090150d8d686049162b7c4374590e12c45f7
fm10k/igb/ixgbe: Use dma_rmb on Rx descriptor reads

This change makes it so that dma_rmb is used when reading the Rx
descriptor.  The advantage of dma_rmb is that it allows for a much
lower cost barrier on x86, powerpc, arm, and arm64 architectures than a
traditional memory barrier when dealing with reads that only have to
synchronize to coherent memory.

In addition I have updated the code so that it just checks to see if any
bits have been set instead of just the DD bit since the DD bit will always
be set as a part of a descriptor write-back so we just need to check for a
non-zero value being present at that memory location rather than just
checking for any specific bit.  This allows the code itself to appear much
cleaner and allows the compiler more room to optimize.

Cc: Matthew Vick <matthew.vick@intel.com>
Cc: Don Skidmore <donald.c.skidmore@intel.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/fm10k/fm10k_main.c
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c