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 B8350A0471 for ; Wed, 17 Jul 2019 12:43:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1B3EE1B9FA; Wed, 17 Jul 2019 12:42:13 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 77DED1B959; Wed, 17 Jul 2019 12:42:03 +0200 (CEST) Received: from nis-sj1-27.broadcom.com (nis-sj1-27.lvn.broadcom.net [10.75.144.136]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 434DA30C0A6; Wed, 17 Jul 2019 03:42:02 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 434DA30C0A6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1563360122; bh=AyxPNS6OTEw6KzR++BISRUVA41IcBbt3PjKcTT/dsPU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fAjAfedYdpf6Vh7qHr0BtxUHaokhs359cjoYkmN8GuG/7nyfD8zi9db+qL5ot6+I5 wI3xlCvtE1jtozEHIjN0qpNddMFQmjOxeOECiE4HJHvyuvbY4OT9sIDeZsxIdGRZsW /lsYKQ7mY64eGWqnMrB19LV5nncne1IyDPByTP68= Received: from C02VPB22HTD6.wifi.broadcom.net (c02vpb22htd6.wifi.broadcom.net [10.122.43.105]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id A4935AC0749; Wed, 17 Jul 2019 03:42:00 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, stable@dpdk.org, Kalesh Anakkur Purayil Date: Wed, 17 Jul 2019 16:11:32 +0530 Message-Id: <20190717104139.21155-9-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190717104139.21155-1-ajit.khaparde@broadcom.com> References: <0c1b327c-2c36-652f-c88d-cbca8f873c13@intel.com> <20190717104139.21155-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 08/15] net/bnxt: save the number of EM flow count X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Save the number of EM flow count returned by the FW in HWRM_FUNC_QCFG and use it to calculate the overall pool of L2 contexts supported by FW. Fixes: 6d8109bcb398 ("net/bnxt: check VF resources if resource manager is enabled") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde Reviewed-by: Kalesh Anakkur Purayil --- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_hwrm.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 45e7359b2..cd809b385 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -429,6 +429,7 @@ struct bnxt { uint16_t max_rx_rings; uint16_t max_nq_rings; uint16_t max_l2_ctx; + uint16_t max_rx_em_flows; uint16_t max_vnics; uint16_t max_stat_ctx; uint16_t first_vf_id; diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index b6f9ec0a0..84cda5e6c 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -589,8 +589,10 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) bp->max_cp_rings = rte_le_to_cpu_16(resp->max_cmpl_rings); bp->max_tx_rings = rte_le_to_cpu_16(resp->max_tx_rings); bp->max_rx_rings = rte_le_to_cpu_16(resp->max_rx_rings); - bp->max_l2_ctx = rte_le_to_cpu_16(resp->max_l2_ctxs); bp->first_vf_id = rte_le_to_cpu_16(resp->first_vf_id); + bp->max_rx_em_flows = rte_le_to_cpu_16(resp->max_rx_em_flows); + bp->max_l2_ctx = + rte_le_to_cpu_16(resp->max_l2_ctxs) + bp->max_rx_em_flows; /* TODO: For now, do not support VMDq/RFS on VFs. */ if (BNXT_PF(bp)) { if (bp->pf.max_vfs) @@ -796,7 +798,12 @@ int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp) bp->max_tx_rings = rte_le_to_cpu_16(resp->max_tx_rings); bp->max_rx_rings = rte_le_to_cpu_16(resp->max_rx_rings); bp->max_ring_grps = rte_le_to_cpu_32(resp->max_hw_ring_grps); - bp->max_l2_ctx = rte_le_to_cpu_16(resp->max_l2_ctxs); + /* func_resource_qcaps does not return max_rx_em_flows. + * So use the value provided by func_qcaps. + */ + bp->max_l2_ctx = + rte_le_to_cpu_16(resp->max_l2_ctxs) + + bp->max_rx_em_flows; bp->max_vnics = rte_le_to_cpu_16(resp->max_vnics); bp->max_stat_ctx = rte_le_to_cpu_16(resp->max_stat_ctx); } -- 2.20.1 (Apple Git-117)