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 70E1143CE8 for ; Mon, 18 Mar 2024 16:39:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6029540696; Mon, 18 Mar 2024 16:39:51 +0100 (CET) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mails.dpdk.org (Postfix) with ESMTP id 11F9940289 for ; Mon, 18 Mar 2024 16:39:50 +0100 (CET) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-41412411622so6527515e9.2 for ; Mon, 18 Mar 2024 08:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710776390; x=1711381190; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ug9SP22xFMkn2ldZvSohMaph9ejrKHmcQ/kCXGrKqqc=; b=f+LgZ9mbblMVDLzIHQf73PrTou0Xv2w/2z08AuFxGmX6zR74smrbW+dWUkTqy3B/8x OelWmR4z9j8iq+d6d4HEycAvyfGVVszsDnxpiBlH4OO9Bl4kXNoeax+bBRTdhMf/UW1V h8MHmcnNlLM7GwLnaQ4Nt/fS2yOsStbm6rhcIdta1oLKXr7BsOA5sr4pfHm1Ust5J0R5 d7DPGaYLQ9Tm9gNOlhb5ccBZL2IH2B5cqJ0X/nVCvD+ZHwxYUEnpdMY6opeEhpvCofnU K0HiF9BV5sxkenG6yXVXGOfInTpAfR2lhDiRZyC+5u+meYKrkHrO+H406PB7oHS5CdbG C7cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710776390; x=1711381190; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ug9SP22xFMkn2ldZvSohMaph9ejrKHmcQ/kCXGrKqqc=; b=oFyAfd8nOQMlKPlrLsm0HaNgns4jcj9ix4RGcAaUXF0P8jD4iW+fplZ9VgPe8Tu46T 3/NwHN3WUnfgp4Cq+dXGC/7hDDS433iuaclv2spF8c0YJQZUksYDzgPmcU8mydFjrZl/ YyYr9cpRFibNebIjs+REXoWs9H6WAZpurIHMNpwxNPKKOBaQm8MGpn7+kPB6Hx9bpaID TEvgkwlhzj/XOPpTe1fwCvn62UGLGpYMKIeJ8BG7Qy1Gsl45GvGwrc2s5MaCzfvPxfaS S0qdrv+I+LWP4fDcvNvAHCRk/kTs96OklJF+areHyMFaeNGIG/suI6oc66uE/bBN8pdQ w0xQ== X-Forwarded-Encrypted: i=1; AJvYcCVijnx+ba5ATCH9+Dw1r15aeHTpP/SHbLD6yxgzCtyt5nOnoOrgo9wmd+dkZj1ByefcBGYO8biMr1IDHHb4cPU= X-Gm-Message-State: AOJu0YxOIpMJoo1zEvO1AwReFq9A2CZCHtUPMf2iCeXWgGcwoG3XnTwG ODe3bFOSqp+N98ERLruJgF8O6gcL7aXoz0HMU+zjrLPGjERkE/Nf X-Google-Smtp-Source: AGHT+IFZEc6OiMZeW2caxGVYP8XP4temLTK4iBvdZ1Ahjmh3EJLf+bBDKn323a9kMUI4t72+Kkll6A== X-Received: by 2002:a5d:6da9:0:b0:341:72b8:83c9 with SMTP id u9-20020a5d6da9000000b0034172b883c9mr2551167wrs.70.1710776389583; Mon, 18 Mar 2024 08:39:49 -0700 (PDT) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id bk28-20020a0560001d9c00b0033e22a7b3f8sm5115178wrb.75.2024.03.18.08.39.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 08:39:49 -0700 (PDT) From: luca.boccassi@gmail.com To: Shai Brandes Cc: Amit Bernstein , dpdk stable Subject: patch 'net/ena/base: limit exponential backoff' has been queued to stable release 22.11.5 Date: Mon, 18 Mar 2024 15:38:58 +0000 Message-Id: <20240318153919.3407921-8-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240318153919.3407921-1-luca.boccassi@gmail.com> References: <20240314000957.2810803-61-luca.boccassi@gmail.com> <20240318153919.3407921-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 22.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/20/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/ad7591896c099491de3ce181e6c3483a74366cc5 Thanks. Luca Boccassi --- >From ad7591896c099491de3ce181e6c3483a74366cc5 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 @@ -34,6 +34,8 @@ #define ENA_REGS_ADMIN_INTR_MASK 1 +#define ENA_MAX_BACKOFF_DELAY_EXP 16U + #define ENA_MIN_ADMIN_POLL_US 100 #define ENA_MAX_ADMIN_POLL_US 5000 @@ -539,8 +541,9 @@ 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.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-18 12:58:39.600158129 +0000 +++ 0008-net-ena-base-limit-exponential-backoff.patch 2024-03-18 12:58:39.107344557 +0000 @@ -1 +1 @@ -From 4b378679c88ff231b97b71aaedc2d424e82f1aba Mon Sep 17 00:00:00 2001 +From ad7591896c099491de3ce181e6c3483a74366cc5 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 @@ -35 +36 @@ -@@ -545,8 +547,9 @@ static int ena_com_comp_status_to_errno(struct ena_com_admin_queue *admin_queue, +@@ -539,8 +541,9 @@ static int ena_com_comp_status_to_errno(struct ena_com_admin_queue *admin_queue,