Received: by 10.213.65.68 with SMTP id h4csp536986imn; Fri, 23 Mar 2018 09:53:31 -0700 (PDT) X-Google-Smtp-Source: AG47ELtrsRg8CqRJiiQMz/TJv5mURheTFS3u8a8g3qlg3i0q6OenhMrkWCjgMYN1nN1qgq1x1/gD X-Received: by 2002:a17:902:c81:: with SMTP id 1-v6mr29894542plt.205.1521824011384; Fri, 23 Mar 2018 09:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521824011; cv=none; d=google.com; s=arc-20160816; b=uTnfnn1t04HY8vSmw00v2cl5CEjklweGICflZz5gd2dRIkD5EkqLLkIKBqm6QDIf09 DsxLvu9naOMJ7idap8muAq1HF38HGJmOPpftJfC/zMZWzb8x1X04KLMwfqPRtv3aJwNg KyzYsCCYkNw40uvySvMquwFEG/EBLX1gQEl+H5oJncW04WeLSTxc3NJ3ntgRSrodmU2s BLmD65vkP2dPEMkvogLp/G7szZmGwmpyMD1dLXQfv5Nq29TEaTzClLBgJZkLNrNSs8WN ZSk5dSM7AffcCNOOjdZObVHf/8s4CBZrjCzaFqOrpNBlNF3H7KQaDV0y4Vc4JfhakNKq CxxQ== 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=ZcO0KB1FIewXc2xnMz/leczNa3YUTIcgWSEsmPi9lzg=; b=HRdSXqm2RYnknc0oyC6rdcJ+lS/pAvMAfVBdDC68luFaPfiSEvmuJE6v2zzkheUnoL ICvFmq+//xt1LoV9ZMvT7fL96Wmx0dA1EWDGkStd0Fdcr2D2hclEcn1o941O5ug86qAp 4ZgYuCxTxpn0EEbZnWU1ordDINehjYbr0lRF9zgo0OmLb3OvDxLQW3ai7g8+Xe7z9KyN KhVzGwQ5U2CEZsWMQRhBxZBPv+quDSdJ4RMYDKs0bW+FQ8IZiz4zFjiF1gGsZtHKRgXf Cn5Ak2ouRbasC2afoituDUYg5nibaoSAa8c8ZAoC+5VnqahGVpgQhNzO9/J/aQwYQRgE hgsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=CbaoV4R4; dkim=pass header.i=@codeaurora.org header.s=default header.b=CbaoV4R4; 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 r6-v6si8944799pls.51.2018.03.23.09.53.15; Fri, 23 Mar 2018 09:53:31 -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=CbaoV4R4; dkim=pass header.i=@codeaurora.org header.s=default header.b=CbaoV4R4; 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 S1752306AbeCWQvw (ORCPT + 99 others); Fri, 23 Mar 2018 12:51:52 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:56732 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751632AbeCWQvu (ORCPT ); Fri, 23 Mar 2018 12:51:50 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B60F4601D3; Fri, 23 Mar 2018 16:51:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521823909; bh=ZN1DSDf3q/8n4I6AIkF739qrRD3+wjvRmOMgEIlm3Yo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=CbaoV4R4KOIHkerwc6lkFZjDt8ckFkapwODLvDzXvKncasKCkPTR1IFOZX9R0RoPK blhefAvbzBGoUipgCtGV35eX1ImV43eF1ckbrORIYXoEyx7n7WcnlLGM9oRpteL1Fd GeXzaPRgR0CKWFPAzbF8LK+qWUD4rpl9J31k4/VA= 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 2845B601D3; Fri, 23 Mar 2018 16:51:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521823909; bh=ZN1DSDf3q/8n4I6AIkF739qrRD3+wjvRmOMgEIlm3Yo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=CbaoV4R4KOIHkerwc6lkFZjDt8ckFkapwODLvDzXvKncasKCkPTR1IFOZX9R0RoPK blhefAvbzBGoUipgCtGV35eX1ImV43eF1ckbrORIYXoEyx7n7WcnlLGM9oRpteL1Fd GeXzaPRgR0CKWFPAzbF8LK+qWUD4rpl9J31k4/VA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2845B601D3 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/5] bnx2x: Eliminate duplicate barriers on weakly-ordered archs To: David Miller Cc: netdev@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ariel.elior@cavium.com, everest-linux-l2@cavium.com, linux-kernel@vger.kernel.org References: <1521738603-23596-4-git-send-email-okaya@codeaurora.org> <20180323.122035.1380806748695640531.davem@davemloft.net> <20180323.124326.2170503491903886041.davem@davemloft.net> From: Sinan Kaya Message-ID: <4bd9ccd2-df8f-acad-2513-eefe065dc852@codeaurora.org> Date: Fri, 23 Mar 2018 12:51:47 -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: <20180323.124326.2170503491903886041.davem@davemloft.net> 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/23/2018 12:43 PM, David Miller wrote: > From: Sinan Kaya > Date: Fri, 23 Mar 2018 12:31:12 -0400 > >> Sorry, you got me confused now. >> >> If you look at the code closer, you'll see this. >> >> wmb(); >> >> txdata->tx_db.data.prod += nbd; >> barrier(); >> >> DOORBELL(bp, txdata->cid, txdata->tx_db.raw); >> >> and you also asked me to rename DOORBELL to DOORBELL_RELAXED() to make >> it obvious that we have a relaxed operator inside the macro. > > This still doesn't match the stated pattern. I can certainly update the commit text for this or spin into its own patch to make it obvious. > > wmb(); > /* no other memory or I/O or IOMEM operation */ > writel(); > > There is a write to a producer index there and then no non-compiler > barrier or any kind before the writel(). > > So, in fact, it might really need that implicit writel() barrier here! > It could if txdata->tx_db was not a union. There is a data dependency between txdata->tx_db.data.prod and txdata->tx_db.raw. So, no reordering. I can argue that barrier() here is useless in fact. Anyhow, I'll spin this piece out of this patch so that we pay special attention with a better description. -- 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.