Lines Matching refs:num_vfs
248 static int bnxt_set_vf_attr(struct bnxt *bp, int num_vfs) in bnxt_set_vf_attr() argument
253 for (i = 0; i < num_vfs; i++) { in bnxt_set_vf_attr()
261 static int bnxt_hwrm_func_vf_resource_free(struct bnxt *bp, int num_vfs) in bnxt_hwrm_func_vf_resource_free() argument
270 for (i = pf->first_vf_id; i < pf->first_vf_id + num_vfs; i++) { in bnxt_hwrm_func_vf_resource_free()
302 static int bnxt_alloc_vf_resources(struct bnxt *bp, int num_vfs) in bnxt_alloc_vf_resources() argument
307 bp->pf.vf = kcalloc(num_vfs, sizeof(struct bnxt_vf_info), GFP_KERNEL); in bnxt_alloc_vf_resources()
311 bnxt_set_vf_attr(bp, num_vfs); in bnxt_alloc_vf_resources()
313 size = num_vfs * BNXT_HWRM_REQ_MAX_SIZE; in bnxt_alloc_vf_resources()
327 for (j = 0; j < BNXT_HWRM_REQS_PER_PAGE && k < num_vfs; j++) { in bnxt_alloc_vf_resources()
366 static int bnxt_hwrm_func_cfg(struct bnxt *bp, int *num_vfs) in bnxt_hwrm_func_cfg() argument
382 vf_cp_rings = (vf_cp_rings - bp->cp_nr_rings) / *num_vfs; in bnxt_hwrm_func_cfg()
385 vf_stat_ctx = (bp->pf.max_stat_ctxs - bp->num_stat_ctxs) / *num_vfs; in bnxt_hwrm_func_cfg()
388 *num_vfs; in bnxt_hwrm_func_cfg()
391 *num_vfs; in bnxt_hwrm_func_cfg()
392 vf_tx_rings = (bp->pf.max_tx_rings - bp->tx_nr_rings) / *num_vfs; in bnxt_hwrm_func_cfg()
420 for (i = 0; i < *num_vfs; i++) { in bnxt_hwrm_func_cfg()
440 static int bnxt_sriov_enable(struct bnxt *bp, int *num_vfs) in bnxt_sriov_enable() argument
450 vfs_supported = *num_vfs; in bnxt_sriov_enable()
484 if (vfs_supported != *num_vfs) { in bnxt_sriov_enable()
486 *num_vfs, vfs_supported); in bnxt_sriov_enable()
487 *num_vfs = vfs_supported; in bnxt_sriov_enable()
490 rc = bnxt_alloc_vf_resources(bp, *num_vfs); in bnxt_sriov_enable()
495 rc = bnxt_hwrm_func_cfg(bp, num_vfs); in bnxt_sriov_enable()
504 rc = pci_enable_sriov(bp->pdev, *num_vfs); in bnxt_sriov_enable()
512 bnxt_hwrm_func_vf_resource_free(bp, *num_vfs); in bnxt_sriov_enable()
522 u16 num_vfs = pci_num_vf(bp->pdev); in bnxt_sriov_disable() local
524 if (!num_vfs) in bnxt_sriov_disable()
529 num_vfs); in bnxt_sriov_disable()
533 bnxt_hwrm_func_vf_resource_free(bp, num_vfs); in bnxt_sriov_disable()
543 int bnxt_sriov_configure(struct pci_dev *pdev, int num_vfs) in bnxt_sriov_configure() argument
564 num_vfs = 0; in bnxt_sriov_configure()
569 if (num_vfs && num_vfs == bp->pf.active_vfs) in bnxt_sriov_configure()
574 if (!num_vfs) in bnxt_sriov_configure()
577 bnxt_sriov_enable(bp, &num_vfs); in bnxt_sriov_configure()
583 return num_vfs; in bnxt_sriov_configure()