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 13942A0C47 for ; Tue, 10 Aug 2021 17:41:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E20D4114F; Tue, 10 Aug 2021 17:41:55 +0200 (CEST) Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) by mails.dpdk.org (Postfix) with ESMTP id 927584114F for ; Tue, 10 Aug 2021 17:41:54 +0200 (CEST) Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (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 smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPS id 700C93F047 for ; Tue, 10 Aug 2021 15:41:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628610114; bh=aOm+ag7E+/qJCqZBSUrWZwMRR8LliTBWW8MdcHh1hvg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NYF/gTxLfelkzAeOhV+4FRsfAudVvdqnDIXNJ75XCkYXFQdjuSkMOU5iXvBOf+yWI MVpr+iZX9CkrpHpgp8ACE4kzg+Ly6KxpibEwHfkbLgP7jmOQ5ryh1r/jkzUtDFvYpW XgTt+c8VP3WmvfndJ1UW3PP9IAdP5brnX6dWXKrF6oI2XBJ+xPcRoFmYOLzzfgpfZ+ x6WFLmD+L/H9e7OWhukA16BWY+KYnqQtDDfj5Zz5NljRBMvjYKBSdmjJAP3gl+gvkS ykUOt9ejuwV0r/BddFqA7zX2Hzk0ttAZxIWe8E2EPDMDYpzHwLOQlSGMopvRjsaOOn TkY3IErYNNGxw== Received: by mail-ej1-f70.google.com with SMTP id gg35-20020a17090689a3b0290580ff45a075so134194ejc.20 for ; Tue, 10 Aug 2021 08:41:54 -0700 (PDT) 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=aOm+ag7E+/qJCqZBSUrWZwMRR8LliTBWW8MdcHh1hvg=; b=sM1I9wA4LidxJ0mTdx4TiPycB4z5kdzNv5cKihASWx5iXoAzHBNgmTQFS1bTqN3zgc VTddO1cbU8PcBfJtmDQ4sxmp6KpdSg7I53XRtQV9GJYKnPYr9WyDCs2gNHHZKDi3s40K g5UHd7XlXKFEbz2Qo7I6HQgrI7JBYSz76sPkpQoH7x6qNyoHyRr1NrmJDZSIGLoe6NCK SS0mwDh9gNCCntXbytLuY+S6BLggEI2w2st3tQH3XcT2++kc9weM0U5aWfXyKzUd1YhC 4d2fzbZtVTRMFrzd29lCtHs4HzfJZiAoDN6a4fXKC7vYrjUeQOXsjKAg5wnsPB175XRT ruNw== X-Gm-Message-State: AOAM532o684Jrw0VUYaoTcxBPPz9506VrLYDp0WAi2Fnaw4dfbpGy82k PWQgG9btnDVMrGe/68MC7qJOEfTNK+3d+ADmfJ7arsT/ou4wcO6DaZ8QoLn0YW4QI3oqMtFOaV9 8o1dv/Dxdl8NssjU0zz1tqq2X X-Received: by 2002:aa7:d815:: with SMTP id v21mr5617032edq.262.1628610113974; Tue, 10 Aug 2021 08:41:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJychEWfFARJy8tmBNrrTaIbLClehdnGlNNWcRWE3MA4fTSviD8oKmX7PFxcnQXy+gjpdb8v+Q== X-Received: by 2002:aa7:d815:: with SMTP id v21mr5617019edq.262.1628610113813; Tue, 10 Aug 2021 08:41:53 -0700 (PDT) Received: from Keschdeichel.fritz.box ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id f20sm6969858ejz.30.2021.08.10.08.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 08:41:53 -0700 (PDT) From: christian.ehrhardt@canonical.com To: Pavan Nikhilesh Cc: dpdk stable Date: Tue, 10 Aug 2021 17:39:08 +0200 Message-Id: <20210810154022.749358-28-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810154022.749358-1-christian.ehrhardt@canonical.com> References: <20210810154022.749358-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'mempool/octeontx2: fix shift calculation' has been queued to stable release 19.11.10 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 19.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/12/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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/004151c375ffd9c6f422d593e35932e083013d8b Thanks. Christian Ehrhardt --- >From 004151c375ffd9c6f422d593e35932e083013d8b 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 18bdb0b4c4..f4d50c29ca 100644 --- a/drivers/mempool/octeontx2/otx2_mempool_ops.c +++ b/drivers/mempool/octeontx2/otx2_mempool_ops.c @@ -533,7 +533,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); @@ -548,7 +549,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.32.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-08-10 15:11:14.151849489 +0200 +++ 0028-mempool-octeontx2-fix-shift-calculation.patch 2021-08-10 15:11:12.942637551 +0200 @@ -1 +1 @@ -From 43d89404950bb4d8e0efbcaebf734a0a722c2dbb Mon Sep 17 00:00:00 2001 +From 004151c375ffd9c6f422d593e35932e083013d8b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 43d89404950bb4d8e0efbcaebf734a0a722c2dbb ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ -index 9ff71bcf6b..d827fd8c7b 100644 +index 18bdb0b4c4..f4d50c29ca 100644 @@ -22 +23 @@ -@@ -611,7 +611,8 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size, +@@ -533,7 +533,8 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size, @@ -32 +33 @@ -@@ -626,7 +627,8 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size, +@@ -548,7 +549,8 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size,