|
@@ -451,7 +451,7 @@ static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, int num_vfs)
|
|
|
|
|
|
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_VF_RESOURCE_CFG, -1, -1);
|
|
|
|
|
|
- vf_cp_rings = hw_resc->max_cp_rings - bp->cp_nr_rings;
|
|
|
+ vf_cp_rings = bnxt_get_max_func_cp_rings_for_en(bp) - bp->cp_nr_rings;
|
|
|
vf_stat_ctx = hw_resc->max_stat_ctxs - bp->num_stat_ctxs;
|
|
|
if (bp->flags & BNXT_FLAG_AGG_RINGS)
|
|
|
vf_rx_rings = hw_resc->max_rx_rings - bp->rx_nr_rings * 2;
|
|
@@ -549,7 +549,8 @@ static int bnxt_hwrm_func_cfg(struct bnxt *bp, int num_vfs)
|
|
|
max_stat_ctxs = hw_resc->max_stat_ctxs;
|
|
|
|
|
|
/* Remaining rings are distributed equally amongs VF's for now */
|
|
|
- vf_cp_rings = (hw_resc->max_cp_rings - bp->cp_nr_rings) / num_vfs;
|
|
|
+ vf_cp_rings = (bnxt_get_max_func_cp_rings_for_en(bp) -
|
|
|
+ bp->cp_nr_rings) / num_vfs;
|
|
|
vf_stat_ctx = (max_stat_ctxs - bp->num_stat_ctxs) / num_vfs;
|
|
|
if (bp->flags & BNXT_FLAG_AGG_RINGS)
|
|
|
vf_rx_rings = (hw_resc->max_rx_rings - bp->rx_nr_rings * 2) /
|
|
@@ -643,7 +644,7 @@ static int bnxt_sriov_enable(struct bnxt *bp, int *num_vfs)
|
|
|
*/
|
|
|
vfs_supported = *num_vfs;
|
|
|
|
|
|
- avail_cp = hw_resc->max_cp_rings - bp->cp_nr_rings;
|
|
|
+ avail_cp = bnxt_get_max_func_cp_rings_for_en(bp) - bp->cp_nr_rings;
|
|
|
avail_stat = hw_resc->max_stat_ctxs - bp->num_stat_ctxs;
|
|
|
avail_cp = min_t(int, avail_cp, avail_stat);
|
|
|
|