Received: by 10.213.65.68 with SMTP id h4csp522206imn; Fri, 23 Mar 2018 09:32:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELsJBD2cdlEyu3FY+BvL5mvTgWsKIiH4XMV55gqclrO2aQiIEtY5iP7bpnT4vbzL8XNeTrhQ X-Received: by 10.99.165.22 with SMTP id n22mr21333387pgf.53.1521822754457; Fri, 23 Mar 2018 09:32:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521822754; cv=none; d=google.com; s=arc-20160816; b=QMTRyJNWWOCviHoLQ5+u54jHu/5RRttVvyg0A4ZKwS5aqipyYWR0riCxq6I/FgK9tr LJbx98zBZGggrxWESnA01Jl4LBqGn/6z81VEiBveMo3QCkDoIq8tbtQS13uycx5eRd6h EnLet2VUCNfA5YXoGJBdzXrWnP6xWVW2Ij9ESXJ8NhbyIiAF3ZJROc1qNm+U70jqTKGV on/T4MMuemVut7lKKrpnXKsGLdD+Macj0/sqSQTlYySnEiWJ6D54V073/W1+BmTFMl3C ACpCm73uQQj7gMa2nMVPO10yCpn6LGXT0KUxflNf29zKPUYkOOW7x8QNdd1BolYgLErR p3nA== 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=ZqCXA3kOG9zx+mi8uFao/kdUAhQjnwTqVT5+9mUevFw=; b=AXluxBrcqxz2wfXo+PGvSVEVDCMnc4dWz+cRlQfFIQqI0CzPSngyA6IzdBf+tP0cYG Yaiag7WPAGNMO88FIKccwLhHC5t3VlmpEYii7K7AKNlQd4mVNoBOeBFqpryDjG2XgvbO vWc0KclB+NBDSvO3d3R/FdrHT0oOmxAzweVkRzzX9KhQ0ABzC0SxWVNlyVF0xH1DmKwD q58d1sk7iqKzwU/+9mm+UcM+cb3ShyhX8NXKP4lrHTM1k6hXnc3h+8SdNqcHuuOju4zG npm9wKTEOafkjEyB7/mgIH/xbSndu3Pkv9We0nUUoWelZeb/rxXZ+MVVH8qjc2tC+2qU 3usw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=U+pGvBkZ; dkim=pass header.i=@codeaurora.org header.s=default header.b=KuOqNa6G; 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 r22si449801pgo.323.2018.03.23.09.32.19; Fri, 23 Mar 2018 09:32:34 -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=U+pGvBkZ; dkim=pass header.i=@codeaurora.org header.s=default header.b=KuOqNa6G; 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 S1752173AbeCWQbS (ORCPT + 99 others); Fri, 23 Mar 2018 12:31:18 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53144 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751714AbeCWQbP (ORCPT ); Fri, 23 Mar 2018 12:31:15 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 03CCF607E5; Fri, 23 Mar 2018 16:31:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521822675; bh=6OnakqA2FP0GZ22CMpqTASMNWWH9YxEczrjJ7V/yjws=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=U+pGvBkZ/yXLtE7knz7Sk+bPhE+jlmHNxa78noWUkamGzi/vqy8/yfLI9i/y946Wx QHylWCqlBIiRuvBmngqBuNB0P0T1qRjABfXTUEX2zzQfk2MIGXwRndaRDYmC1b6EG3 tLt14tM74mmqikAAkEznNquj+ZscbtC2LCvBwgQ8= 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 4809560588; Fri, 23 Mar 2018 16:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521822674; bh=6OnakqA2FP0GZ22CMpqTASMNWWH9YxEczrjJ7V/yjws=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=KuOqNa6GeYSh//kLWWND7H5Rk1tbGLlwaudHhwwvx/6Db9ARpDd4oZJ//X/bIW1wQ 18qttFD6O0GRvh5j4gUx8VmUe98zRYqCQ2VPs5wPi1jLsul2KeVVfyXCjDtqzjx1/B P0TVaJ4WMktXGNzeG83ytcfczS+Y2Etvvrl7gMgs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4809560588 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-1-git-send-email-okaya@codeaurora.org> <1521738603-23596-4-git-send-email-okaya@codeaurora.org> <20180323.122035.1380806748695640531.davem@davemloft.net> From: Sinan Kaya Message-ID: Date: Fri, 23 Mar 2018 12:31:12 -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.122035.1380806748695640531.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:20 PM, David Miller wrote: > From: Sinan Kaya > Date: Thu, 22 Mar 2018 13:10:00 -0400 > >> Code includes wmb() followed by writel(). writel() already has a >> barrier on some architectures like arm64. > ... >> @@ -4155,7 +4155,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) >> txdata->tx_db.data.prod += nbd; >> barrier(); >> >> - DOORBELL(bp, txdata->cid, txdata->tx_db.raw); >> + DOORBELL_RELAXED(bp, txdata->cid, txdata->tx_db.raw); >> >> mmiowb(); > ... >> @@ -2592,7 +2592,7 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode) >> >> txdata->tx_db.data.prod += 2; >> barrier(); >> - DOORBELL(bp, txdata->cid, txdata->tx_db.raw); >> + DOORBELL_RELAXED(bp, txdata->cid, txdata->tx_db.raw); > > These are compiler barriers being used here, not wmb(). > > Look, if I can't see a clear: > > wmb() > writel() > > sequence in the patch hunks, I am going to keep pushing back on > these changes. 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. Did I miss something? of course, treating barrier() universally as a write barrier is wrong. > > Thank you. > -- 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.