From patchwork Mon Aug 21 07:47:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 27678 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 8AF698CF0; Mon, 21 Aug 2017 09:47:11 +0200 (CEST) Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) by dpdk.org (Postfix) with ESMTP id 38CA77D97 for ; Mon, 21 Aug 2017 09:47:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=nX4QplHz1DIusO0FypVSM7uoi9y1UvuodmKgahSfPeQ=; b=P30Hl0UPx49fAAJM9wp5KMoLG 2QjqaDUZNzAEDoKLM/rXJAgH/4wAxqvbr3EkiMQ2WoqHQvfS+xDZ77qlyGGCZn05rxZ2ZZE3vLAVv XcSCEHW1UtJ1EeVRou2KtJsyaJhcG5L7pW47HXtME8bzX1ymAhyy7tapEvBwfoSMQrkjybitBLZ7s xVbKRJFyNFj72H/E7grkBlqzRd+QLvm9GpzoUiApYLsNef7kFzQNOhqTj4saxMZtEuZRhZjLo9iMv 97oMVn54XWKqX7o5xhe+CRzFpyAH832cZ4Inmgp4mxZpp7M0m1qdgGLgRu0XhFmD7x/CWv+hOkC1h Ks207OIug==; Received: from bzq-82-81-101-184.red.bezeqint.net ([82.81.101.184] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1djhQS-0000ZK-3o; Mon, 21 Aug 2017 07:47:08 +0000 From: Sagi Grimberg To: dev@dpdk.org Cc: Nelio Laranjeiro , Adrien Mazarguil , Shahaf Shuler Date: Mon, 21 Aug 2017 10:47:01 +0300 Message-Id: <1503301622-14220-2-git-send-email-sagi@grimberg.me> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503301622-14220-1-git-send-email-sagi@grimberg.me> References: <1503301622-14220-1-git-send-email-sagi@grimberg.me> Subject: [dpdk-dev] [PATCH 1/2] net/mlx5: replace memory barrier type 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" From: Shahaf Shuler The reason for the requirement of a barrier between the txq writes and the doorbell record writes is to avoid a case where the device reads the doorbell record's new value before the txq writes are flushed to memory. The current use of rte_wmb is not necessary, and can be replaced by rte_compiler_barrier as it acts as a write memory barrier. More details on this type of barrier can be found on [1] Replacing the rte_wmb is also expected to improve the throughput. [1] https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html Signed-off-by: Shahaf Shuler Signed-off-by: Yongseok Koh Signed-off-by: Alexander Solganik Signed-off-by: Sagi Grimberg Acked-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_rxtx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index 7de1d10863e5..59b9ff24fb82 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -602,7 +602,7 @@ mlx5_tx_dbrec(struct txq *txq, volatile struct mlx5_wqe *wqe) uint64_t *dst = (uint64_t *)((uintptr_t)txq->bf_reg); volatile uint64_t *src = ((volatile uint64_t *)wqe); - rte_wmb(); + rte_compiler_barrier(); *txq->qp_db = htonl(txq->wqe_ci); /* Ensure ordering between DB record and BF copy. */ rte_wmb();