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 7141B43DF8 for ; Thu, 4 Apr 2024 11:52:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 687C9402E9; Thu, 4 Apr 2024 11:52:35 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 0EB084025D for ; Thu, 4 Apr 2024 11:52:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712224352; 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=VHDM0Vnj+kuxg64tany1nbIJPCAmNnI9XQGVI3hhyCQ=; b=HyY3OQcbp254u3q/ldGb20WPcc7DFXUYaZEza2J55fOK/XBxVSPVali1GYMdEX2hp6ZFnt ISxdESTYM1HOGtL2nvxhauN3qCgxtolz3km4UDuJk0QScncDb+z/BauB8ql2Ao6KTU4Pc3 tFx4cv6EqwTf87NGCzCWG/qVcHP7djc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-137-zSeqPtxFOsaTIhF2n5VIng-1; Thu, 04 Apr 2024 05:52:29 -0400 X-MC-Unique: zSeqPtxFOsaTIhF2n5VIng-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6451A85A5B6; Thu, 4 Apr 2024 09:52:29 +0000 (UTC) Received: from rh.Home (unknown [10.39.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA5343C21; Thu, 4 Apr 2024 09:52:28 +0000 (UTC) From: Kevin Traynor To: Shai Brandes Cc: Amit Bernstein , dpdk stable Subject: patch 'net/ena/base: limit exponential backoff' has been queued to stable release 21.11.7 Date: Thu, 4 Apr 2024 10:51:34 +0100 Message-ID: <20240404095155.155427-4-ktraynor@redhat.com> In-Reply-To: <20240404095155.155427-1-ktraynor@redhat.com> References: <20240404095155.155427-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 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 21.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/09/24. 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/cb98b1b26d3f886fdec0ca5fc0e2cdc471490c3d Thanks. Kevin --- >From cb98b1b26d3f886fdec0ca5fc0e2cdc471490c3d Mon Sep 17 00:00:00 2001 From: Shai Brandes Date: Tue, 12 Mar 2024 20:06:52 +0200 Subject: [PATCH] net/ena/base: limit exponential backoff [ upstream commit 4b378679c88ff231b97b71aaedc2d424e82f1aba ] Limit the value of the exponent used for this backoff at (1<<16) to prevent it from reaching to an excessive value (1<<32) or potentially even overflowing. In addition, for uniformity and readability purposes, the min/max parameter in the calls of ENA_MIN32 and ENA_MAX32 macros was changed to be first. Fixes: 0c84e04824db ("net/ena/base: make delay exponential in polling functions") Signed-off-by: Shai Brandes Reviewed-by: Amit Bernstein --- drivers/net/ena/base/ena_com.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c index 5ca36ab6d9..4bd85f29f5 100644 --- a/drivers/net/ena/base/ena_com.c +++ b/drivers/net/ena/base/ena_com.c @@ -35,4 +35,6 @@ #define ENA_REGS_ADMIN_INTR_MASK 1 +#define ENA_MAX_BACKOFF_DELAY_EXP 16U + #define ENA_MIN_ADMIN_POLL_US 100 @@ -540,6 +542,7 @@ static int ena_com_comp_status_to_errno(struct ena_com_admin_queue *admin_queue, static void ena_delay_exponential_backoff_us(u32 exp, u32 delay_us) { + exp = ENA_MIN32(ENA_MAX_BACKOFF_DELAY_EXP, exp); delay_us = ENA_MAX32(ENA_MIN_ADMIN_POLL_US, delay_us); - delay_us = ENA_MIN32(delay_us * (1U << exp), ENA_MAX_ADMIN_POLL_US); + delay_us = ENA_MIN32(ENA_MAX_ADMIN_POLL_US, delay_us * (1U << exp)); ENA_USLEEP(delay_us); } -- 2.44.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-04-04 10:49:33.979250354 +0100 +++ 0004-net-ena-base-limit-exponential-backoff.patch 2024-04-04 10:49:33.698457600 +0100 @@ -1 +1 @@ -From 4b378679c88ff231b97b71aaedc2d424e82f1aba Mon Sep 17 00:00:00 2001 +From cb98b1b26d3f886fdec0ca5fc0e2cdc471490c3d Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 4b378679c88ff231b97b71aaedc2d424e82f1aba ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index 6953a1fa33..31c37b0ab3 100644 +index 5ca36ab6d9..4bd85f29f5 100644 @@ -33 +34 @@ -@@ -546,6 +548,7 @@ static int ena_com_comp_status_to_errno(struct ena_com_admin_queue *admin_queue, +@@ -540,6 +542,7 @@ static int ena_com_comp_status_to_errno(struct ena_com_admin_queue *admin_queue,