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 36154A0C4C for ; Mon, 12 Jul 2021 15:13:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2BCA340685; Mon, 12 Jul 2021 15:13:07 +0200 (CEST) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mails.dpdk.org (Postfix) with ESMTP id 3D32240685 for ; Mon, 12 Jul 2021 15:13:05 +0200 (CEST) Received: by mail-wr1-f52.google.com with SMTP id g16so15660622wrw.5 for ; Mon, 12 Jul 2021 06:13:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jCydvL9cn9NkrcEYjBymR+gBwGc9wsBhLCVKpHAweBE=; b=kUKg8/3GpMhizlmy5lQ5CcbPlaWf0FqDLr5zEpV1fy3VpMSaAMgEupeY82OI7zk6nv NUAUkKKB28g5v5Qdmfz6w49cLRTR7FKRG8fu+gR9BK1pCEPoK2CLRj6EzR9X3Jjzuax0 czjJHO8TidGPAHAmHMU758bpGR2gluDHv2QJqewd5P1kcp4wZAr0AKsHQ0Q0TZuSmOhN Jz0/4x9p6xqbn6OKwm0SsxDIoXS6jkvVpNU4sBdICHkYKvdAvpIybgHHh4fb+CQnXlZf n41slMiREpaeWW/9wWPBzRaZp9v7v+wMQm5EFFQZO5mbhu8cFDfN/ig22gTqYqctxusC PPiA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=jCydvL9cn9NkrcEYjBymR+gBwGc9wsBhLCVKpHAweBE=; b=W+22T0L9P0BJfYOfbW0MyLwIuh4TQrq7k2YN15jNUmHhXJyNv8J4JZbV+x+yO6nAgg UMWHigZDMb1m7djgQrBTYHJWYMM6ZFtdw6PCcHiP3Avo5LgDqabC4HRtjS5os3ZQsZcG nBIB8DGgG7h9E+1eLRkce33K7DjoLwm0WAO3NBac3ZcHSK8QOmmYdkrwfjrcwtjDqGcy G1SVAExSIRx9wg4217VrWJwgbf1BGQkiHzbbW5ZuL8kc2ErLlK8FpjnhsgGlylSZYfLZ lHaDTNaY6Rbmz+ksBrrr8AWhZlhJ25BDeOLIXzqduQXhmhHrOyIfu/p99RlRQxx1/NnB 5kaw== X-Gm-Message-State: AOAM533XFht4OBGX9ZLVYLU/nXLzDMLuj1HYVzzRFFRMop2EcssSkSRl wN07nfV5hwvzBxfbq5OHnyA= X-Google-Smtp-Source: ABdhPJzYecc75Pl1Uwt763sIDgqBhINNQdBwOFVZfFkl/YRaL1JhlPEslttt+XVUcV6P1PXtbVooKQ== X-Received: by 2002:a5d:598d:: with SMTP id n13mr42511591wri.246.1626095585064; Mon, 12 Jul 2021 06:13:05 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id c7sm14235683wrs.23.2021.07.12.06.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:13:04 -0700 (PDT) From: luca.boccassi@gmail.com To: Pavan Nikhilesh Cc: dpdk stable Date: Mon, 12 Jul 2021 14:04:51 +0100 Message-Id: <20210712130551.2462159-56-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'mempool/octeontx2: fix shift calculation' has been queued to stable release 20.11.3 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" Hi, FYI, your patch has been queued to stable release 20.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/14/21. 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/7d1f406efb3819279e340e11de240ebb35cccc93 Thanks. Luca Boccassi --- >From 7d1f406efb3819279e340e11de240ebb35cccc93 Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Tue, 15 Jun 2021 00:54:24 +0530 Subject: [PATCH] mempool/octeontx2: fix shift calculation [ upstream commit 43d89404950bb4d8e0efbcaebf734a0a722c2dbb ] Shift is used to generate an 8-bit saturate value from the current aura used count. The shift value should be derived from the log2 of block count if it is greater than 256 else the shift should be 0. Fixes: 7bcc47cbe2fa ("mempool/octeontx2: add mempool alloc op") Signed-off-by: Pavan Nikhilesh --- drivers/mempool/octeontx2/otx2_mempool_ops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mempool/octeontx2/otx2_mempool_ops.c b/drivers/mempool/octeontx2/otx2_mempool_ops.c index 9ff71bcf6b..d827fd8c7b 100644 --- a/drivers/mempool/octeontx2/otx2_mempool_ops.c +++ b/drivers/mempool/octeontx2/otx2_mempool_ops.c @@ -611,7 +611,8 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size, /* Update aura fields */ aura->pool_addr = pool_id;/* AF will translate to associated poolctx */ aura->ena = 1; - aura->shift = __builtin_clz(block_count) - 8; + aura->shift = rte_log2_u32(block_count); + aura->shift = aura->shift < 8 ? 0 : aura->shift - 8; aura->limit = block_count; aura->pool_caching = 1; aura->err_int_ena = BIT(NPA_AURA_ERR_INT_AURA_ADD_OVER); @@ -626,7 +627,8 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size, pool->ena = 1; pool->buf_size = block_size / OTX2_ALIGN; pool->stack_max_pages = stack_size; - pool->shift = __builtin_clz(block_count) - 8; + pool->shift = rte_log2_u32(block_count); + pool->shift = pool->shift < 8 ? 0 : pool->shift - 8; pool->ptr_start = 0; pool->ptr_end = ~0; pool->stack_caching = 1; -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:39.565564333 +0100 +++ 0056-mempool-octeontx2-fix-shift-calculation.patch 2021-07-12 13:41:36.450121777 +0100 @@ -1 +1 @@ -From 43d89404950bb4d8e0efbcaebf734a0a722c2dbb Mon Sep 17 00:00:00 2001 +From 7d1f406efb3819279e340e11de240ebb35cccc93 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 43d89404950bb4d8e0efbcaebf734a0a722c2dbb ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org