diff options
author | Lendacky, Thomas <Thomas.Lendacky@amd.com> | 2014-11-20 11:03:26 -0600 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-21 15:19:10 -0500 |
commit | 5449e27167c9945d24108690aff86943d79774a7 (patch) | |
tree | 480ae3e95e6190898d0e969678ca349508feaf03 /drivers/net/ethernet/amd/xgbe/xgbe-dev.c | |
parent | 91ecee6846704cbd0ec14509b86e99c291cd9bcd (diff) | |
download | op-kernel-dev-5449e27167c9945d24108690aff86943d79774a7.zip op-kernel-dev-5449e27167c9945d24108690aff86943d79774a7.tar.gz |
amd-xgbe: Add a read memory barrier to Tx/Rx path
Add a read memory barrier to the Tx and Rx paths where the ownership
bit is checked to be sure that all descriptor fields are read after
having read the ownership bit for the descriptor.
This has not been an issue to date, but it's a good safe-guard to have.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amd/xgbe/xgbe-dev.c')
-rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-dev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c index f6014d3..9b1d9fa 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c @@ -1558,6 +1558,9 @@ static int xgbe_dev_read(struct xgbe_channel *channel) if (XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, OWN)) return 1; + /* Make sure descriptor fields are read after reading the OWN bit */ + rmb(); + #ifdef XGMAC_ENABLE_RX_DESC_DUMP xgbe_dump_rx_desc(ring, rdesc, ring->cur); #endif |