From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9B33248B69 for ; Fri, 21 Nov 2025 12:24:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 94C914026F; Fri, 21 Nov 2025 12:24:33 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id D1DCE4026F for ; Fri, 21 Nov 2025 12:24:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763724271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wOZcdqaNcR/uaDZZlwE7DRMEzLB7oG44wQ3d8tJFQw8=; b=FZZHDUCJk5CJHUHlr8osnE8B6mrVwPIkkQOM2D2HRtrf9+UVJ9w/JMpR7jhunm7P+/E3uR u5I2cwxNZ6gJ3raeYWo6hRORwQ9389WxkaaPlWndmpvPxHQOxQtUCyfBCUVXOWYxwDwXwy /TkReZQsdOyYnYK4FWAERGkPHJECbz8= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-686-An06dlX_M0eztbh7-jk8nA-1; Fri, 21 Nov 2025 06:24:28 -0500 X-MC-Unique: An06dlX_M0eztbh7-jk8nA-1 X-Mimecast-MFC-AGG-ID: An06dlX_M0eztbh7-jk8nA_1763724267 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5BAE9195608D; Fri, 21 Nov 2025 11:24:27 +0000 (UTC) Received: from rh.redhat.com (unknown [10.42.28.165]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 201E330044DB; Fri, 21 Nov 2025 11:24:25 +0000 (UTC) From: Kevin Traynor To: Sivaprasad Tummala Cc: dpdk stable Subject: patch 'net/mlx5: fix spurious CPU wakeups' has been queued to stable release 24.11.4 Date: Fri, 21 Nov 2025 11:21:08 +0000 Message-ID: <20251121112128.485623-84-ktraynor@redhat.com> In-Reply-To: <20251121112128.485623-1-ktraynor@redhat.com> References: <20251121112128.485623-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Bz-d4SfAhax_WfvphN--VSNkIVqmhG4Nma1PnfMiHQc_1763724267 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 24.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/26/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/445b320f57e0aa24e79530aabbd2ade62cad66d5 Thanks. Kevin --- >From 445b320f57e0aa24e79530aabbd2ade62cad66d5 Mon Sep 17 00:00:00 2001 From: Sivaprasad Tummala Date: Tue, 11 Nov 2025 03:40:57 +0000 Subject: [PATCH] net/mlx5: fix spurious CPU wakeups [ upstream commit 750f635fc6a7ee287e076c5500ca97d77187676a ] Previously, the PMD used a common monitor callback to determine CQE ownership for power-aware polling. However, when a CQE contained an invalid opcode (MLX5_CQE_INVALID), ownership bit was not reliable. As a result, the monitor condition could falsely indicate CQE availability and cause the CPU to wake up unnecessarily during low traffic periods. This resulted in spurious wakeups in monitor-wait mode and reduced the expected power savings, as cores exited the sleep state even when no valid CQEs were available. This patch introduces a dedicated callback that skips invalid CQEs and optimizes power efficiency by preventing false wakeups caused by hardware-owned or invalid entries. Fixes: a8f0df6bf98d ("net/mlx5: support power monitoring") Signed-off-by: Sivaprasad Tummala --- drivers/net/mlx5/mlx5_rx.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c index 0f2152fdb0..c5fdf25a38 100644 --- a/drivers/net/mlx5/mlx5_rx.c +++ b/drivers/net/mlx5/mlx5_rx.c @@ -295,4 +295,18 @@ mlx5_monitor_callback(const uint64_t value, } +static int +mlx5_monitor_cqe_own_callback(const uint64_t value, + const uint64_t opaque[RTE_POWER_MONITOR_OPAQUE_SZ]) +{ + const uint64_t m = opaque[CLB_MSK_IDX]; + const uint64_t v = opaque[CLB_VAL_IDX]; + const uint64_t sw_owned = ((value & m) == v); + const uint64_t opcode = MLX5_CQE_OPCODE(value); + const uint64_t valid_op = (opcode != MLX5_CQE_INVALID); + + /* ownership bit is not valid for invalid opcode; CQE is HW owned */ + return -(valid_op & sw_owned); +} + int mlx5_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc) { @@ -312,10 +326,11 @@ int mlx5_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc) pmc->opaque[CLB_VAL_IDX] = vic; pmc->opaque[CLB_MSK_IDX] = MLX5_CQE_VIC_INIT; + pmc->fn = mlx5_monitor_callback; } else { pmc->addr = &cqe->op_own; pmc->opaque[CLB_VAL_IDX] = !!idx; pmc->opaque[CLB_MSK_IDX] = MLX5_CQE_OWNER_MASK; + pmc->fn = mlx5_monitor_cqe_own_callback; } - pmc->fn = mlx5_monitor_callback; pmc->size = sizeof(uint8_t); return 0; -- 2.51.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-11-21 11:05:12.157007382 +0000 +++ 0084-net-mlx5-fix-spurious-CPU-wakeups.patch 2025-11-21 11:05:09.567201613 +0000 @@ -1 +1 @@ -From 750f635fc6a7ee287e076c5500ca97d77187676a Mon Sep 17 00:00:00 2001 +From 445b320f57e0aa24e79530aabbd2ade62cad66d5 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 750f635fc6a7ee287e076c5500ca97d77187676a ] + @@ -22 +23,0 @@ -Cc: stable@dpdk.org @@ -30 +31 @@ -index 420a03068d..ac663a978e 100644 +index 0f2152fdb0..c5fdf25a38 100644 @@ -33 +34 @@ -@@ -296,4 +296,18 @@ mlx5_monitor_callback(const uint64_t value, +@@ -295,4 +295,18 @@ mlx5_monitor_callback(const uint64_t value, @@ -52 +53 @@ -@@ -313,10 +327,11 @@ int mlx5_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc) +@@ -312,10 +326,11 @@ int mlx5_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc)