From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C3C59A2EEB for ; Tue, 10 Sep 2019 10:47:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 98E8E1EE19; Tue, 10 Sep 2019 10:47:43 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 903521ED25; Tue, 10 Sep 2019 10:47:41 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Sep 2019 01:47:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,489,1559545200"; d="scan'208";a="359746636" Received: from npg-dpdk-zhangxiao.sh.intel.com ([10.67.110.190]) by orsmga005.jf.intel.com with ESMTP; 10 Sep 2019 01:47:38 -0700 From: Xiao Zhang To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, Xiao Zhang , stable@dpdk.org Date: Wed, 11 Sep 2019 01:41:18 +0800 Message-Id: <1568137278-10066-1-git-send-email-xiao.zhang@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] net/e1000: correct mb function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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") Cc: stable@dpdk.org Signed-off-by: Xiao Zhang --- drivers/net/e1000/em_rxtx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c index 5925e49..49c5371 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/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); } } -- 2.7.4