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 77C04A09E9 for ; Tue, 8 Dec 2020 21:12:35 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A4EF7CA3A; Tue, 8 Dec 2020 21:12:07 +0100 (CET) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by dpdk.org (Postfix) with ESMTP id 28F79CA04 for ; Tue, 8 Dec 2020 21:11:59 +0100 (CET) Received: by mail-pl1-f194.google.com with SMTP id x15so7558056pll.2 for ; Tue, 08 Dec 2020 12:11:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=9gV6AVc4aKzkhcjNoDX51h/36EKsxMMEY3etFAMHK4Q=; b=S9PatmRrEnlqOFuHxsDavT+5NlP2lOK9roOwzeEXxeE+Hzku7/27PL/Hg9vZfVRVJ/ rqGcQWHitCJlthaJvsbXRoAkab2WVu1yJbHltGRe7mFp5kL8mFyDCJoMEYyLcm8oPSL8 uqKHIo/g+jf3Vihtbz5iBNBFNqNUGe6WHVmBo= 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; bh=9gV6AVc4aKzkhcjNoDX51h/36EKsxMMEY3etFAMHK4Q=; b=NOf1GIhRA8WiAhtdKUTpCfL8mOyMFSuO0qmKZsRufzcFl0PqC4FWtwyAb+vooJw74M m2TDN2l0OXssE1T2vNMOm+StEc7bfgIzuHcprFaOhBY5QOFEVqjBn+gTR0CPpvW2szYD 7k3nhAAgxpjrzqrXF9BPpzx2Xawdt1wPJ2z7tBOqCeuWN2NSmKbx2+P420PQ/Ewq5Ku4 ZZNWGME8PAV/21X9aZoAh+CfejZQostEt6KeO2aE3Cqs7QMgmxHzrmSmuERRe/9elHa0 D2VYTWY4dPt9ujkDeUMyDCurQFLoAlZSX50Vem3MSfKeBkfZO9/Z/zTAUJI+/62A2nWs p8vQ== X-Gm-Message-State: AOAM532QomYiknWPbIFADMWARiR0tPpUIbUTEF+DZiNLVTrU6z6qfgmq 2d/TMq8Ua05AY+xcviRbsBr88THShYZXfaJKbEQwKU9Hrq5iFgJfnpk0JiUhsETssI0UHLblN2g 8Q7/Dj8sJ X-Google-Smtp-Source: ABdhPJxa2geOLFB488axy96Tnm4hWsYKXbaVF2fM36zruW5ovpR7J9r438PWwOlWRVwWm2FO61TC3Q== X-Received: by 2002:a17:902:b08a:b029:d9:eca:7d38 with SMTP id p10-20020a170902b08ab02900d90eca7d38mr22670627plr.72.1607458318329; Tue, 08 Dec 2020 12:11:58 -0800 (PST) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x10sm5729187pfc.157.2020.12.08.12.11.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2020 12:11:57 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: Somnath Kotur , stable@dpdk.org, Venkat Duvvuru , Kalesh AP Date: Tue, 8 Dec 2020 12:11:31 -0800 Message-Id: <20201208201134.47844-15-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20201208201134.47844-1-ajit.khaparde@broadcom.com> References: <20201208201134.47844-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-stable] [PATCH 14/17] net/bnxt: fix PF resource query 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" From: Somnath Kotur 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") Cc: stable@dpdk.org 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 bf8963577..21d9e26ca 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 cee2656c1..a3eb133c0 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.21.1 (Apple Git-122.3) -- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.