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 AE9E4A0A0E for ; Wed, 3 Feb 2021 10:01:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0E3E240474; Wed, 3 Feb 2021 10:01:52 +0100 (CET) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mails.dpdk.org (Postfix) with ESMTP id B11CF240477 for ; Wed, 3 Feb 2021 10:01:51 +0100 (CET) Received: by mail-wr1-f44.google.com with SMTP id u14so1377102wri.3 for ; Wed, 03 Feb 2021 01:01:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=A0nQKAFA3eGDnG0hwMMhZ8AE0Z4U0UD5dW8xwQoq5Uk=; b=PovVwIl9EmaMe6Erq3Y6AWyQWsjSyhCWHBmshJhqkFqjGrD84DTtCxjsRWgn/P3FL7 C6bzI+TpPOGyONlWp5c+5A+flKPsJMwT1/vzRZybHuPKrPewqm9CQ0NqJQlu9uwT6TdB 3OlC34SlxbSw2ceDUwurU2Os8lMyq81RlYHBrzQurQcnlLUhox4jc2XOU4Z+bLHlNJWQ 35eQSFl+Oe5TgPzAMKUuKgjmmpIP81zz5cmdWVTI3d2TeVuCQbRmusCQrf55DKaT3gyc 0BYW7tTv/c3+0GHyXB1K+T/2yrGBliabsMpidVztkFe6SlWwBbCe0SabVgiplqe85jX8 E9+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=A0nQKAFA3eGDnG0hwMMhZ8AE0Z4U0UD5dW8xwQoq5Uk=; b=SJpKzAYIT0tTFqh5RhthFUzLHvcrSJRprK4VINRkFaKv+kjyw4KrQqWoBC3F6nYcW6 N4Zu+XBVMr6QpfjbdK3bE0KF4BJLZ8peiV5EpVcmQ/Ok4kG8h+0lUPDqxf1bXHrIe2t2 wWx1dOFDKjv/2AzAxnsfgKeGEOV1DVHZNzmdbrEhmXhGGSAcSUeK6DfTv62mWMtNNcTc EnmWhTzB0J9YgncK0V2BYtVuoFR3rFGZPt4hlvC+AJPlqMBsjH8omfM4kSxGUPIWgpCs qloPP9esTOvz5lI5RQIRH5pR5palXdpFwZ3CW1EG+G9Jd/RHSCjux0L86qPdFQU089gJ DY6Q== X-Gm-Message-State: AOAM530NAqX6lVBuFYn3NY0vX1l7VVVXGGcx5ziIR4V+vtT/MpA3zgnp 3eMmcRl3H6DYvyVLvdLixi/0tQ== X-Google-Smtp-Source: ABdhPJx0fIUxSD+u8sk6hRhDNtK3Op/5eut7B4YQFJ/mCoM4KIxjMCairtXbqX5Omy42b807bZH74Q== X-Received: by 2002:a05:6000:1105:: with SMTP id z5mr2258552wrw.15.1612342911425; Wed, 03 Feb 2021 01:01:51 -0800 (PST) Received: from gojira.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id q63sm1859244wma.43.2021.02.03.01.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 01:01:50 -0800 (PST) From: Olivier Matz To: dev@dpdk.org Cc: Andrew Rybchenko , stable@dpdk.org Date: Wed, 3 Feb 2021 10:01:01 +0100 Message-Id: <20210203090101.5669-1-olivier.matz@6wind.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] mempool: fix invalid panic on dump or audit 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 Sender: "stable" When doing a mempool dump or an audit, the application can panic because the length of the cache is greater than the flush threshold, which is seen as a fatal error. But this can temporarily happen when the mempool is in use. Fix the panic condition to abort only when the cache length is greater than the array. Fixes: ea5dd2744b90 ("mempool: cache optimisations") Cc: stable@dpdk.org Signed-off-by: Olivier Matz --- lib/librte_mempool/rte_mempool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index b9f3fbd614..afb1239c8d 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -1167,7 +1167,7 @@ mempool_audit_cache(const struct rte_mempool *mp) for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { const struct rte_mempool_cache *cache; cache = &mp->local_cache[lcore_id]; - if (cache->len > cache->flushthresh) { + if (cache->len > RTE_DIM(cache->objs)) { RTE_LOG(CRIT, MEMPOOL, "badness on cache[%u]\n", lcore_id); rte_panic("MEMPOOL: invalid cache len\n"); -- 2.29.2