Received: by 10.213.65.68 with SMTP id h4csp3017104imn; Mon, 2 Apr 2018 19:31:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/gPd79xQPGGKEcRl56SdE6WWmtnTmaWf4OMGTNGfqpt7pzJDnizz+SIvIeBV8wkTlbQ/nU X-Received: by 10.99.123.19 with SMTP id w19mr7525655pgc.405.1522722690468; Mon, 02 Apr 2018 19:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522722690; cv=none; d=google.com; s=arc-20160816; b=q/DGcxCM/aGgmQKSM93NQl7mKuENiemngX6xOZAANmTgUhp1NUJ2ismXg1samRZP43 ViN06hBRR5nMMlH6yge1nGoHNEC6YpyeZVaVsajQyc14BBx81vM/0g7OmLcJiMTqPzRL HntqFLKWynS91UmXS3ZihPlF2WDBKmDBjNDk00H4ozcfuNlnm+XPUmxCj7PHAw/yFc4I xdSjKSpVHPhhNBI/WdtBBU0aUkp89l7qA8ZzKpFLnp3Sw6tRYDdLPAiBFiwkjOW5H1f3 5bGSKekzlJZouRUmiTFqaXc9h09ZiGMEWk/P6aYv2v+4Q24oqkRK4r9j4xUZ/ijePCz4 N4Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=WqGWCBSSrdbAYw2oaoLmT+8i2TmWtKlPNjSfDF2ISlE=; b=MZ5lgT39zFRVriMcA2mDvADVXMsEZ+CIZs+aliPMZPA3jlRhaIBbg8BziXKchiXZbK SE1a8IUQbEOHZDpo4ao/NUYwtEdBdL7CmLioyA8IGTmqmjdHbJV2ChqDt8D84XolwJtV gw7FU3rtw3dtM9JrbWsuY0/1q/L/RoZWadf92Y+v3lNCutEMj4WjIcC6ko2Il30+r0/1 iQj3XMONXDd0+kMIt+U34TPl1aqHuZHRyJQfXqcA21nxIjf7Scvdz+c4fJBPtY8NTu8k iAS2gYp8J8QqZ6esSC4C3bHpiW341hpJYuQKZGzLMVmMX1AaghQ3t694gmOkTgcHKxZ7 obJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=M9NstC8o; dkim=pass header.i=@codeaurora.org header.s=default header.b=BbjQoqyN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12-v6si1621422pll.498.2018.04.02.19.31.16; Mon, 02 Apr 2018 19:31:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=M9NstC8o; dkim=pass header.i=@codeaurora.org header.s=default header.b=BbjQoqyN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752171AbeDCC36 (ORCPT + 99 others); Mon, 2 Apr 2018 22:29:58 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:57926 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751129AbeDCC34 (ORCPT ); Mon, 2 Apr 2018 22:29:56 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 49CF560807; Tue, 3 Apr 2018 02:29:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522722596; bh=GMSfcih79dCwZKedmaFrtrk0pd/GoXUgBmkUN1VtJTg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=M9NstC8ouoiigWC2JnVQAg04C9+Kke7bisD184Sauc3uK0cEAby92KMmKxV0YGIQu p3vq+9VBs1dnly28n25TUY1r0G+SAjYtXBXQCdpK2Sa/FQdEXi07DPWkkzRWO0yIub E58Do6BRD0Gu63yY9SJfifkcV8n31qtRzO1D7eWg= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.0.105] (cpe-174-109-247-98.nc.res.rr.com [174.109.247.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7683F60591; Tue, 3 Apr 2018 02:29:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522722595; bh=GMSfcih79dCwZKedmaFrtrk0pd/GoXUgBmkUN1VtJTg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=BbjQoqyNsADJ6GoG4Iz/Cjon7Gb4GkuXymyW5IF8GQ/dFrDGBH8EtBteoe5f/FGbf qoG1kLNHyYpPOQMxe7LeBAGLtK+7slKaKfgci+ZdSbv5gg3lBjbHLVMvgr57kPDtwl rpv67+79tezz9T181mi5bzp/C5PFu6ocF0gSf9gs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7683F60591 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org Subject: Re: [PATCH v5 3/3] RDMA/qedr: eliminate duplicate barriers on weakly-ordered archs #2 To: linux-rdma@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michal Kalderon , Ariel Elior , Doug Ledford , Jason Gunthorpe , linux-kernel@vger.kernel.org References: <1521736009-23387-1-git-send-email-okaya@codeaurora.org> <1521736009-23387-4-git-send-email-okaya@codeaurora.org> From: Sinan Kaya Message-ID: Date: Mon, 2 Apr 2018 22:29:53 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1521736009-23387-4-git-send-email-okaya@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/22/2018 12:26 PM, Sinan Kaya wrote: > @@ -860,7 +860,7 @@ static void doorbell_cq(struct qedr_cq *cq, u32 cons, u8 flags) > wmb(); > cq->db.data.agg_flags = flags; > cq->db.data.value = cpu_to_le32(cons); > - writeq(cq->db.raw, cq->db_addr); > + writeq_relaxed(cq->db.raw, cq->db_addr); Given the direction to get rid of wmb() in front of writeX() functions, I have been reviewing this code. Under normal circumstances, I can get rid of all wmb() as follows. However, I started having my doubts now. Are these wmb() used as a SMP barrier too? I can't find any smp_Xmb() in drivers/infiniband/hw/qedr directory. static void doorbell_cq(struct qedr_cq *cq, u32 cons, u8 flags) { - /* Flush data before signalling doorbell */ - wmb(); cq->db.data.agg_flags = flags; cq->db.data.value = cpu_to_le32(cons); writeq(cq->db.raw, cq->db_addr); @@ -1870,8 +1868,7 @@ static int qedr_update_qp_state(struct qedr_dev *dev, */ if (rdma_protocol_roce(&dev->ibdev, 1)) { - wmb(); - writel_relaxed(qp->rq.db_data.raw, qp->rq.db); + writel(qp->rq.db_data.raw, qp->rq.db); /* Make sure write takes effect */ mmiowb(); } @@ -3275,8 +3272,7 @@ int qedr_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, * unchanged). For performance reasons we avoid checking for this * redundant doorbell. */ - wmb(); - writel_relaxed(qp->sq.db_data.raw, qp->sq.db); + writel(qp->sq.db_data.raw, qp->sq.db); /* Make sure write sticks */ mmiowb(); @@ -3362,9 +3358,6 @@ int qedr_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, qedr_inc_sw_prod(&qp->rq); - /* Flush all the writes before signalling doorbell */ - wmb(); -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.