Patch "net: ionic: add dma_wmb() before ringing TX doorbell" has been added to the 6.12-stable tree
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 47 lines · Sasha Levin
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
This is a note to let you know that I've just added the patch titled
net: ionic: add
dma_wmb()before ringing TX doorbellto the 6.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryThe filename of the patch is:
net-ionic-add-dma_wmb-before-ringing-tx-doorbell.patch
and it can be found in the queue-6.12 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
commit
05587f91cc2e8b071605aeef6442d2acf6e627c9Author: Mohammad Heib <[email protected]> Date: Fri Oct 31 17:52:02 2025 +0200net: ionic: add
dma_wmb()before ringing TX doorbell[ Upstream commit
d261f5b09c28850dc63ca1d3018596f829f402d5]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()inionic_txq_post()to ensure all descriptor writes are visible to the device before the doorbell MMIO write.Fixes 0f3154e6bcb3 ("ionic: Add Tx and Rx handling")Signed-off-by Mohammad Heib <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>Signed-off-by Sasha Levin <[email protected]>drivers/net/ethernet/pensando/ionic/ionic_txrx.c +0
-0
drivers/net/ethernet/pensando/ionic/ionic_txrx.c static void ionic_tx_clean(struct ionic_queue *q, · line 38
Quoted 10 lines
drivers/net/ethernet/pensando/ionic/ionic_txrx.c +4
-0@@ -29,6 +29,10 @@ static void ionic_tx_clean(struct ionic_queue *q,static inline void ionic_txq_post (struct ionic_queue *q,bool ring_dbell) { +/* Ensure TX descriptor writes reach memory before NIC reads them. +* Prevents device from fetching stale descriptors. +*/ +dma_wmb ();ionic_q_post (q, ring_dbell); }
I posted on the original patch, but I will post here as well.
Apologies for the late and duplicate response, but it's not clear to me why this is necessary.
In other vendors the "doorbell record" (dbr) is writing another location in system memory, not an mmio write. These cases do use a dma_wmb().
Why isn't the writeq() sufficient in our case? According to Documentation/memory-barriers.txt it seems like writeq() should be sufficient.
Thanks,
Brett