[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY1PR0701MB133742146E2848330CA89FB290A20@CY1PR0701MB1337.namprd07.prod.outlook.com>
Date: Thu, 29 Mar 2018 09:17:43 +0000
From: "Elior, Ariel" <Ariel.Elior@...ium.com>
To: Sinan Kaya <okaya@...eaurora.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"timur@...eaurora.org" <timur@...eaurora.org>,
"sulrich@...eaurora.org" <sulrich@...eaurora.org>
CC: "linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Dept-Eng Everest Linux L2 <Dept-EngEverestLinuxL2@...ium.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v7 3/7] bnx2x: Replace doorbell barrier() with wmb()
> Subject: [PATCH v7 3/7] bnx2x: Replace doorbell barrier() with wmb()
>
> barrier() doesn't guarantee memory writes to be observed by the hardware on
> all architectures. barrier() only tells compiler not to move this code
> with respect to other read/writes.
>
> If memory write needs to be observed by the HW, wmb() is the right choice.
The wmb() is there (a couple of lines above). Your modification adds an
unnecessary fence which would hurt high pps scenarios. The memory
writes which the HW needs to observe are the buffer descriptors, not the
producer update message. The producer is written to the HW, and exists
on the stack. The barrier() is there to prevent the compiler from mixing the
order of the prod update message preparation and writing it to the host.
A possible alternative would be to move the existing wmb() to where
the barrier() is, achieving both goals, although in the existing design each
barrier has a distinct purpose. The comment location is misleading, though.
Thanks,
Ariel
Powered by blists - more mailing lists