linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sinan Kaya <okaya@codeaurora.org>
To: David Miller <davem@davemloft.net>
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
Subject: Re: [PATCH v5 3/5] bnx2x: Eliminate duplicate barriers on weakly-ordered archs
Date: Fri, 23 Mar 2018 12:51:47 -0400	[thread overview]
Message-ID: <4bd9ccd2-df8f-acad-2513-eefe065dc852@codeaurora.org> (raw)
In-Reply-To: <20180323.124326.2170503491903886041.davem@davemloft.net>

On 3/23/2018 12:43 PM, David Miller wrote:
> From: Sinan Kaya <okaya@codeaurora.org>
> 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.

  reply	other threads:[~2018-03-23 16:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-22 17:09 [PATCH v5 0/5] netdev: Eliminate duplicate barriers on weakly-ordered archs Sinan Kaya
2018-03-22 17:09 ` [PATCH v5 1/5] net: qla3xxx: " Sinan Kaya
2018-03-22 17:09 ` [PATCH v5 2/5] qlcnic: " Sinan Kaya
2018-03-22 17:10 ` [PATCH v5 3/5] bnx2x: " Sinan Kaya
2018-03-23 16:20   ` David Miller
2018-03-23 16:31     ` Sinan Kaya
2018-03-23 16:43       ` David Miller
2018-03-23 16:51         ` Sinan Kaya [this message]
2018-03-23 17:04           ` David Miller
2018-03-23 17:13             ` Sinan Kaya
2018-03-23 17:16               ` David Miller
2018-03-24 14:30               ` Chopra, Manish
2018-03-24 14:57                 ` Sinan Kaya
2018-03-22 17:10 ` [PATCH v5 4/5] net: qlge: " Sinan Kaya
2018-03-22 17:10 ` [PATCH v5 5/5] bnxt_en: " Sinan Kaya

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=4bd9ccd2-df8f-acad-2513-eefe065dc852@codeaurora.org \
    --to=okaya@codeaurora.org \
    --cc=ariel.elior@cavium.com \
    --cc=davem@davemloft.net \
    --cc=everest-linux-l2@cavium.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sulrich@codeaurora.org \
    --cc=timur@codeaurora.org \
    /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).