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 2690441E87; Mon, 13 Mar 2023 21:01:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 085C440E03; Mon, 13 Mar 2023 21:01:58 +0100 (CET) Received: from rcdn-iport-4.cisco.com (rcdn-iport-4.cisco.com [173.37.86.75]) by mails.dpdk.org (Postfix) with ESMTP id 72B58406BC for ; Mon, 13 Mar 2023 21:01:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2704; q=dns/txt; s=iport; t=1678737716; x=1679947316; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=wW3La97dzVOvO0Puqv1umfi1zKkNrpMHW4tc0PGvZ3M=; b=DJOLE84dow2Oi+l3KDeSqoi5wgluuNZXBCdgNdGLEYaUd0YckNWrwYiY VIz77zKGK5gNRyPeWjeIOmfL2eb7sEhQzD7ecwRSY9DY8skx0gtoStevG zfLLMXJprs8ylCbAsGGTEcfpgjVB8B4X1Nz3vhY9cHVqeU+4RzsPTxefF k=; X-IronPort-AV: E=Sophos;i="5.98,257,1673913600"; d="scan'208";a="31855207" Received: from alln-core-9.cisco.com ([173.36.13.129]) by rcdn-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 13 Mar 2023 20:01:55 +0000 Received: from eng-rtp-bld-26.cisco.com (eng-rtp-bld-26.cisco.com [172.18.47.56]) by alln-core-9.cisco.com (8.15.2/8.15.2) with ESMTPS id 32DK1tf9016095 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 13 Mar 2023 20:01:55 GMT Received: by eng-rtp-bld-26.cisco.com (Postfix, from userid 191327) id C467F13EF182; Mon, 13 Mar 2023 16:01:54 -0400 (EDT) From: Dave Johnson To: ajit.khaparde@broadcom.com, somnath.kotur@broadcom.com Cc: dev@dpdk.org, Dave Johnson Subject: [PATCH] net/bnxt: limit max_vnics for CoS classification Date: Mon, 13 Mar 2023 16:00:40 -0400 Message-Id: <20230313200040.139415-1-davejo@cisco.com> X-Mailer: git-send-email 2.35.6 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Outbound-SMTP-Client: 172.18.47.56, eng-rtp-bld-26.cisco.com X-Outbound-Node: alln-core-9.cisco.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When using CoS classification the number of vnics is capped to avoid unnecessary memzone allocations. Signed-off-by: Dave Johnson --- .mailmap | 1 + drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_hwrm.c | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index 4018f0fc47..ae52428557 100644 --- a/.mailmap +++ b/.mailmap @@ -271,6 +271,7 @@ Dariusz Stojaczyk Darren Edamura Dave Burley Dave Ertman +Dave Johnson David Binderman David Bouyeure David Christensen diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index f6eaaeb470..48bd8f2418 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -811,6 +811,7 @@ struct bnxt { uint16_t max_l2_ctx; uint16_t max_rx_em_flows; uint16_t max_vnics; +#define BNXT_MAX_VNICS_COS_CLASSIFY 8 uint16_t max_stat_ctx; uint16_t max_tpa_v2; uint16_t first_vf_id; diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 51e1e2d6b3..d86ac73293 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -902,7 +902,10 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) bp->max_l2_ctx = rte_le_to_cpu_16(resp->max_l2_ctxs); if (!BNXT_CHIP_P5(bp) && !bp->pdev->max_vfs) bp->max_l2_ctx += bp->max_rx_em_flows; - bp->max_vnics = rte_le_to_cpu_16(resp->max_vnics); + if (bp->vnic_cap_flags & BNXT_VNIC_CAP_COS_CLASSIFY) + bp->max_vnics = rte_le_to_cpu_16(BNXT_MAX_VNICS_COS_CLASSIFY); + else + 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); bp->max_stat_ctx = rte_le_to_cpu_16(resp->max_stat_ctx); @@ -1211,7 +1214,10 @@ int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp) bp->max_l2_ctx = rte_le_to_cpu_16(resp->max_l2_ctxs); if (!BNXT_CHIP_P5(bp) && !bp->pdev->max_vfs) bp->max_l2_ctx += bp->max_rx_em_flows; - bp->max_vnics = rte_le_to_cpu_16(resp->max_vnics); + if (bp->vnic_cap_flags & BNXT_VNIC_CAP_COS_CLASSIFY) + bp->max_vnics = rte_le_to_cpu_16(BNXT_MAX_VNICS_COS_CLASSIFY); + else + bp->max_vnics = rte_le_to_cpu_16(resp->max_vnics); bp->max_stat_ctx = rte_le_to_cpu_16(resp->max_stat_ctx); bp->max_nq_rings = rte_le_to_cpu_16(resp->max_msix); bp->vf_resv_strategy = rte_le_to_cpu_16(resp->vf_reservation_strategy); -- 2.35.6