From: Kevin Hao <haoke...@gmail.com> Date: Fri, 7 Aug 2015 13:52:37 +0800
> When we transmit a fragmented skb, we may run into a race like the > following scenario (assume txq->cur_tx is next to txq->dirty_tx): > cpu 0 cpu 1 > fec_enet_txq_submit_skb > reserve a bdp for the first fragment > fec_enet_txq_submit_frag_skb > update the bdp for the other fragment > update txq->cur_tx > fec_enet_tx_queue > bdp = > fec_enet_get_nextdesc(txq->dirty_tx, fep, queue_id); > This bdp is the bdp > reserved for the first segment. Given > that this bdp > BD_ENET_TX_READY bit is not set and txq->cur_tx > is already pointed to a > bdp beyond this one. We think this is a > completed bdp and try to > reclaim it. > update the bdp for the first segment > update txq->cur_tx > > So we shouldn't update the txq->cur_tx until all the update to the > bdps used for fragments are performed. Also add the corresponding > memory barrier to guarantee that the update to the bdps, dirty_tx and > cur_tx performed in the proper order. > > Signed-off-by: Kevin Hao <haoke...@gmail.com> Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html