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 28EB146BAE for ; Fri, 18 Jul 2025 21:39:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D8A640611; Fri, 18 Jul 2025 21:39:04 +0200 (CEST) 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 AE0A640611 for ; Fri, 18 Jul 2025 21:39:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752867541; 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=Q9qQC84uccFdW1eU4+S3RTFDRkZWdesnaHMfm+6xENE=; b=BOkVuFpB5/yaaHxXHE77FCr1+AfUScPvONdud2M4VNaEMRN3Bz/91lD4XBkaE7h2yntbqc WSkCSC2EyWogd7sTN3tGArX5Lu+eJjmCTHiQZqVXVlDsz6uZTeGp6gpZE9/aSoBZfvkhRh l3zAn7LIG+ksnCtnA6UngoYA3st4yMw= Received: from mx-prod-mc-01.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-622-XaZydiJQNeSf5emf6NTy1w-1; Fri, 18 Jul 2025 15:38:59 -0400 X-MC-Unique: XaZydiJQNeSf5emf6NTy1w-1 X-Mimecast-MFC-AGG-ID: XaZydiJQNeSf5emf6NTy1w_1752867538 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A9019195FD1B; Fri, 18 Jul 2025 19:38:58 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.40]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B096A18003FC; Fri, 18 Jul 2025 19:38:56 +0000 (UTC) From: Kevin Traynor To: Shai Brandes Cc: Amit Bernstein , Yosef Raisman , dpdk stable Subject: patch 'net/ena: fix aenq timeout with low poll interval' has been queued to stable release 24.11.3 Date: Fri, 18 Jul 2025 20:31:49 +0100 Message-ID: <20250718193247.1008129-175-ktraynor@redhat.com> In-Reply-To: <20250718193247.1008129-1-ktraynor@redhat.com> References: <20250718193247.1008129-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: MCqPFCLen_jOzbemv3y2MhRn308f2aWWvRiYUblrF8Y_1752867538 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.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/23/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/7cf4b46ba87fe83b7b66474ddcc9c36a4e020b6a Thanks. Kevin --- >From 7cf4b46ba87fe83b7b66474ddcc9c36a4e020b6a Mon Sep 17 00:00:00 2001 From: Shai Brandes Date: Mon, 30 Jun 2025 14:16:00 +0300 Subject: [PATCH] net/ena: fix aenq timeout with low poll interval [ upstream commit 7905edcda144899abebf1504036fde6b3439e398 ] The driver can work in polling-based functionality of the admin queue, eliminating the need for interrupts in the control-path. This mode is mandatory when using the uio_pci_generic driver, which lacks interrupt support. The control_path_poll_interval devarg is being set within the range [1..1000]. A value of 0 disables the polling mechanism. This value defines the interval in milliseconds at which the driver checks for asynchronous notifications from the device. Testing revealed that setting this interval below 500 milliseconds might lead to false detection of device unresponsiveness. This patch clamps the user-defined value to the updated valid range [500..1000] that ensures reliable aenq monitoring. Fixes: ca1dfa85f0d3 ("net/ena: add control path pure polling mode") Signed-off-by: Shai Brandes Reviewed-by: Amit Bernstein Reviewed-by: Yosef Raisman --- doc/guides/nics/ena.rst | 4 +++- drivers/net/ena/ena_ethdev.c | 24 ++++++++++-------------- drivers/net/ena/ena_ethdev.h | 3 ++- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/doc/guides/nics/ena.rst b/doc/guides/nics/ena.rst index a34575dc9b..b1b85e6ab1 100644 --- a/doc/guides/nics/ena.rst +++ b/doc/guides/nics/ena.rst @@ -137,5 +137,7 @@ Runtime Configuration 0 - Disable (Admin queue will work in interrupt mode). - [1..1000] - Number of milliseconds to wait between periodic inspection of the admin queues. + [500..1000] - Time in milliseconds to wait between periodic checks of the admin queues. + If a value outside this range is specified, the driver will automatically adjust it + to fit within the valid range. **A non-zero value for this devarg is mandatory for control path functionality diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 93dca8f146..160aa79137 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -31,4 +31,6 @@ ((rte_pktmbuf_mtod_offset(mbuf, struct rte_tcp_hdr *, \ mbuf->l3_len + mbuf->l2_len)->data_off) >> 4) +#define CLAMP_VAL(val, min, max) \ + (RTE_MIN(RTE_MAX((val), (typeof(val))(min)), (typeof(val))(max))) #define ETH_GSTRING_LEN 32 @@ -3746,23 +3748,17 @@ static int ena_process_uint_devarg(const char *key, } } else if (strcmp(key, ENA_DEVARG_CONTROL_PATH_POLL_INTERVAL) == 0) { - if (uint64_value > ENA_MAX_CONTROL_PATH_POLL_INTERVAL_MSEC) { - PMD_INIT_LOG_LINE(ERR, - "Control path polling interval is too long: %" PRIu64 " msecs. " - "Maximum allowed: %d msecs.", - uint64_value, ENA_MAX_CONTROL_PATH_POLL_INTERVAL_MSEC); - return -EINVAL; - } else if (uint64_value == 0) { + if (uint64_value == 0) { PMD_INIT_LOG_LINE(INFO, - "Control path polling interval is set to zero. Operating in " - "interrupt mode."); - adapter->control_path_poll_interval = 0; + "Control path polling is disabled - Operating in interrupt mode"); } else { + uint64_value = CLAMP_VAL(uint64_value, + ENA_MIN_CONTROL_PATH_POLL_INTERVAL_MSEC, + ENA_MAX_CONTROL_PATH_POLL_INTERVAL_MSEC); PMD_INIT_LOG_LINE(INFO, - "Control path polling interval is set to %" PRIu64 " msecs.", + "Control path polling interval is %" PRIu64 " msec", uint64_value); - adapter->control_path_poll_interval = uint64_value * USEC_PER_MSEC; } + adapter->control_path_poll_interval = uint64_value * (USEC_PER_MSEC); } - return 0; } @@ -4041,5 +4037,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ena, ENA_DEVARG_LLQ_POLICY "=<0|1|2|3> " ENA_DEVARG_MISS_TXC_TO "=" - ENA_DEVARG_CONTROL_PATH_POLL_INTERVAL "=<0-1000>"); + ENA_DEVARG_CONTROL_PATH_POLL_INTERVAL "= 0|<500-1000> "); RTE_LOG_REGISTER_SUFFIX(ena_logtype_init, init, NOTICE); RTE_LOG_REGISTER_SUFFIX(ena_logtype_driver, driver, NOTICE); diff --git a/drivers/net/ena/ena_ethdev.h b/drivers/net/ena/ena_ethdev.h index b8aead8f46..d3ec19957c 100644 --- a/drivers/net/ena/ena_ethdev.h +++ b/drivers/net/ena/ena_ethdev.h @@ -45,5 +45,6 @@ #define ENA_DEFAULT_MISSING_COMP 256U -#define ENA_MAX_CONTROL_PATH_POLL_INTERVAL_MSEC 1000 +#define ENA_MAX_CONTROL_PATH_POLL_INTERVAL_MSEC 1000U +#define ENA_MIN_CONTROL_PATH_POLL_INTERVAL_MSEC 500U /* While processing submitted and completed descriptors (rx and tx path -- 2.50.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-07-18 20:29:17.111156786 +0100 +++ 0175-net-ena-fix-aenq-timeout-with-low-poll-interval.patch 2025-07-18 20:29:11.196908146 +0100 @@ -1 +1 @@ -From 7905edcda144899abebf1504036fde6b3439e398 Mon Sep 17 00:00:00 2001 +From 7cf4b46ba87fe83b7b66474ddcc9c36a4e020b6a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7905edcda144899abebf1504036fde6b3439e398 ] + @@ -22 +23,0 @@ -Cc: stable@dpdk.org @@ -28,5 +29,4 @@ - doc/guides/nics/ena.rst | 4 +++- - doc/guides/rel_notes/release_25_07.rst | 2 ++ - drivers/net/ena/ena_ethdev.c | 24 ++++++++++-------------- - drivers/net/ena/ena_ethdev.h | 3 ++- - 4 files changed, 17 insertions(+), 16 deletions(-) + doc/guides/nics/ena.rst | 4 +++- + drivers/net/ena/ena_ethdev.c | 24 ++++++++++-------------- + drivers/net/ena/ena_ethdev.h | 3 ++- + 3 files changed, 15 insertions(+), 16 deletions(-) @@ -35 +35 @@ -index 41c22804e1..cfc78f1e6a 100644 +index a34575dc9b..b1b85e6ab1 100644 @@ -47,11 +46,0 @@ -diff --git a/doc/guides/rel_notes/release_25_07.rst b/doc/guides/rel_notes/release_25_07.rst -index 017bada33e..6f49bf8f90 100644 ---- a/doc/guides/rel_notes/release_25_07.rst -+++ b/doc/guides/rel_notes/release_25_07.rst -@@ -79,4 +79,6 @@ New Features - * Fixed the device initialization routine to correctly handle failure during the registration - or enabling of interrupts when operating in control path interrupt mode. -+ * Fixed an issue where the device might be incorrectly reported as unresponsive when using -+ polling-based admin queue functionality with a poll interval of less than 500 milliseconds. - - * **Added Mucse rnp net driver.** @@ -59 +48 @@ -index eb33ca2c6e..04a698b58c 100644 +index 93dca8f146..160aa79137 100644 @@ -69 +58 @@ -@@ -3757,23 +3759,17 @@ static int ena_process_uint_devarg(const char *key, +@@ -3746,23 +3748,17 @@ static int ena_process_uint_devarg(const char *key, @@ -100 +89 @@ -@@ -4082,5 +4078,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ena, +@@ -4041,5 +4037,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ena, @@ -103,3 +92,2 @@ -- ENA_DEVARG_CONTROL_PATH_POLL_INTERVAL "=<0-1000>") -+ ENA_DEVARG_CONTROL_PATH_POLL_INTERVAL "= 0|<500-1000> " - ENA_DEVARG_ENABLE_FRAG_BYPASS "=<0|1> "); +- ENA_DEVARG_CONTROL_PATH_POLL_INTERVAL "=<0-1000>"); ++ ENA_DEVARG_CONTROL_PATH_POLL_INTERVAL "= 0|<500-1000> "); @@ -106,0 +95 @@ + RTE_LOG_REGISTER_SUFFIX(ena_logtype_driver, driver, NOTICE); @@ -108 +97 @@ -index e3cb4919c5..830135bcfd 100644 +index b8aead8f46..d3ec19957c 100644 @@ -111 +100 @@ -@@ -43,5 +43,6 @@ +@@ -45,5 +45,6 @@