<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<br>
<div><br>
<blockquote type="cite">
<div>On Feb 19, 2024, at 9:02 PM, Wathsala Wathawana Vithanage <wathsala.vithanage@arm.com> wrote:</div>
<br class="Apple-interchange-newline">
<div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Caution:
 This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
-----Original Message-----<br>
From: Wathsala Wathawana Vithanage <<a href="mailto:wathsala.vithanage@arm.com">wathsala.vithanage@arm.com</a>><br>
Sent: Monday, February 19, 2024 4:17 PM<br>
To: Andrew Boyer <<a href="mailto:andrew.boyer@amd.com">andrew.boyer@amd.com</a>>;<span class="Apple-converted-space"> </span><a href="mailto:dev@dpdk.org">dev@dpdk.org</a><br>
Cc: Neel Patel <<a href="mailto:neel.patel@amd.com">neel.patel@amd.com</a>>; nd <<a href="mailto:nd@arm.com">nd@arm.com</a>>; Honnappa<br>
Nagarahalli <<a href="mailto:Honnappa.Nagarahalli@arm.com">Honnappa.Nagarahalli@arm.com</a>>; nd <<a href="mailto:nd@arm.com">nd@arm.com</a>><br>
Subject: RE: [PATCH 2/3] net/ionic: remove duplicate barriers<br>
<br>
Hi Andrew,<br>
<br>
I think that this barrier may have been added to ensure any writes to q-<br>
<blockquote type="cite">hw_index and q->head_idx complete before ionic_q_flush computes val.<br>
</blockquote>
Dependency chains can also prevent reordering if that's the case this barrier is<br>
not required.<br>
However, I have the following concern.<br>
<br>
<blockquote type="cite">diff --git a/drivers/net/ionic/ionic_main.c<br>
b/drivers/net/ionic/ionic_main.c index 1f24f64a33..814bb3b8f4 100644<br>
--- a/drivers/net/ionic/ionic_main.c<br>
+++ b/drivers/net/ionic/ionic_main.c<br>
@@ -223,7 +223,6 @@ ionic_adminq_post(struct ionic_lif *lif, struct<br>
ionic_admin_ctx *ctx)<br>
   q->head_idx = Q_NEXT_TO_POST(q, 1);<br>
<br>
   /* Ring doorbell */<br>
-   rte_wmb();<br>
   ionic_q_flush(q);<br>
<br>
err_out:<br>
</blockquote>
<br>
Ionic_q_flush(q) uses q->hw_index and q->head_idx to compute the value of<br>
val which it writes to the address stored in q->db. I can see that q->head_idx is<br>
updated before the removed rte_wmb(), therefore it's safe to assume that " q-<br>
<blockquote type="cite">head_idx = Q_NEXT_TO_POST(q, 1)" and "val = IONIC_DBELL_QID(q-<br>
hw_index) | q->head_idx" will maintain the program order due to that<br>
</blockquote>
dependency. But I don't know if there exists a dependency chain over q-<br>
<blockquote type="cite">hw_index. If not, then that may have been the motive behind this barrier.<br>
</blockquote>
<br>
</blockquote>
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Since
 q->hw_index is also updated in the same CPU ionic_q_flush will</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">always
 see the correct value, consequently val should be always correct.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">It's
 safe to remove this barrier.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<br>
</div>
</blockquote>
</div>
<br>
<div>Thank you for the careful review. We agree with this analysis.</div>
<div><br>
</div>
<div>-Andrew</div>
<div><br>
</div>
</body>
</html>