Skip to content
Commit 50351376 authored by Shenwei Wang's avatar Shenwei Wang Committed by Xiaolei Wang
Browse files

net: fec: add dma_wmb to ensure correct descriptor values

commit 77bc892c1441f530496db083c3b5341d4a308add from
https://github.com/nxp-imx/linux-imx.git



Two dma_wmb() are added in the XDP TX path to ensure proper ordering of
descriptor and buffer updates:
1. A dma_wmb() is added after updating the last BD to make sure
   the updates to rest of the descriptor are visible before
   transferring ownership to FEC.
2. A dma_wmb() is also added after updating the bdp to ensure these
   updates are visible before updating txq->bd.cur.
3. Start the xmit of the frame immediately right after configuring the
   tx descriptor.

Fixes: 6d6b39f1 ("net: fec: add initial XDP support")
Signed-off-by: default avatarShenwei Wang <shenwei.wang@nxp.com>
Reviewed-by: default avatarWei Fang <wei.fang@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarXiaolei Wang <xiaolei.wang@windriver.com>
parent 4351e534
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment