Commit 73017f4e authored by Venkatesh Srinivas's avatar Venkatesh Srinivas Committed by Jeff Kirsher

igb: Use dma_wmb() instead of wmb() before doorbell writes

igb writes to doorbells to post transmit and receive descriptors;
after writing descriptors to memory but before writing to doorbells,
use dma_wmb() rather than wmb(). wmb() is more heavyweight than
necessary before doorbell writes.

On x86, this avoids SFENCEs before doorbell writes in both the
tx and rx refill paths.
Signed-off-by: default avatarVenkatesh Srinivas <venkateshs@google.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 2a83fba6
...@@ -6031,7 +6031,7 @@ static int igb_tx_map(struct igb_ring *tx_ring, ...@@ -6031,7 +6031,7 @@ static int igb_tx_map(struct igb_ring *tx_ring,
* We also need this memory barrier to make certain all of the * We also need this memory barrier to make certain all of the
* status bits have been updated before next_to_watch is written. * status bits have been updated before next_to_watch is written.
*/ */
wmb(); dma_wmb();
/* set next_to_watch value indicating a packet is present */ /* set next_to_watch value indicating a packet is present */
first->next_to_watch = tx_desc; first->next_to_watch = tx_desc;
...@@ -8531,7 +8531,7 @@ void igb_alloc_rx_buffers(struct igb_ring *rx_ring, u16 cleaned_count) ...@@ -8531,7 +8531,7 @@ void igb_alloc_rx_buffers(struct igb_ring *rx_ring, u16 cleaned_count)
* applicable for weak-ordered memory model archs, * applicable for weak-ordered memory model archs,
* such as IA-64). * such as IA-64).
*/ */
wmb(); dma_wmb();
writel(i, rx_ring->tail); writel(i, rx_ring->tail);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment