DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gavin Hu <gavin.hu@arm.com>
To: dev@dpdk.org
Cc: nd@arm.com, david.marchand@redhat.com, thomas@monjalon.net,
	mk@semihalf.com, gtzalik@amazon.com, evgenys@amazon.com,
	igorch@amazon.com, mw@semihalf.com, Honnappa.Nagarahalli@arm.com,
	ruifeng.wang@arm.com, phil.yang@arm.com, joyce.kong@arm.com,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH RFC v1 2/7] net/ena: relax the barrier for doorbell ring
Date: Fri, 13 Mar 2020 17:18:30 +0800	[thread overview]
Message-ID: <20200313091835.58039-3-gavin.hu@arm.com> (raw)
In-Reply-To: <20200313091835.58039-1-gavin.hu@arm.com>

rte_cio_wmb is a light weight version of IO memory barrier that
guarantees that the stores to the coherent memory prior to the
the rte_cio_rmb() call are visible to the NIC HW before the doorbell
ring(or any other stores to the MMIO registers) that follows it.[1]

Fixes: 5e02e19eb14e ("net/ena: fix unneeded doorbell submission")
Cc: stable@dpdk.org

[1] http://code.dpdk.org/dpdk/v20.02/source/lib/librte_eal/common/
include/generic/rte_atomic.h#L137

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 drivers/net/ena/ena_ethdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 665afee4f..c268788fd 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1425,7 +1425,7 @@ static int ena_populate_rx_queue(struct ena_ring *rxq, unsigned int count)
 		 * Add memory barrier to make sure the desc were written before
 		 * issue a doorbell
 		 */
-		rte_wmb();
+		rte_cio_wmb();
 		ena_com_write_sq_doorbell(rxq->ena_com_io_sq);
 
 		rxq->next_to_use = next_to_use;
@@ -2344,7 +2344,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			PMD_DRV_LOG(DEBUG, "llq tx max burst size of queue %d"
 				" achieved, writing doorbell to send burst\n",
 				tx_ring->id);
-			rte_wmb();
+			rte_cio_wmb();
 			ena_com_write_sq_doorbell(tx_ring->ena_com_io_sq);
 		}
 
@@ -2367,7 +2367,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 	/* If there are ready packets to be xmitted... */
 	if (sent_idx > 0) {
 		/* ...let HW do its best :-) */
-		rte_wmb();
+		rte_cio_wmb();
 		ena_com_write_sq_doorbell(tx_ring->ena_com_io_sq);
 		tx_ring->tx_stats.doorbells++;
 		tx_ring->next_to_use = next_to_use;
-- 
2.17.1


  parent reply	other threads:[~2020-03-13  9:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13  9:18 [dpdk-dev] [PATCH RFC v1 0/7] relax barriers for ENA PMD and small fixes Gavin Hu
2020-03-13  9:18 ` [dpdk-dev] [PATCH RFC v1 1/7] net/ena: remove duplicate barrier Gavin Hu
2020-03-13  9:18 ` Gavin Hu [this message]
2020-03-13  9:18 ` [dpdk-dev] [PATCH RFC v1 3/7] net/ena: relax the rmb for DMA Gavin Hu
2020-03-13  9:18 ` [dpdk-dev] [PATCH RFC v1 4/7] net/ena: relax barrier for completion queue update Gavin Hu
2020-03-13  9:18 ` [dpdk-dev] [PATCH RFC v1 5/7] net/ena: relax the barrier for bounce buffer Gavin Hu
2020-03-13  9:18 ` [dpdk-dev] [PATCH RFC v1 6/7] net/ena: use c11 atomic for statistics Gavin Hu
2020-03-13  9:18 ` [dpdk-dev] [PATCH RFC v1 7/7] net/ena: remove duplicate memset Gavin Hu
2020-03-16  9:34 ` [dpdk-dev] [PATCH RFC v1 0/7] relax barriers for ENA PMD and small fixes Chauskin, Igor
2020-03-17  7:58   ` Gavin Hu
2020-04-16 13:37     ` Chauskin, Igor
2020-04-21  7:45       ` Gavin Hu
2020-05-12 21:22         ` Honnappa Nagarahalli
2020-04-15 15:27   ` Ferruh Yigit
2020-04-15 15:59     ` Chauskin, Igor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200313091835.58039-3-gavin.hu@arm.com \
    --to=gavin.hu@arm.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=evgenys@amazon.com \
    --cc=gtzalik@amazon.com \
    --cc=igorch@amazon.com \
    --cc=joyce.kong@arm.com \
    --cc=mk@semihalf.com \
    --cc=mw@semihalf.com \
    --cc=nd@arm.com \
    --cc=phil.yang@arm.com \
    --cc=ruifeng.wang@arm.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).