net/bnxt: limit max_vnics for CoS classification
PATCH 1/1 net/bnxt: limit max_vnics for CoS classification
When using CoS classification the number of vnics is capped to avoid unnecessary memzone allocations.
Signed-off-by Dave Johnson <[email protected]>
--- .mailmap | 1 + drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_hwrm.c | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-)
.mailmap +1 -0
@@ -271,6 +271,7 @@ Dariusz Stojaczyk <[email protected]> Darren Edamura <[email protected]> Dave Burley <[email protected]> Dave Ertman <[email protected]> +Dave Johnson <[email protected]> David Binderman <[email protected]> David Bouyeure <[email protected]> David Christensen <[email protected]> <[email protected]>
drivers/net/bnxt/bnxt.h +1 -0
@@ -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 8uint16_t max_stat_ctx;uint16_t max_tpa_v2;uint16_t first_vf_id;
drivers/net/bnxt/bnxt_hwrm.c +8 -2
@@ -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);
Signature · 1 line
2.35.6
Quoted 5 lines · Dave Johnson
When using CoS classification the number of vnics is capped to avoid unnecessary memzone allocations.
Signed-off-by Dave Johnson <[email protected]>
Acked-by Ajit Khaparde <[email protected]>
Patch merged to dpdk-next-net-brcm. Thanks
Quoted 61 lines
--- .mailmap | 1 + drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_hwrm.c | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-).mailmap +1
-0@@ -271,6 +271,7 @@ Dariusz Stojaczyk <[email protected]> Darren Edamura <[email protected]> Dave Burley <[email protected]> Dave Ertman <[email protected]> +Dave Johnson <[email protected]> David Binderman <[email protected]> David Bouyeure <[email protected]> David Christensen <[email protected]> <[email protected]>drivers/net/bnxt/bnxt.h +1
-0@@ -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 8uint16_t max_stat_ctx;uint16_t max_tpa_v2;uint16_t first_vf_id;drivers/net/bnxt/bnxt_hwrm.c +8
-3@@ -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