From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E6EF3A00BE for ; Tue, 19 May 2020 15:16:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D70C71D96D; Tue, 19 May 2020 15:16:00 +0200 (CEST) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 286861D965 for ; Tue, 19 May 2020 15:16:00 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id v12so15810745wrp.12 for ; Tue, 19 May 2020 06:16:00 -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=49avNelQ+XXj3dFG5bIJAoXUc9tP97+5gLhCkuHqQUA=; b=V2pbVvSyozPPE1zic3aJP5W3oQMIuUlD14cvaModWRzS2fFP9fYJilFzUBfevzzK9A 2Spy/1o3GOid9aeE4vRO6a7iD/N7SxCZoovh5lyHRSHX9d29yH+mn5hzlqt8IHbKu+jL KABTnmDViPQDQoIu7y7SPfBQRzdgxqsvhKSaDz29ndGOVKjd6ijs2QqgwQx2IfpDhSaU XOKnFUJCzWBS7mI3Pi4tkfxaoeTOp/TFh5L1v9fVLxiY/vyvzJ2cAty7eKrvvDtDcT1w VcILj0IiUfYBJ0PEBFwTdecdhfmgashd62b6ffNlkAdFXmNyVF81i/iPLLPojB4b+W3/ VwjQ== 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=49avNelQ+XXj3dFG5bIJAoXUc9tP97+5gLhCkuHqQUA=; b=aS/tu2+nlbobV1xx+p+JZQirX9C1rLhRVyD+mj6pezvq/flGzApkwGwC7h44PI5UPK STKpNVhyO3pSvMqOPuITRG2KWHVNelc5EnSeFHfzeTxUdxpH4MKjFwNkm3dD8Pg5/6Yg jrkWy1uaDTXK2+Jqumfu7f5DxXl/d0qzQPD+Q+ChoiV8WRCi25Piw6R4lITVK0xDe7Fv yTl3azyo6B2ged/ueGUg4gLWzxmeMIYcvuM+JxMVxVhgCjvcvnSp1seQTaGYfoFguT7l Att1ZUXGBjdeGLTC6J2nSPcflC4X+DvE1hszkI51v1H9p3FNeFRna+0VKVfkImQfrrLP IRKw== X-Gm-Message-State: AOAM533SrSS17o6j3ye3PDqMGqA/xlsXZqkvqHeN/VN11edj5At4w48F jbaU2+rTChDU06FrFhc6efU= X-Google-Smtp-Source: ABdhPJxC3lImke+B5ukFq1CpcWgxpgWP6338BxfEbsPiMpShDnw7dzIkUhXCKq2ik/Gg8qS5wzu9Yw== X-Received: by 2002:a5d:5404:: with SMTP id g4mr25365619wrv.310.1589894159836; Tue, 19 May 2020 06:15:59 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id w20sm3867863wmk.25.2020.05.19.06.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:15:59 -0700 (PDT) From: luca.boccassi@gmail.com To: Kalesh AP Cc: Somnath Kotur , Ajit Khaparde , dpdk stable Date: Tue, 19 May 2020 14:05:29 +0100 Message-Id: <20200519130549.112823-194-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: fix TQM ring context memory size' has been queued to stable release 19.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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.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 05/21/20. 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. Thanks. Luca Boccassi --- >From abe65fce866a24fb36ccd2da847be7258b48370a Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Wed, 6 May 2020 11:57:10 +0530 Subject: [PATCH] net/bnxt: fix TQM ring context memory size [ upstream commit 2f8cc21f0943e1fde68b38e09f9bf238d0eb7811 ] The current formulas to calculate the TQM slow path and fast path ring context memory sizes are not quite correct. TQM slow path entry is array index 0 of ctx->tqm_mem[]. The other array entries are for fast path. Fix these sizes according to firmware spec. for 57500 and newer chips. Fixes: cc5e26b8ef98 ("net/bnxt: increase TQM entry allocation") Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 7a9c557b52..fe134108b6 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -4429,6 +4429,7 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp) struct bnxt_ctx_pg_info *ctx_pg; struct bnxt_ctx_mem_info *ctx; uint32_t mem_size, ena, entries; + uint32_t entries_sp, min; int i, rc; rc = bnxt_hwrm_func_backing_store_qcaps(bp); @@ -4476,15 +4477,20 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp) if (rc) return rc; - entries = ctx->qp_max_l2_entries + - ctx->vnic_max_vnic_entries + - ctx->tqm_min_entries_per_ring; + min = ctx->tqm_min_entries_per_ring; + + entries_sp = ctx->qp_max_l2_entries + + ctx->vnic_max_vnic_entries + + 2 * ctx->qp_min_qp1_entries + min; + entries_sp = bnxt_roundup(entries_sp, ctx->tqm_entries_multiple); + + entries = ctx->qp_max_l2_entries + ctx->qp_min_qp1_entries; entries = bnxt_roundup(entries, ctx->tqm_entries_multiple); - entries = clamp_t(uint32_t, entries, ctx->tqm_min_entries_per_ring, + entries = clamp_t(uint32_t, entries, min, ctx->tqm_max_entries_per_ring); for (i = 0, ena = 0; i < ctx->tqm_fp_rings_count + 1; i++) { ctx_pg = ctx->tqm_mem[i]; - ctx_pg->entries = entries; + ctx_pg->entries = i ? entries : entries_sp; mem_size = ctx->tqm_entry_size * ctx_pg->entries; rc = bnxt_alloc_ctx_mem_blk(bp, ctx_pg, mem_size, "tqm_mem", i); if (rc) -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:52.494717622 +0100 +++ 0194-net-bnxt-fix-TQM-ring-context-memory-size.patch 2020-05-19 14:04:44.552654463 +0100 @@ -1,8 +1,10 @@ -From 2f8cc21f0943e1fde68b38e09f9bf238d0eb7811 Mon Sep 17 00:00:00 2001 +From abe65fce866a24fb36ccd2da847be7258b48370a Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Wed, 6 May 2020 11:57:10 +0530 Subject: [PATCH] net/bnxt: fix TQM ring context memory size +[ upstream commit 2f8cc21f0943e1fde68b38e09f9bf238d0eb7811 ] + The current formulas to calculate the TQM slow path and fast path ring context memory sizes are not quite correct. TQM slow path entry is array index 0 of ctx->tqm_mem[]. The other array entries are for fast @@ -10,7 +12,6 @@ chips. Fixes: cc5e26b8ef98 ("net/bnxt: increase TQM entry allocation") -Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur @@ -20,10 +21,10 @@ 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c -index d877ff655d..dab291c7ce 100644 +index 7a9c557b52..fe134108b6 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c -@@ -4672,6 +4672,7 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp) +@@ -4429,6 +4429,7 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp) struct bnxt_ctx_pg_info *ctx_pg; struct bnxt_ctx_mem_info *ctx; uint32_t mem_size, ena, entries; @@ -31,7 +32,7 @@ int i, rc; rc = bnxt_hwrm_func_backing_store_qcaps(bp); -@@ -4719,15 +4720,20 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp) +@@ -4476,15 +4477,20 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp) if (rc) return rc;