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 37BDAA2EDB for ; Wed, 2 Oct 2019 07:55:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B3B451BEA6; Wed, 2 Oct 2019 07:54:46 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (unknown [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 67F0C397D for ; Wed, 2 Oct 2019 07:54:31 +0200 (CEST) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id B4D8930D4E0; Tue, 1 Oct 2019 22:53:18 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com B4D8930D4E0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1569995598; bh=fAazGy8E9jCGV/b3DfwekvEx6RoACmuYnP4IzXSYEhw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E6SUKXaDjkMHLjPQEHgzCpPRHR/GpciLa7M2jFaPgOb8E8+ztPi1GJDlYhPz43+2k 8MyDmZ8Ls9etFVXj4MKE5gq1UyG2QvzrQe3ihMAMt4EgylWXf07Xf5WL76y2LCsi4U lL7lTfwX6S7vP1NyxiYEtmVyUz6HwP83j0xc+QdQ= Received: from localhost.localdomain (unknown [10.230.30.225]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id C1826140069; Tue, 1 Oct 2019 22:54:28 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Kalesh AP , Somnath Kotur , Lance Richardson Date: Tue, 1 Oct 2019 22:54:13 -0700 Message-Id: <20191002055423.99659-8-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20191002055423.99659-1-ajit.khaparde@broadcom.com> References: <20191002055423.99659-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 07/17] net/bnxt: fix L2 context calculation for Thor 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" From: Kalesh AP On Wh+, number of L2 context supported by FW is the sum of number of EM flow count and number of L2 context count returned in HWRM_FUNC_QCFG. This is not true for Thor. Restrict this only for Whitney for now. Fixes: ff9c0ca47e81176 ("net/bnxt: save the number of EM flow count") Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Lance Richardson Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 6e95acb89e..d0f4054412 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -611,8 +611,9 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) bp->max_rx_rings = rte_le_to_cpu_16(resp->max_rx_rings); 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; + bp->max_l2_ctx = rte_le_to_cpu_16(resp->max_l2_ctxs); + if (!BNXT_CHIP_THOR(bp)) + 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) @@ -858,9 +859,9 @@ int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp) /* 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_l2_ctx = rte_le_to_cpu_16(resp->max_l2_ctxs); + if (!BNXT_CHIP_THOR(bp)) + bp->max_l2_ctx += 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)