[lkml]   [2018]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v5 3/5] bnx2x: Eliminate duplicate barriers on weakly-ordered archs
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-> += 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-> 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.

 \ /
  Last update: 2018-03-23 17:52    [W:0.087 / U:1.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site