DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Boyer, Andrew" <Andrew.Boyer@amd.com>
To: Wathsala Wathawana Vithanage <wathsala.vithanage@arm.com>
Cc: "Boyer, Andrew" <Andrew.Boyer@amd.com>,
	"dev@dpdk.org" <dev@dpdk.org>, "Patel, Neel" <Neel.Patel@amd.com>,
	nd <nd@arm.com>,
	Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Subject: Re: [PATCH 2/3] net/ionic: remove duplicate barriers
Date: Tue, 20 Feb 2024 18:31:56 +0000	[thread overview]
Message-ID: <76FA87FC-B542-40C8-8F03-350B3A1175B9@amd.com> (raw)
In-Reply-To: <AM0PR08MB50731F0F22A0CF5B35BA8B699F502@AM0PR08MB5073.eurprd08.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2287 bytes --]



On Feb 19, 2024, at 9:02 PM, Wathsala Wathawana Vithanage <wathsala.vithanage@arm.com> wrote:

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.


-----Original Message-----
From: Wathsala Wathawana Vithanage <wathsala.vithanage@arm.com<mailto:wathsala.vithanage@arm.com>>
Sent: Monday, February 19, 2024 4:17 PM
To: Andrew Boyer <andrew.boyer@amd.com<mailto:andrew.boyer@amd.com>>; dev@dpdk.org<mailto:dev@dpdk.org>
Cc: Neel Patel <neel.patel@amd.com<mailto:neel.patel@amd.com>>; nd <nd@arm.com<mailto:nd@arm.com>>; Honnappa
Nagarahalli <Honnappa.Nagarahalli@arm.com<mailto:Honnappa.Nagarahalli@arm.com>>; nd <nd@arm.com<mailto:nd@arm.com>>
Subject: RE: [PATCH 2/3] net/ionic: remove duplicate barriers

Hi Andrew,

I think that this barrier may have been added to ensure any writes to q-
hw_index and q->head_idx complete before ionic_q_flush computes val.
Dependency chains can also prevent reordering if that's the case this barrier is
not required.
However, I have the following concern.

diff --git a/drivers/net/ionic/ionic_main.c
b/drivers/net/ionic/ionic_main.c index 1f24f64a33..814bb3b8f4 100644
--- a/drivers/net/ionic/ionic_main.c
+++ b/drivers/net/ionic/ionic_main.c
@@ -223,7 +223,6 @@ ionic_adminq_post(struct ionic_lif *lif, struct
ionic_admin_ctx *ctx)
   q->head_idx = Q_NEXT_TO_POST(q, 1);

   /* Ring doorbell */
-   rte_wmb();
   ionic_q_flush(q);

err_out:

Ionic_q_flush(q) uses q->hw_index and q->head_idx to compute the value of
val which it writes to the address stored in q->db. I can see that q->head_idx is
updated before the removed rte_wmb(), therefore it's safe to assume that " q-
head_idx = Q_NEXT_TO_POST(q, 1)" and "val = IONIC_DBELL_QID(q-
hw_index) | q->head_idx" will maintain the program order due to that
dependency. But I don't know if there exists a dependency chain over q-
hw_index. If not, then that may have been the motive behind this barrier.


Since q->hw_index is also updated in the same CPU ionic_q_flush will
always see the correct value, consequently val should be always correct.
It's safe to remove this barrier.


Thank you for the careful review. We agree with this analysis.

-Andrew


[-- Attachment #2: Type: text/html, Size: 7401 bytes --]

  reply	other threads:[~2024-02-20 18:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 17:07 [PATCH 0/3] net/ionic, common/ionic: add vdev support Andrew Boyer
2024-02-16 17:07 ` [PATCH 1/3] common/ionic: create common code library for ionic Andrew Boyer
2024-02-16 17:07 ` [PATCH 2/3] net/ionic: remove duplicate barriers Andrew Boyer
2024-02-19 22:16   ` Wathsala Wathawana Vithanage
2024-02-20  2:02     ` Wathsala Wathawana Vithanage
2024-02-20 18:31       ` Boyer, Andrew [this message]
2024-02-16 17:07 ` [PATCH 3/3] net/ionic: add vdev support for embedded applications Andrew Boyer
2024-02-19 15:24   ` Ferruh Yigit
2024-02-19 22:02     ` Boyer, Andrew
2024-02-20  2:02   ` Honnappa Nagarahalli
2024-02-21  1:16     ` Boyer, Andrew
2024-02-20  8:28   ` Ferruh Yigit
2024-02-20 14:39     ` Honnappa Nagarahalli
2024-02-16 19:39 ` [PATCH 0/3] net/ionic, common/ionic: add vdev support Ferruh Yigit
2024-02-20 20:42 ` [PATCH v2 " Andrew Boyer
2024-02-20 20:42   ` [PATCH v2 1/3] common/ionic: create common code library for ionic Andrew Boyer
2024-02-20 20:42   ` [PATCH v2 2/3] net/ionic: remove duplicate barriers Andrew Boyer
2024-02-20 20:42   ` [PATCH v2 3/3] net/ionic: add vdev support for embedded applications Andrew Boyer
2024-02-23  1:52     ` Honnappa Nagarahalli
2024-02-21 16:36   ` [PATCH v2 0/3] net/ionic, common/ionic: add vdev support Ferruh Yigit
2024-02-23 13:48     ` Ferruh Yigit

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=76FA87FC-B542-40C8-8F03-350B3A1175B9@amd.com \
    --to=andrew.boyer@amd.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Neel.Patel@amd.com \
    --cc=dev@dpdk.org \
    --cc=nd@arm.com \
    --cc=wathsala.vithanage@arm.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).