DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yongseok Koh <yskoh@mellanox.com>
To: adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com
Cc: dev@dpdk.org, Yongseok Koh <yskoh@mellanox.com>
Subject: [dpdk-dev] [PATCH v1 1/7] net/mlx5: cleanup memory barriers
Date: Thu,  5 Oct 2017 16:00:26 -0700	[thread overview]
Message-ID: <20171005230032.7548-2-yskoh@mellanox.com> (raw)
In-Reply-To: <20171005230032.7548-1-yskoh@mellanox.com>

Updating a consumer index to HW doesn't require a memory barrier in case
that there's no updated data to be posted to HW, but a compiler barrier is
sufficient. rte_wmb() is replaced with rte_io_wmb() when it makes changes
visible to HW, not other core.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_rxtx.c         | 4 ++--
 drivers/net/mlx5/mlx5_rxtx.h         | 2 +-
 drivers/net/mlx5/mlx5_rxtx_vec_sse.c | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 9389383f6..275cd6a4b 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -1928,9 +1928,9 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		return 0;
 	/* Update the consumer index. */
 	rxq->rq_ci = rq_ci >> sges_n;
-	rte_wmb();
+	rte_io_wmb();
 	*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
-	rte_wmb();
+	rte_io_wmb();
 	*rxq->rq_db = rte_cpu_to_be_32(rxq->rq_ci);
 #ifdef MLX5_PMD_SOFT_COUNTERS
 	/* Increment packets counter. */
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 0bb71aeb0..8470a55ba 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -504,7 +504,7 @@ mlx5_tx_complete(struct mlx5_txq_data *txq)
 	txq->cq_ci = cq_ci;
 	txq->elts_tail = elts_tail;
 	/* Update the consumer index. */
-	rte_wmb();
+	rte_compiler_barrier();
 	*txq->cq_db = rte_cpu_to_be_32(cq_ci);
 }
 
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.c b/drivers/net/mlx5/mlx5_rxtx_vec_sse.c
index 6d337ecd3..e8f0626a6 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.c
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.c
@@ -567,7 +567,7 @@ rxq_replenish_bulk_mbuf(struct mlx5_rxq_data *rxq, uint16_t n)
 		wq[i].addr = rte_cpu_to_be_64((uintptr_t)elts[i]->buf_addr +
 					      RTE_PKTMBUF_HEADROOM);
 	rxq->rq_ci += n;
-	rte_wmb();
+	rte_io_wmb();
 	*rxq->rq_db = rte_cpu_to_be_32(rxq->rq_ci);
 }
 
@@ -1259,7 +1259,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 			rcvd_pkt += n;
 		}
 	}
-	rte_wmb();
+	rte_compiler_barrier();
 	*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
 	return rcvd_pkt;
 }
-- 
2.11.0

  reply	other threads:[~2017-10-05 23:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-05 23:00 [dpdk-dev] [PATCH v1 0/7] net/mlx5: add vectorized Rx/Tx burst for ARM Yongseok Koh
2017-10-05 23:00 ` Yongseok Koh [this message]
2017-10-05 23:00 ` [dpdk-dev] [PATCH v1 2/7] net/mlx5: rename a file of SSE Rx/Tx Yongseok Koh
2017-10-05 23:00 ` [dpdk-dev] [PATCH v1 3/7] net/mlx5: use static assert for compile-time sanity checks Yongseok Koh
2017-10-06  7:50   ` Nélio Laranjeiro
2017-10-05 23:00 ` [dpdk-dev] [PATCH v1 4/7] net/mlx5: separate shareable vector functions Yongseok Koh
2017-10-05 23:00 ` [dpdk-dev] [PATCH v1 5/7] net/mlx5: match Rx completion entry size to cacheline Yongseok Koh
2017-10-06  7:55   ` Nélio Laranjeiro
2017-10-05 23:00 ` [dpdk-dev] [PATCH v1 6/7] net/mlx5: fix configuration of Rx CQE compression Yongseok Koh
2017-10-06  7:57   ` Nélio Laranjeiro
2017-10-05 23:00 ` [dpdk-dev] [PATCH v1 7/7] net/mlx5: add vectorized Rx/Tx burst for ARM Yongseok Koh
2017-10-09  2:39 ` [dpdk-dev] [PATCH v1 0/7] " Ferruh Yigit
2017-10-09  7:45   ` Adrien Mazarguil
2017-10-09 17:40   ` Yongseok Koh
2017-10-09 18:19     ` Olga Shern
2017-10-09 18:46 ` [dpdk-dev] [PATCH v2 " Yongseok Koh
2017-10-09 18:46   ` [dpdk-dev] [PATCH v2 1/7] net/mlx5: cleanup memory barriers Yongseok Koh
2017-10-09 18:46   ` [dpdk-dev] [PATCH v2 2/7] net/mlx5: rename a file of SSE Rx/Tx Yongseok Koh
2017-10-09 18:46   ` [dpdk-dev] [PATCH v2 3/7] net/mlx5: use static assert for compile-time sanity checks Yongseok Koh
2017-10-09 18:46   ` [dpdk-dev] [PATCH v2 4/7] net/mlx5: separate shareable vector functions Yongseok Koh
2017-10-09 18:46   ` [dpdk-dev] [PATCH v2 5/7] net/mlx5: match Rx completion entry size to cacheline Yongseok Koh
2017-10-09 18:46   ` [dpdk-dev] [PATCH v2 6/7] net/mlx5: fix configuration of Rx CQE compression Yongseok Koh
2017-10-09 18:47   ` [dpdk-dev] [PATCH v2 7/7] net/mlx5: add vectorized Rx/Tx burst for ARM Yongseok Koh
2017-10-09 19:09   ` [dpdk-dev] [PATCH v2 0/7] " Ferruh Yigit

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=20171005230032.7548-2-yskoh@mellanox.com \
    --to=yskoh@mellanox.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=nelio.laranjeiro@6wind.com \
    /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).