From: Alexander Duyck <alexander.duyck@gmail.com>
To: Sinan Kaya <okaya@codeaurora.org>
Cc: Netdev <netdev@vger.kernel.org>,
Timur Tabi <timur@codeaurora.org>,
sulrich@codeaurora.org, linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
intel-wired-lan <intel-wired-lan@lists.osuosl.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 7/7] ixgbevf: eliminate duplicate barriers on weakly-ordered archs
Date: Wed, 14 Mar 2018 18:45:47 -0700 [thread overview]
Message-ID: <CAKgT0Uf+1U6tBFTFO=c_4AgEDwqkB=hvAFk4b0G+_-mMLtZ5Mg@mail.gmail.com> (raw)
In-Reply-To: <1520997629-17361-7-git-send-email-okaya@codeaurora.org>
On Tue, Mar 13, 2018 at 8:20 PM, Sinan Kaya <okaya@codeaurora.org> wrote:
> Code includes wmb() followed by writel() in multiple places. writel()
> already has a barrier on some architectures like arm64.
>
> This ends up CPU observing two barriers back to back before executing the
> register write.
>
> Since code already has an explicit barrier call, changing writel() to
> writel_relaxed().
>
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
> drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 5 ++++-
> drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 7 +++++++
> 2 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
> index f695242..64d0e0b 100644
> --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
> +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
> @@ -244,9 +244,12 @@ static inline u16 ixgbevf_desc_unused(struct ixgbevf_ring *ring)
> return ((ntc > ntu) ? 0 : ring->count) + ntc - ntu - 1;
> }
>
> +/* Assumes caller has executed a write barrier to order memory and device
> + * requests.
> + */
> static inline void ixgbevf_write_tail(struct ixgbevf_ring *ring, u32 value)
> {
> - writel(value, ring->tail);
> + writel_relaxed(value, ring->tail);
> }
>
> #define IXGBEVF_RX_DESC(R, i) \
> diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> index 9b3d43d..0ba7f59 100644
> --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> @@ -3643,6 +3643,13 @@ static void ixgbevf_tx_map(struct ixgbevf_ring *tx_ring,
>
> tx_ring->next_to_use = i;
>
> + /* Force memory writes to complete before letting h/w
> + * know there are new descriptors to fetch. (Only
> + * applicable for weak-ordered memory model archs,
> + * such as IA-64).
> + */
> + wmb();
This memory barrier is redundant. There is a wmb() that is called
about 10 lines before this.
> +
> /* notify HW of packet */
> ixgbevf_write_tail(tx_ring, i);
>
> --
> 2.7.4
>
prev parent reply other threads:[~2018-03-15 1:45 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 3:20 [PATCH 1/7] i40e/i40evf: Eliminate duplicate barriers on weakly-ordered archs Sinan Kaya
2018-03-14 3:20 ` [PATCH 2/7] ixgbe: eliminate " Sinan Kaya
2018-03-15 1:47 ` Alexander Duyck
2018-03-14 3:20 ` [PATCH 3/7] RDMA/qedr: " Sinan Kaya
2018-03-14 4:12 ` Jason Gunthorpe
2018-03-14 12:06 ` okaya
2018-03-15 22:23 ` Jason Gunthorpe
2018-03-14 3:20 ` [PATCH 4/7] igbvf: " Sinan Kaya
2018-03-15 1:48 ` Alexander Duyck
2018-03-14 3:20 ` [PATCH 5/7] igb: " Sinan Kaya
2018-03-15 1:50 ` Alexander Duyck
2018-03-14 3:20 ` [PATCH 6/7] e1000: " Sinan Kaya
2018-03-15 1:41 ` Alexander Duyck
2018-03-15 23:30 ` Sinan Kaya
2018-03-16 0:25 ` Alexander Duyck
2018-03-16 0:50 ` Sinan Kaya
2018-03-14 3:20 ` [PATCH 7/7] ixgbevf: " Sinan Kaya
2018-03-14 5:08 ` Timur Tabi
2018-03-14 12:13 ` okaya
2018-03-14 21:49 ` Alexander Duyck
2018-03-14 22:57 ` Sinan Kaya
2018-03-15 1:44 ` Alexander Duyck
2018-03-15 2:17 ` Sinan Kaya
2018-03-15 14:32 ` Alexander Duyck
2018-03-15 16:21 ` Sinan Kaya
2018-03-15 16:27 ` Sinan Kaya
2018-03-15 16:58 ` Alexander Duyck
2018-03-15 1:45 ` Alexander Duyck [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='CAKgT0Uf+1U6tBFTFO=c_4AgEDwqkB=hvAFk4b0G+_-mMLtZ5Mg@mail.gmail.com' \
--to=alexander.duyck@gmail.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jeffrey.t.kirsher@intel.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=okaya@codeaurora.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).