[07/15] net/bnxt: fix L2 context calculation for Thor

Message ID 20190901221213.92149-8-ajit.khaparde@broadcom.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers
Series bnxt patchset |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply issues

Commit Message

Ajit Khaparde Sept. 1, 2019, 10:12 p.m. UTC
  From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

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 <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
  

Patch

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index c62da60f0..13aa4de24 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -601,8 +601,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);
 	}