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 5DF71A0524 for ; Fri, 5 Feb 2021 12:22:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 583051606C7; Fri, 5 Feb 2021 12:22:03 +0100 (CET) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mails.dpdk.org (Postfix) with ESMTP id EE7EA1606C3 for ; Fri, 5 Feb 2021 12:22:01 +0100 (CET) Received: by mail-wr1-f43.google.com with SMTP id d16so7219632wro.11 for ; Fri, 05 Feb 2021 03:22:01 -0800 (PST) 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=LxZ0VZPZu1SJnim1sQVtfIv5VH4J0y5AZ7jpuZl1KMA=; b=S3/FtQ3X9zV01kxBeWhCc8xIA+iN1ZAAA9rEr+RIMQI5+htOCzaVvkaoFUDxWR0Hfp XwjN4gR52oC2/JZGz8CAJoxoWoxfMb286OPeBmLcDBvZAqSFBtSf1CtJsX7h+AQMh5F1 dEbu+yOLPCyhZO21CSdLvSCbA10ih9xXjojwJYGOhhMN+v9iUJuq3DTxwUA7wuS85Bc0 WL2MkWiVaxRXbcFBIQpytaH+IHQx3fACmte8yhiR0onuU7IzRt4qbuho3VuYlFx2OdMU hCIFJ+VYwOm2y8PNQV/JNsSpLxBlTqLjGLTtyc04yi3oJizVASoMEoD46GO+LW6TTPFp GRUQ== 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=LxZ0VZPZu1SJnim1sQVtfIv5VH4J0y5AZ7jpuZl1KMA=; b=tkD0iEGqzRVx86ZziEerSzX+ydvzGcTh3DD8jDsWkuuaLF6afbZlmMuGkGFkGKTUo6 DJJ5RDC9aWF2rqFMxfP3ZsYBFI7J1kVnZSl5BEU9xzajxE3iVH24chibghd+8cB/Qyqh wWd4kCtCNaLe6o8oKyAr+MFnjehmmHi5LtlDC4leq5QhVSZ8OuwAeuu0NQBZe94vbJYk kx5Z3nfWcDDl+67ISM1nB8HlmBRmiWF0ZGEAvZtpHiPWtLVj6xFbzV5UzTZ0Ig2TiN/O 7xei7NT2zNyyOjYHXRtoPzwV4+mukVs78cnF6QCaQENpb6Tzx+wGJClDwcuCmFCvi+lL S0uQ== X-Gm-Message-State: AOAM531xgTrLKSfqhyiiOaXVsjGlQsFvHh1MZFLSqb/AqiVgi3B7EsfE K6aDedhjbN2/7LIWGQZamnRmVDDEYfO76ncf X-Google-Smtp-Source: ABdhPJz38/UNac+x44d1PiPmkh7mnpVEUUW82+bwEc3HYMeovghjlVHDWIwox4DN2+Xxox5ffRShIw== X-Received: by 2002:adf:f8c8:: with SMTP id f8mr4536587wrq.132.1612524121795; Fri, 05 Feb 2021 03:22:01 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id h1sm11594072wrr.73.2021.02.05.03.22.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:22:01 -0800 (PST) From: luca.boccassi@gmail.com To: Somnath Kotur Cc: Venkat Duvvuru , Kalesh AP , Ajit Khaparde , dpdk stable Date: Fri, 5 Feb 2021 11:15:34 +0000 Message-Id: <20210205111920.1272063-48-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: fix PF resource query' has been queued to stable release 20.11.1 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.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/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/c1ea3726c6aba856be882fc6bf1c25708ed7810f Thanks. Luca Boccassi --- >From c1ea3726c6aba856be882fc6bf1c25708ed7810f Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Thu, 3 Dec 2020 12:08:47 +0530 Subject: [PATCH] net/bnxt: fix PF resource query [ upstream commit 70517a3a8f3598ab0f9cd441620296aa7f11c194 ] This cmd should be called by every driver after 'hwrm_func_cfg' to get the actual number of resources allocated by the HWRM. The values returned in the cmd are the max values for that PF. Also, now that the max values for the PF are computed in probe itself, no need to invoke FUNC_QCAPs or any other cmd in dev_configure_op() as that would just override the actual max values obtained above. Fixes: f8168ca0e690 ("net/bnxt: support thor controller") Signed-off-by: Somnath Kotur Reviewed-by: Venkat Duvvuru Reviewed-by: Kalesh AP Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 7 ------- drivers/net/bnxt/bnxt_hwrm.c | 36 +++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 9c1bf57494..2f08f2b2ba 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1071,13 +1071,6 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev) } pthread_mutex_unlock(&bp->def_cp_lock); - } else { - /* legacy driver needs to get updated values */ - rc = bnxt_hwrm_func_qcaps(bp); - if (rc) { - PMD_DRV_LOG(ERR, "hwrm func qcaps fail:%d\n", rc); - return rc; - } } /* Inherit new configurations */ diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index f64df1892e..75d97d6721 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -3456,6 +3456,35 @@ static int bnxt_update_max_resources(struct bnxt *bp, return 0; } +/* Update the PF resource values based on how many resources + * got allocated to it. + */ +static int bnxt_update_max_resources_pf_only(struct bnxt *bp) +{ + struct hwrm_func_qcfg_input req = {0}; + struct hwrm_func_qcfg_output *resp = bp->hwrm_cmd_resp_addr; + int rc; + + /* Get the actual allocated values now */ + HWRM_PREP(&req, HWRM_FUNC_QCFG, BNXT_USE_CHIMP_MB); + req.fid = rte_cpu_to_le_16(0xffff); + rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); + HWRM_CHECK_RESULT(); + + bp->max_rsscos_ctx = rte_le_to_cpu_16(resp->alloc_rsscos_ctx); + bp->max_stat_ctx = rte_le_to_cpu_16(resp->alloc_stat_ctx); + bp->max_cp_rings = rte_le_to_cpu_16(resp->alloc_cmpl_rings); + bp->max_tx_rings = rte_le_to_cpu_16(resp->alloc_tx_rings); + bp->max_rx_rings = rte_le_to_cpu_16(resp->alloc_rx_rings); + bp->max_l2_ctx = rte_le_to_cpu_16(resp->alloc_l2_ctx); + bp->max_ring_grps = rte_le_to_cpu_16(resp->alloc_hw_ring_grps); + bp->max_vnics = rte_le_to_cpu_16(resp->alloc_vnics); + + HWRM_UNLOCK(); + + return 0; +} + int bnxt_hwrm_func_qcfg_current_vf_vlan(struct bnxt *bp, int vf) { struct hwrm_func_qcfg_input req = {0}; @@ -3555,8 +3584,13 @@ int bnxt_hwrm_allocate_pf_only(struct bnxt *bp) HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE); bp->pf->func_cfg_flags |= HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE; + rc = bnxt_hwrm_pf_func_cfg(bp, &pf_resc); - rc = __bnxt_hwrm_func_qcaps(bp); + if (rc) + return rc; + + rc = bnxt_update_max_resources_pf_only(bp); + return rc; } -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:31.435082798 +0000 +++ 0048-net-bnxt-fix-PF-resource-query.patch 2021-02-05 11:18:28.738689817 +0000 @@ -1 +1 @@ -From 70517a3a8f3598ab0f9cd441620296aa7f11c194 Mon Sep 17 00:00:00 2001 +From c1ea3726c6aba856be882fc6bf1c25708ed7810f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 70517a3a8f3598ab0f9cd441620296aa7f11c194 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -27 +28 @@ -index bf89635776..21d9e26ca8 100644 +index 9c1bf57494..2f08f2b2ba 100644 @@ -45 +46 @@ -index cee2656c14..a3eb133c08 100644 +index f64df1892e..75d97d6721 100644