netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bshara, Saeed" <saeedb@amazon.com>
To: "liran.alon@oracle.com" <liran.alon@oracle.com>
Cc: "Kiyanovski, Arthur" <akiyano@amazon.com>,
	"Tzalik, Guy" <gtzalik@amazon.com>,
	"Matushevsky, Alexander" <matua@amazon.com>,
	"Jubran, Samih" <sameehj@amazon.com>,
	"haakon.bugge@oracle.com" <haakon.bugge@oracle.com>,
	"Pressman, Gal" <galpress@amazon.com>,
	"Dagan, Noam" <ndagan@amazon.com>,
	"Machulsky, Zorik" <zorik@amazon.com>,
	"Schmeilin, Evgeny" <evgenys@amazon.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"Belgazal, Netanel" <netanel@amazon.com>,
	"Chauskin, Igor" <igorch@amazon.com>
Subject: Re: [PATCH 2/2] net: AWS ENA: Flush WCBs before writing new SQ tail to doorbell
Date: Sun, 5 Jan 2020 11:49:51 +0000	[thread overview]
Message-ID: <1539a496db269f92764f9296778f89afecfff634.camel@amazon.com> (raw)
In-Reply-To: <C2CB0420-79C8-4282-AE14-F575407B7C22@oracle.com>

On Sun, 2020-01-05 at 12:22 +0200, Liran Alon wrote:
> Hi Saeed,
> 
> If I understand correctly, the device is only aware of new
> descriptors once the tail is updated by ena_com_write_sq_doorbell()
> using writel().
> If that’s the case, then writel() guarantees all previous writes to
> WB/UC memory is visible to device before the write done by writel().
device fetches packet only after doorbell notification.
you are right, writel() includes the needed barrier (
https://elixir.bootlin.com/linux/v5.4.8/source/Documentation/memory-barriers.txt#L1929
)
so indeed we should be ok without any explicit wmb() or dma_wmb().

> 
> If device is allowed to fetch packet payload at the moment the
> transmit descriptor is written into device-memory using LLQ,
> then ena_com_write_bounce_buffer_to_dev() should dma_wmb() before
> __iowrite64_copy(). Instead of wmb(). And comment
> is wrong and should be updated accordingly.
> For example, this will optimise x86 to only have a compiler-barrier
> instead of executing a SFENCE.
> 
> Can you clarify what is device behaviour on when it is allowed to
> read the packet payload?
> i.e. Is it only after writing to doorbell or is it from the moment
> the transmit descriptor is written to LLQ?
> 
> -Liran
> 

      reply	other threads:[~2020-01-05 11:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-02 18:08 [PATCH 0/2] net: AWS ENA: Fix memory barrier usage when using LLQ Liran Alon
2020-01-02 18:08 ` [PATCH 1/2] net: AWS ENA: Remove unncessary wmb() to flush bounce buffer Liran Alon
2020-01-17 15:54   ` Liran Alon
2020-01-02 18:08 ` [PATCH 2/2] net: AWS ENA: Flush WCBs before writing new SQ tail to doorbell Liran Alon
2020-01-03 18:46   ` Liran Alon
2020-01-04  4:55     ` Machulsky, Zorik
2020-01-05  9:53       ` Bshara, Saeed
2020-01-05 10:22         ` Liran Alon
2020-01-05 11:49           ` Bshara, Saeed [this message]

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=1539a496db269f92764f9296778f89afecfff634.camel@amazon.com \
    --to=saeedb@amazon.com \
    --cc=akiyano@amazon.com \
    --cc=davem@davemloft.net \
    --cc=evgenys@amazon.com \
    --cc=galpress@amazon.com \
    --cc=gtzalik@amazon.com \
    --cc=haakon.bugge@oracle.com \
    --cc=igorch@amazon.com \
    --cc=liran.alon@oracle.com \
    --cc=matua@amazon.com \
    --cc=ndagan@amazon.com \
    --cc=netanel@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=sameehj@amazon.com \
    --cc=zorik@amazon.com \
    /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).