From: Liran Alon <liran.alon@oracle.com>
To: Liran Alon <liran.alon@oracle.com>
Cc: "Belgazal, Netanel" <netanel@amazon.com>,
davem@davemloft.net, netdev@vger.kernel.org, saeedb@amazon.com,
zorik@amazon.com, sameehj@amazon.com, igorch@amazon.com,
akiyano@amazon.com, evgenys@amazon.com, gtzalik@amazon.com,
ndagan@amazon.com, matua@amazon.com, galpress@amazon.com,
"Håkon Bugge" <haakon.bugge@oracle.com>
Subject: Re: [PATCH 1/2] net: AWS ENA: Remove unncessary wmb() to flush bounce buffer
Date: Fri, 17 Jan 2020 17:54:41 +0200 [thread overview]
Message-ID: <9D62CAC6-7AB5-4D98-A39D-1FE87A2EE1F7@oracle.com> (raw)
In-Reply-To: <20200102180830.66676-2-liran.alon@oracle.com>
Ping on merging this patch (Patch 2/2 of series should be dropped).
-Liran
> On 2 Jan 2020, at 20:08, Liran Alon <liran.alon@oracle.com> wrote:
>
> Current code executes wmb() in order to flush writes to bounce buffer
> before copying it to device-memory (PCI BAR mapped as WC) to ensure
> consistent data is written to device-memory.
>
> However, this wmb() is unnecessary. This is because all reads from the
> buffer are guaranteed to be consistent with previous writes to the buffer
> done from the same task (Which is the only one that writes to the buffer).
>
> i.e. If a single CPU runs both the writes to the buffer and the reads
> from the buffer, the reads are guaranteed to read most up-to-date data
> in program order (E.g. Due to store-to-load-forwarding mechanism).
> Otherwise, there is a context-switch, and that should make writes before
> context-switch globally visible as-well.
>
> Reviewed-by: Håkon Bugge <haakon.bugge@oracle.com>
> Signed-off-by: Liran Alon <liran.alon@oracle.com>
> ---
> drivers/net/ethernet/amazon/ena/ena_eth_com.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/amazon/ena/ena_eth_com.c b/drivers/net/ethernet/amazon/ena/ena_eth_com.c
> index 2845ac277724..742578ac1240 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_eth_com.c
> +++ b/drivers/net/ethernet/amazon/ena/ena_eth_com.c
> @@ -93,11 +93,6 @@ static int ena_com_write_bounce_buffer_to_dev(struct ena_com_io_sq *io_sq,
> io_sq->qid, io_sq->entries_in_tx_burst_left);
> }
>
> - /* Make sure everything was written into the bounce buffer before
> - * writing the bounce buffer to the device
> - */
> - wmb();
> -
> /* The line is completed. Copy it to dev */
> __iowrite64_copy(io_sq->desc_addr.pbuf_dev_addr + dst_offset,
> bounce_buffer, (llq_info->desc_list_entry_size) / 8);
> --
> 2.20.1
>
next prev parent reply other threads:[~2020-01-17 15:57 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 [this message]
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
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=9D62CAC6-7AB5-4D98-A39D-1FE87A2EE1F7@oracle.com \
--to=liran.alon@oracle.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=matua@amazon.com \
--cc=ndagan@amazon.com \
--cc=netanel@amazon.com \
--cc=netdev@vger.kernel.org \
--cc=saeedb@amazon.com \
--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