/openbmc/linux/drivers/crypto/cavium/nitrox/ |
H A D | nitrox_sriov.c | 15 static inline bool num_vfs_valid(int num_vfs) in num_vfs_valid() argument 19 switch (num_vfs) { in num_vfs_valid() 35 switch (num_vfs) { in num_vfs_to_mode() 158 if (!num_vfs_valid(num_vfs)) { in nitrox_sriov_enable() 163 if (pci_num_vf(pdev) == num_vfs) in nitrox_sriov_enable() 164 return num_vfs; in nitrox_sriov_enable() 174 ndev->iov.num_vfs = num_vfs; in nitrox_sriov_enable() 188 return num_vfs; in nitrox_sriov_enable() 194 ndev->iov.num_vfs = 0; in nitrox_sriov_enable() 216 ndev->iov.num_vfs = 0; in nitrox_sriov_disable() [all …]
|
H A D | nitrox_isr.h | 13 int nitrox_sriov_configure(struct pci_dev *pdev, int num_vfs); 15 static inline int nitrox_sriov_configure(struct pci_dev *pdev, int num_vfs) in nitrox_sriov_configure() argument
|
/openbmc/linux/drivers/crypto/marvell/octeontx2/ |
H A D | otx2_cptpf_main.c | 19 int num_vfs) in cptpf_enable_vfpf_mbox_intr() argument 35 if (num_vfs > 64) { in cptpf_enable_vfpf_mbox_intr() 45 int num_vfs) in cptpf_disable_vfpf_mbox_intr() argument 61 if (num_vfs > 64) { in cptpf_disable_vfpf_mbox_intr() 70 int num_vfs) in cptpf_enable_vf_flr_me_intrs() argument 86 if (num_vfs <= 64) in cptpf_enable_vf_flr_me_intrs() 117 if (num_vfs <= 64) in cptpf_disable_vf_flr_me_intrs() 272 if (num_vfs > 64) { in cptpf_register_vfpf_intr() 388 num_vfs); in cptpf_vfpf_mbox_init() 673 if (!num_vfs) in cptpf_sriov_disable() [all …]
|
/openbmc/linux/drivers/net/ethernet/mellanox/mlx5/core/ |
H A D | sriov.c | 86 for (vf = 0; vf < num_vfs; vf++) { in mlx5_device_enable_sriov() 134 for (vf = num_vfs - 1; vf >= 0; vf--) { in mlx5_device_disable_sriov() 186 err = mlx5_device_enable_sriov(dev, num_vfs); in mlx5_sriov_enable() 193 err = pci_enable_sriov(pdev, num_vfs); in mlx5_sriov_enable() 205 int num_vfs = pci_num_vf(dev->pdev); in mlx5_sriov_disable() local 221 if (num_vfs) in mlx5_core_sriov_configure() 222 err = mlx5_sriov_enable(pdev, num_vfs); in mlx5_core_sriov_configure() 227 sriov->num_vfs = num_vfs; in mlx5_core_sriov_configure() 228 return err ? err : num_vfs; in mlx5_core_sriov_configure() 306 sriov->num_vfs = pci_num_vf(pdev); in mlx5_sriov_init() [all …]
|
H A D | eswitch.c | 1187 mlx5_esw_for_each_vf_vport(esw, i, vport, num_vfs) { in mlx5_eswitch_unload_vf_vports() 1214 mlx5_esw_for_each_vf_vport(esw, i, vport, num_vfs) { in mlx5_eswitch_load_vf_vports() 1223 mlx5_eswitch_unload_vf_vports(esw, num_vfs); in mlx5_eswitch_load_vf_vports() 1371 if (num_vfs < 0) in mlx5_eswitch_update_num_of_vfs() 1375 esw->esw_funcs.num_vfs = num_vfs; in mlx5_eswitch_update_num_of_vfs() 1386 esw->esw_funcs.num_ec_vfs = num_vfs; in mlx5_eswitch_update_num_of_vfs() 1479 mlx5_eswitch_update_num_of_vfs(esw, num_vfs); in mlx5_eswitch_enable_locked() 1536 ret = mlx5_eswitch_enable_locked(esw, num_vfs); in mlx5_eswitch_enable() 1549 esw->esw_funcs.num_vfs = num_vfs; in mlx5_eswitch_enable() 1553 esw->esw_funcs.num_ec_vfs = num_vfs; in mlx5_eswitch_enable() [all …]
|
/openbmc/linux/arch/powerpc/platforms/powernv/ |
H A D | pci-sriov.c | 454 for (j = 0; j < num_vfs; j++) { in pnv_pci_vf_assign_m64() 471 pnv_pci_vf_release_m64(pdev, num_vfs); in pnv_pci_vf_assign_m64() 508 u16 num_vfs; in pnv_pci_vf_resource_shift() local 523 num_vfs = iov->num_vfs; in pnv_pci_vf_resource_shift() 544 i, &res2, res, num_vfs, offset); in pnv_pci_vf_resource_shift() 570 num_vfs, offset); in pnv_pci_vf_resource_shift() 600 num_vfs = iov->num_vfs; in pnv_pci_sriov_disable() 611 pnv_pci_vf_release_m64(pdev, num_vfs); in pnv_pci_sriov_disable() 710 iov->num_vfs = num_vfs; in pnv_pci_sriov_enable() 731 pnv_ioda_setup_vf_PE(pdev, num_vfs); in pnv_pci_sriov_enable() [all …]
|
/openbmc/linux/drivers/net/ethernet/intel/fm10k/ |
H A D | fm10k_iov.c | 179 i = iov_data->num_vfs; in fm10k_iov_event() 287 int num_vfs, i; in fm10k_iov_suspend() local 290 num_vfs = iov_data ? iov_data->num_vfs : 0; in fm10k_iov_suspend() 332 int num_vfs, i; in fm10k_iov_resume() local 335 num_vfs = iov_data ? iov_data->num_vfs : 0; in fm10k_iov_resume() 348 hw->iov.ops.assign_resources(hw, num_vfs, num_vfs); in fm10k_iov_resume() 440 if (!num_vfs) in fm10k_iov_alloc_data() 450 iov_data->num_vfs = num_vfs; in fm10k_iov_alloc_data() 499 num_vfs = current_vfs; in fm10k_iov_configure() 511 if (num_vfs && num_vfs != current_vfs) { in fm10k_iov_configure() [all …]
|
H A D | fm10k_pf.c | 444 if (!hw->iov.num_vfs) in fm10k_update_int_moderator_pf() 586 u16 num_vfs = hw->iov.num_vfs; in fm10k_vf_queue_index() local 632 if ((num_vfs > num_pools) || (num_vfs > hw->iov.total_vfs)) in fm10k_iov_assign_resources_pf() 636 hw->iov.num_vfs = num_vfs; in fm10k_iov_assign_resources_pf() 649 for (i = 0; i < num_vfs; i++) { in fm10k_iov_assign_resources_pf() 687 for (i = 0; i < num_vfs; i++) { in fm10k_iov_assign_resources_pf() 742 if (vf_idx >= hw->iov.num_vfs) in fm10k_iov_configure_tc_pf() 800 if (vf_idx >= hw->iov.num_vfs) in fm10k_iov_assign_int_moderator_pf() 814 if (vf_idx == (hw->iov.num_vfs - 1)) in fm10k_iov_assign_int_moderator_pf() 954 if (vf_idx >= hw->iov.num_vfs) in fm10k_iov_reset_resources_pf() [all …]
|
/openbmc/linux/drivers/net/ethernet/broadcom/bnxt/ |
H A D | bnxt_sriov.c | 657 num_vfs; in bnxt_hwrm_func_cfg() 660 num_vfs; in bnxt_hwrm_func_cfg() 744 *num_vfs = 0; in bnxt_cfg_hw_sriov() 749 *num_vfs = rc; in bnxt_cfg_hw_sriov() 863 if (!num_vfs) in bnxt_sriov_disable() 874 num_vfs); in bnxt_sriov_disable() 916 num_vfs = 0; in bnxt_sriov_configure() 921 if (num_vfs && num_vfs == bp->pf.active_vfs) in bnxt_sriov_configure() 926 if (!num_vfs) in bnxt_sriov_configure() 935 return num_vfs; in bnxt_sriov_configure() [all …]
|
H A D | bnxt_vfr.c | 266 u16 num_vfs, i; in bnxt_vf_reps_close() local 271 num_vfs = pci_num_vf(bp->pdev); in bnxt_vf_reps_close() 272 for (i = 0; i < num_vfs; i++) { in bnxt_vf_reps_close() 315 u16 num_vfs = pci_num_vf(bp->pdev); in __bnxt_vf_reps_destroy() local 319 for (i = 0; i < num_vfs; i++) { in __bnxt_vf_reps_destroy() 383 u16 num_vfs = pci_num_vf(bp->pdev); in bnxt_vf_reps_free() local 389 for (i = 0; i < num_vfs; i++) in bnxt_vf_reps_free() 433 for (i = 0; i < num_vfs; i++) { in bnxt_vf_reps_alloc() 493 u16 *cfa_code_map = NULL, num_vfs = pci_num_vf(bp->pdev); in bnxt_vf_reps_create() local 501 bp->vf_reps = kcalloc(num_vfs, sizeof(vf_rep), GFP_KERNEL); in bnxt_vf_reps_create() [all …]
|
H A D | bnxt_sriov.h | 39 int bnxt_sriov_configure(struct pci_dev *pdev, int num_vfs); 40 int bnxt_cfg_hw_sriov(struct bnxt *bp, int *num_vfs, bool reset);
|
/openbmc/linux/drivers/net/ethernet/sfc/ |
H A D | ef100_sriov.c | 16 static int efx_ef100_pci_sriov_enable(struct efx_nic *efx, int num_vfs) in efx_ef100_pci_sriov_enable() argument 23 efx->vf_count = num_vfs; in efx_ef100_pci_sriov_enable() 24 rc = pci_enable_sriov(dev, num_vfs); in efx_ef100_pci_sriov_enable() 31 for (i = 0; i < num_vfs; i++) { in efx_ef100_pci_sriov_enable() 66 int efx_ef100_sriov_configure(struct efx_nic *efx, int num_vfs) in efx_ef100_sriov_configure() argument 68 if (num_vfs == 0) in efx_ef100_sriov_configure() 71 return efx_ef100_pci_sriov_enable(efx, num_vfs); in efx_ef100_sriov_configure()
|
/openbmc/linux/arch/powerpc/platforms/pseries/ |
H A D | pci.c | 57 static int pseries_send_map_pe(struct pci_dev *pdev, u16 num_vfs, in pseries_send_map_pe() argument 77 num_vfs * sizeof(struct pe_map_bar_entry)); in pseries_send_map_pe() 103 static int pseries_associate_pes(struct pci_dev *pdev, u16 num_vfs) in pseries_associate_pes() argument 117 for (vf_index = 0; vf_index < num_vfs; vf_index++) { in pseries_associate_pes() 136 rc = pseries_send_map_pe(pdev, num_vfs, vf_pe_array); in pseries_associate_pes() 139 for (vf_index = 0; vf_index < num_vfs; vf_index++) in pseries_associate_pes() 162 if (max_config_vfs < num_vfs && num_vfs > MAX_VFS_FOR_MAP_PE) { in pseries_pci_sriov_enable() 165 num_vfs, (num_vfs > MAX_VFS_FOR_MAP_PE) ? in pseries_pci_sriov_enable() 171 pdn->pe_num_map = kmalloc_array(num_vfs, in pseries_pci_sriov_enable() 177 rc = pseries_associate_pes(pdev, num_vfs); in pseries_pci_sriov_enable() [all …]
|
/openbmc/qemu/hw/pci/ |
H A D | pcie_sriov.c | 38 dev->exp.sriov_pf.num_vfs = 0; in pcie_sriov_pf_init() 168 uint16_t num_vfs; in register_vfs() local 187 for (i = 0; i < num_vfs; i++) { in register_vfs() 191 num_vfs = i; in register_vfs() 196 dev->exp.sriov_pf.num_vfs = num_vfs; in register_vfs() 201 uint16_t num_vfs = dev->exp.sriov_pf.num_vfs; in unregister_vfs() local 206 for (i = 0; i < num_vfs; i++) { in unregister_vfs() 217 dev->exp.sriov_pf.num_vfs = 0; in unregister_vfs() 238 if (dev->exp.sriov_pf.num_vfs) { in pcie_sriov_config_write() 309 if (n < dev->exp.sriov_pf.num_vfs) { in pcie_sriov_get_vf_at_index() [all …]
|
/openbmc/linux/drivers/net/ethernet/pensando/ionic/ |
H A D | ionic_bus_pci.c | 133 ionic->num_vfs = 0; in ionic_vf_dealloc_locked() 158 for (i = 0; i < num_vfs; i++) { in ionic_vf_alloc() 168 ionic->num_vfs++; in ionic_vf_alloc() 192 if (num_vfs > 0) { in ionic_sriov_configure() 193 ret = pci_enable_sriov(pdev, num_vfs); in ionic_sriov_configure() 199 ret = ionic_vf_alloc(ionic, num_vfs); in ionic_sriov_configure() 206 ret = num_vfs; in ionic_sriov_configure() 306 int num_vfs; in ionic_probe() local 350 num_vfs = pci_num_vf(pdev); in ionic_probe() 351 if (num_vfs) { in ionic_probe() [all …]
|
/openbmc/linux/drivers/net/ethernet/intel/ixgbe/ |
H A D | ixgbe_sriov.c | 25 unsigned int num_vfs) in ixgbe_alloc_vf_macvlans() argument 52 unsigned int num_vfs) in __ixgbe_enable_sriov() argument 72 adapter->num_vfs = num_vfs; in __ixgbe_enable_sriov() 85 } else if (num_vfs < 32) { in __ixgbe_enable_sriov() 144 if (vf >= adapter->num_vfs) in ixgbe_get_vfs() 158 unsigned int num_vfs; in ixgbe_enable_sriov() local 208 unsigned int num_vfs = adapter->num_vfs, vf; in ixgbe_disable_sriov() local 214 adapter->num_vfs = 0; in ixgbe_disable_sriov() 282 return num_vfs; in ixgbe_pci_sriov_enable() 328 return num_vfs; in ixgbe_pci_sriov_enable() [all …]
|
/openbmc/linux/drivers/net/ethernet/intel/ice/ |
H A D | ice_sriov.c | 469 if (!num_vfs) in ice_set_per_vf_res() 487 num_vfs); in ice_set_per_vf_res() 509 ICE_MIN_QS_PER_VF, num_vfs); in ice_set_per_vf_res() 516 num_vfs, err); in ice_set_per_vf_res() 853 num_vfs, ret); in ice_ena_vfs() 860 num_vfs); in ice_ena_vfs() 911 if (!num_vfs) { in ice_pci_sriov_ena() 918 num_vfs, pf->vfs.num_supported); in ice_pci_sriov_ena() 923 err = ice_ena_vfs(pf, num_vfs); in ice_pci_sriov_ena() 978 if (!num_vfs) { in ice_sriov_configure() [all …]
|
/openbmc/linux/drivers/net/ethernet/qlogic/qlcnic/ |
H A D | qlcnic_sriov_pf.c | 75 u32 num_vfs, max, temp; in qlcnic_sriov_pf_cal_res_limit() local 81 num_vfs = sriov->num_vfs; in qlcnic_sriov_pf_cal_res_limit() 82 max = num_vfs + 1; in qlcnic_sriov_pf_cal_res_limit() 581 int num_vfs) in __qlcnic_pci_sriov_enable() argument 647 return num_vfs; in qlcnic_pci_sriov_enable() 675 if (num_vfs == 0) in qlcnic_pci_sriov_configure() 1767 u16 num_vfs = sriov->num_vfs; in qlcnic_sriov_pf_reset() local 1806 int i, num_vfs; in qlcnic_sriov_set_vf_mac() local 1813 num_vfs = sriov->num_vfs; in qlcnic_sriov_set_vf_mac() 1862 if (vf >= sriov->num_vfs) in qlcnic_sriov_set_vf_tx_rate() [all …]
|
/openbmc/linux/drivers/net/ethernet/netronome/nfp/ |
H A D | nfp_main.c | 249 if (num_vfs > pf->limit_vfs) { in nfp_pcie_sriov_enable() 255 err = pci_enable_sriov(pdev, num_vfs); in nfp_pcie_sriov_enable() 264 err = nfp_app_sriov_enable(pf->app, num_vfs); in nfp_pcie_sriov_enable() 272 pf->num_vfs = num_vfs; in nfp_pcie_sriov_enable() 277 return num_vfs; in nfp_pcie_sriov_enable() 308 pf->num_vfs = 0; in nfp_pcie_sriov_disable() 323 if (num_vfs == 0) in nfp_pcie_sriov_configure() 326 return nfp_pcie_sriov_enable(pdev, num_vfs); in nfp_pcie_sriov_configure() 847 pf->num_vfs = pci_num_vf(pdev); in nfp_pci_probe() 848 if (pf->num_vfs > pf->limit_vfs) { in nfp_pci_probe() [all …]
|
/openbmc/linux/drivers/crypto/cavium/cpt/ |
H A D | cptpf_main.c | 19 static u32 num_vfs = 4; /* Default 4 VF enabled */ variable 20 module_param(num_vfs, uint, 0444); 21 MODULE_PARM_DESC(num_vfs, "Number of VFs to enable(1-16)"); 502 static int cpt_sriov_init(struct cpt_device *cpt, int num_vfs) in cpt_sriov_init() argument 515 cpt->num_vf_en = num_vfs; /* User requested VFs */ in cpt_sriov_init() 548 if (num_vfs > 16 || num_vfs < 4) { in cpt_probe() 550 num_vfs); in cpt_probe() 551 num_vfs = 4; in cpt_probe() 600 err = cpt_sriov_init(cpt, num_vfs); in cpt_probe()
|
/openbmc/linux/drivers/pci/ |
H A D | iov.c | 398 u16 num_vfs; in sriov_numvfs_show() local 402 num_vfs = pdev->sriov->num_VFs; in sriov_numvfs_show() 405 return sysfs_emit(buf, "%u\n", num_vfs); in sriov_numvfs_show() 421 u16 num_vfs; in sriov_numvfs_store() local 423 if (kstrtou16(buf, 0, &num_vfs) < 0) in sriov_numvfs_store() 431 if (num_vfs == pdev->sriov->num_VFs) in sriov_numvfs_store() 448 if (num_vfs == 0) { in sriov_numvfs_store() 457 pdev->sriov->num_VFs, num_vfs); in sriov_numvfs_store() 466 if (ret != num_vfs) in sriov_numvfs_store() 468 num_vfs, ret); in sriov_numvfs_store() [all …]
|
/openbmc/linux/drivers/net/ethernet/huawei/hinic/ |
H A D | hinic_sriov.c | 604 if (vf >= sriov_info->num_vfs) in hinic_ndo_get_vf_config() 837 if (vf >= sriov_info->num_vfs) in hinic_ndo_set_vf_trust() 870 nic_dev->sriov_info.num_vfs); in hinic_ndo_set_vf_bw() 956 if (vf >= sriov_info->num_vfs) in hinic_ndo_set_vf_spoofchk() 1020 if (vf_id >= sriov_info->num_vfs) { in hinic_ndo_set_vf_link_state() 1302 tmp_vfs = (u16)sriov_info->num_vfs; in hinic_pci_sriov_disable() 1303 sriov_info->num_vfs = 0; in hinic_pci_sriov_disable() 1322 num_vfs); in hinic_pci_sriov_enable() 1345 sriov_info->num_vfs = num_vfs; in hinic_pci_sriov_enable() 1348 return num_vfs; in hinic_pci_sriov_enable() [all …]
|
/openbmc/linux/drivers/net/ethernet/amd/pds_core/ |
H A D | main.c | 141 static int pdsc_sriov_configure(struct pci_dev *pdev, int num_vfs) in pdsc_sriov_configure() argument 147 if (num_vfs > 0) { in pdsc_sriov_configure() 148 pdsc->vfs = kcalloc(num_vfs, sizeof(struct pdsc_vf), in pdsc_sriov_configure() 152 pdsc->num_vfs = num_vfs; in pdsc_sriov_configure() 154 ret = pci_enable_sriov(pdev, num_vfs); in pdsc_sriov_configure() 161 return num_vfs; in pdsc_sriov_configure() 169 pdsc->num_vfs = 0; in pdsc_sriov_configure()
|
/openbmc/linux/drivers/net/netdevsim/ |
H A D | bus.c | 31 unsigned int num_vfs; in nsim_bus_dev_numvfs_store() local 34 ret = kstrtouint(buf, 0, &num_vfs); in nsim_bus_dev_numvfs_store() 41 ret = nsim_drv_configure_vfs(nsim_bus_dev, num_vfs); in nsim_bus_dev_numvfs_store() 53 return sprintf(buf, "%u\n", nsim_bus_dev->num_vfs); in nsim_bus_dev_numvfs_show() 253 return nsim_bus_dev->num_vfs; in nsim_num_vf()
|
/openbmc/linux/drivers/net/ethernet/cavium/liquidio/ |
H A D | lio_vf_rep.c | 493 int i, num_vfs; in lio_vf_rep_create() local 501 num_vfs = oct->sriov_info.num_vfs_alloced; in lio_vf_rep_create() 503 oct->vf_rep_list.num_vfs = 0; in lio_vf_rep_create() 504 for (i = 0; i < num_vfs; i++) { in lio_vf_rep_create() 542 oct->vf_rep_list.num_vfs++; in lio_vf_rep_create() 557 for (i = 0; i < oct->vf_rep_list.num_vfs; i++) { in lio_vf_rep_create() 569 oct->vf_rep_list.num_vfs = 0; in lio_vf_rep_create() 587 for (i = 0; i < oct->vf_rep_list.num_vfs; i++) { in lio_vf_rep_destroy() 602 oct->vf_rep_list.num_vfs = 0; in lio_vf_rep_destroy()
|