Skip to content

Commit d261f5b

Browse files
mohammadheibkuba-moo
authored andcommitted
net: ionic: add dma_wmb() before ringing TX doorbell
The TX path currently writes descriptors and then immediately writes to the MMIO doorbell register to notify the NIC. On weakly ordered architectures, descriptor writes may still be pending in CPU or DMA write buffers when the doorbell is issued, leading to the device fetching stale or incomplete descriptors. Add a dma_wmb() in ionic_txq_post() to ensure all descriptor writes are visible to the device before the doorbell MMIO write. Fixes: 0f3154e ("ionic: Add Tx and Rx handling") Signed-off-by: Mohammad Heib <mheib@redhat.com> Link: https://patch.msgid.link/20251031155203.203031-1-mheib@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 7172c8c commit d261f5b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/pensando/ionic/ionic_txrx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ static void ionic_tx_clean(struct ionic_queue *q,
2929

3030
static inline void ionic_txq_post(struct ionic_queue *q, bool ring_dbell)
3131
{
32+
/* Ensure TX descriptor writes reach memory before NIC reads them.
33+
* Prevents device from fetching stale descriptors.
34+
*/
35+
dma_wmb();
3236
ionic_q_post(q, ring_dbell);
3337
}
3438

0 commit comments

Comments
 (0)