Skip to content
Permalink
Browse files

net/e1000: fix memory barrier usage in Tx

[ upstream commit d6956e92390c8fb2fcbd0f3363169b88a012154c]

Use rte_cio_wmb instead of rte_wmb when writing TX descriptor since it's
CIO memory.
Replace rte_io_wmb and E1000_PCI_REG_WRITE_RELAXED with
E1000_PCI_REG_WRITE since it has rte_io_wmb inside, which will be more
clear.

Fixes: 1fc9701238ed ("net/e1000: fix i219 hang on reset/close")

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
  • Loading branch information
Xiao Zhang authored and kevintraynor committed Sep 10, 2019
1 parent 0c97c2c commit 29152383a7bf8a055bf83c63da435337f9d681b3
Showing with 2 additions and 3 deletions.
  1. +2 −3 drivers/net/e1000/em_rxtx.c
@@ -2049,13 +2049,12 @@ e1000_flush_tx_ring(struct rte_eth_dev *dev)
tx_desc->lower.data = rte_cpu_to_le_32(txd_lower | size);
tx_desc->upper.data = 0;

rte_wmb();
rte_cio_wmb();
txq->tx_tail++;
if (txq->tx_tail == txq->nb_tx_desc)
txq->tx_tail = 0;
rte_io_wmb();
tdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_TDT(i));
E1000_PCI_REG_WRITE_RELAXED(tdt_reg_addr, txq->tx_tail);
E1000_PCI_REG_WRITE(tdt_reg_addr, txq->tx_tail);
usec_delay(250);
}
}

0 comments on commit 2915238

Please sign in to comment.
You can’t perform that action at this time.