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 A4C55A0350 for ; Mon, 21 Feb 2022 16:39:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9FDC64068C; Mon, 21 Feb 2022 16:39:45 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id CB43D40E5A for ; Mon, 21 Feb 2022 16:39:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645457983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7j8Ybc+a0XDGwS6sLX2JLLTyQ7QLRuxky1kez5xjk1Y=; b=cYTG82kUfdGLfnMWEBfruHxdup4dnA1Jb0zykgbtJdp0xSmjhoM9XW2iNSPwzMI7tZKssz 32Ut5jfHsjuPdCNVxI6o/V34/InQMFxQGa9hbK63qKhP8a+xYuP/BNBZExhojyhuRdxiSc 3KIbSaaWTsaFZalv3au7m3Y+aMC4WIM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-652-h_i2iQnzPT2_xjoHT5cHvg-1; Mon, 21 Feb 2022 10:39:39 -0500 X-MC-Unique: h_i2iQnzPT2_xjoHT5cHvg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C915A100C660; Mon, 21 Feb 2022 15:39:38 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FCE27B9D9; Mon, 21 Feb 2022 15:39:37 +0000 (UTC) From: Kevin Traynor To: Ajit Khaparde Cc: Kalesh AP , Somnath Kotur , dpdk stable Subject: patch 'net/bnxt: fix VF resource allocation strategy' has been queued to stable release 21.11.1 Date: Mon, 21 Feb 2022 15:34:47 +0000 Message-Id: <20220221153625.152324-98-ktraynor@redhat.com> In-Reply-To: <20220221153625.152324-1-ktraynor@redhat.com> References: <20220221153625.152324-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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 Hi, FYI, your patch has been queued to stable release 21.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/26/22. 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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/0f8f337740fb8d16c6566ac8d70761f786a6cf2e Thanks. Kevin --- >From 0f8f337740fb8d16c6566ac8d70761f786a6cf2e Mon Sep 17 00:00:00 2001 From: Ajit Khaparde Date: Thu, 20 Jan 2022 14:42:28 +0530 Subject: [PATCH] net/bnxt: fix VF resource allocation strategy [ upstream commit 8496483099104c970720ae7baf5ab61aaa4611c7 ] 1. VFs need a notification queue to handle async messages. But the current logic does not reserve a notification queue leading to initialization failure in some cases. 2. With the current logic, DPDK PF driver reserves only one VNIC to the VFs leading to initialization failure with more than 1 RXQs. Added logic to distribute number of NQs and VNICs from the pool across VFs and PF. While reserving resources for the VFs, the strategy is to keep both min & max values the same. This could result in a failure when there isn't enough resources to satisfy the request. Hence fixed to instruct the FW to not reserve all minimum resources requested for the VF. The VF driver can request the FW for the allocated resources during probe. Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF") Signed-off-by: Ajit Khaparde Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_hwrm.c | 32 +++++++++++++++++--------------- drivers/net/bnxt/bnxt_hwrm.h | 2 ++ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 5418fa1994..b4aeec593e 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -903,13 +903,5 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) if (!BNXT_CHIP_P5(bp) && !bp->pdev->max_vfs) bp->max_l2_ctx += bp->max_rx_em_flows; - /* TODO: For now, do not support VMDq/RFS on VFs. */ - if (BNXT_PF(bp)) { - if (bp->pf->max_vfs) - bp->max_vnics = 1; - else - bp->max_vnics = rte_le_to_cpu_16(resp->max_vnics); - } else { - bp->max_vnics = 1; - } + bp->max_vnics = rte_le_to_cpu_16(resp->max_vnics); PMD_DRV_LOG(DEBUG, "Max l2_cntxts is %d vnics is %d\n", bp->max_l2_ctx, bp->max_vnics); @@ -3496,5 +3488,5 @@ static int bnxt_hwrm_pf_func_cfg(struct bnxt *bp, } else if (BNXT_HAS_NQ(bp)) { enables |= HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MSIX; - req.num_msix = rte_cpu_to_le_16(bp->max_nq_rings); + req.num_msix = rte_cpu_to_le_16(pf_resc->num_nq_rings); } @@ -3509,5 +3501,5 @@ static int bnxt_hwrm_pf_func_cfg(struct bnxt *bp, req.num_rx_rings = rte_cpu_to_le_16(pf_resc->num_rx_rings); req.num_l2_ctxs = rte_cpu_to_le_16(pf_resc->num_l2_ctxs); - req.num_vnics = rte_cpu_to_le_16(bp->max_vnics); + req.num_vnics = rte_cpu_to_le_16(pf_resc->num_vnics); req.fid = rte_cpu_to_le_16(0xffff); req.enables = rte_cpu_to_le_32(enables); @@ -3546,12 +3538,10 @@ bnxt_fill_vf_func_cfg_req_new(struct bnxt *bp, req->max_l2_ctxs = rte_cpu_to_le_16(bp->max_l2_ctx / (num_vfs + 1)); req->min_l2_ctxs = req->max_l2_ctxs; - /* TODO: For now, do not support VMDq/RFS on VFs. */ - req->max_vnics = rte_cpu_to_le_16(1); + req->max_vnics = rte_cpu_to_le_16(bp->max_vnics / (num_vfs + 1)); req->min_vnics = req->max_vnics; req->max_hw_ring_grps = rte_cpu_to_le_16(bp->max_ring_grps / (num_vfs + 1)); req->min_hw_ring_grps = req->max_hw_ring_grps; - req->flags = - rte_cpu_to_le_16(HWRM_FUNC_VF_RESOURCE_CFG_INPUT_FLAGS_MIN_GUARANTEED); + req->max_msix = rte_cpu_to_le_16(bp->max_nq_rings / (num_vfs + 1)); } @@ -3613,4 +3603,6 @@ static int bnxt_update_max_resources(struct bnxt *bp, 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_nq_rings -= rte_le_to_cpu_16(resp->alloc_msix); + bp->max_vnics -= rte_le_to_cpu_16(resp->alloc_vnics); HWRM_UNLOCK(); @@ -3686,4 +3678,6 @@ static int bnxt_query_pf_resources(struct bnxt *bp, pf_resc->num_l2_ctxs = rte_le_to_cpu_16(resp->alloc_l2_ctx); pf_resc->num_hw_ring_grps = rte_le_to_cpu_32(resp->alloc_hw_ring_grps); + pf_resc->num_nq_rings = rte_le_to_cpu_32(resp->alloc_msix); + pf_resc->num_vnics = rte_le_to_cpu_16(resp->alloc_vnics); bp->pf->evb_mode = resp->evb_mode; @@ -3706,4 +3700,6 @@ bnxt_calculate_pf_resources(struct bnxt *bp, pf_resc->num_l2_ctxs = bp->max_l2_ctx; pf_resc->num_hw_ring_grps = bp->max_ring_grps; + pf_resc->num_nq_rings = bp->max_nq_rings; + pf_resc->num_vnics = bp->max_vnics; return; @@ -3724,4 +3720,8 @@ bnxt_calculate_pf_resources(struct bnxt *bp, pf_resc->num_hw_ring_grps = bp->max_ring_grps / (num_vfs + 1) + bp->max_ring_grps % (num_vfs + 1); + pf_resc->num_nq_rings = bp->max_nq_rings / (num_vfs + 1) + + bp->max_nq_rings % (num_vfs + 1); + pf_resc->num_vnics = bp->max_vnics / (num_vfs + 1) + + bp->max_vnics % (num_vfs + 1); } @@ -3899,4 +3899,6 @@ bnxt_update_pf_resources(struct bnxt *bp, bp->max_rx_rings = pf_resc->num_rx_rings; bp->max_ring_grps = pf_resc->num_hw_ring_grps; + bp->max_nq_rings = pf_resc->num_nq_rings; + bp->max_vnics = pf_resc->num_vnics; } diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h index 21e1b7a499..63f8d8ceab 100644 --- a/drivers/net/bnxt/bnxt_hwrm.h +++ b/drivers/net/bnxt/bnxt_hwrm.h @@ -115,4 +115,6 @@ struct bnxt_pf_resource_info { uint16_t num_cp_rings; uint16_t num_l2_ctxs; + uint16_t num_nq_rings; + uint16_t num_vnics; uint32_t num_hw_ring_grps; }; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-21 15:22:46.739463626 +0000 +++ 0098-net-bnxt-fix-VF-resource-allocation-strategy.patch 2022-02-21 15:22:44.198704367 +0000 @@ -1 +1 @@ -From 8496483099104c970720ae7baf5ab61aaa4611c7 Mon Sep 17 00:00:00 2001 +From 0f8f337740fb8d16c6566ac8d70761f786a6cf2e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 8496483099104c970720ae7baf5ab61aaa4611c7 ] + @@ -23 +24,0 @@ -Cc: stable@dpdk.org