From: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
To: <david.hunt@intel.com>, <anatoly.burakov@intel.com>,
<jerinj@marvell.com>, <radu.nicolau@intel.com>,
<gakhil@marvell.com>, <cristian.dumitrescu@intel.com>,
<ferruh.yigit@amd.com>, <konstantin.ananyev@huawei.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>
Subject: [PATCH v2] eal/x86: enable timeout in AMD power monitor
Date: Mon, 13 Oct 2025 05:51:57 +0000 [thread overview]
Message-ID: <20251013055158.3037400-1-sivaprasad.tummala@amd.com> (raw)
In-Reply-To: <20251013031619.2988915-1-sivaprasad.tummala@amd.com>
Previously, the AMD power monitor implementation did not enable the
timeout, causing the lcore to remain in a wait state until an external
monitoring event occurred or an interrupt was received.
This patch enables the timeout-based exit condition, allowing
the lcore to automatically wake up after the specified period.
The maximum supported timeout value is 2^32 - 1.
Fixes: c7ed1ce04704 ("eal/x86: add power intrinsics for AMD")
Cc: stable@dpdk.org
Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
v2:
1. fixed asm compilation error.
---
lib/eal/x86/rte_power_intrinsics.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/eal/x86/rte_power_intrinsics.c b/lib/eal/x86/rte_power_intrinsics.c
index 489ad3983f..8a5f222aea 100644
--- a/lib/eal/x86/rte_power_intrinsics.c
+++ b/lib/eal/x86/rte_power_intrinsics.c
@@ -89,14 +89,14 @@ static void amd_monitorx(volatile void *addr)
static void amd_mwaitx(const uint64_t timeout)
{
- RTE_SET_USED(timeout);
#if defined(RTE_TOOLCHAIN_MSVC) || defined(__MWAITX__)
- _mm_mwaitx(0, 0, 0);
+ _mm_mwaitx(2, 0, (uint32_t)timeout);
#else
asm volatile(".byte 0x0f, 0x01, 0xfb;"
: /* ignore rflags */
: "a"(0), /* enter C1 */
- "c"(0)); /* no time-out */
+ "b"((uint32_t)timeout),
+ "c"(2)); /* enable time-out */
#endif
}
--
2.43.0
prev parent reply other threads:[~2025-10-13 5:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-13 3:16 [PATCH] eal/x86: enable timeout in AMD power monitor Sivaprasad Tummala
2025-10-13 5:51 ` Sivaprasad Tummala [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=20251013055158.3037400-1-sivaprasad.tummala@amd.com \
--to=sivaprasad.tummala@amd.com \
--cc=anatoly.burakov@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=david.hunt@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=gakhil@marvell.com \
--cc=jerinj@marvell.com \
--cc=konstantin.ananyev@huawei.com \
--cc=radu.nicolau@intel.com \
--cc=stable@dpdk.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).