/linux-6.1.9/drivers/crypto/cavium/nitrox/ |
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() 31 static inline enum vf_mode num_vfs_to_mode(int num_vfs) in num_vfs_to_mode() argument 35 switch (num_vfs) { in num_vfs_to_mode() 153 static int nitrox_sriov_enable(struct pci_dev *pdev, int num_vfs) in nitrox_sriov_enable() argument 158 if (!num_vfs_valid(num_vfs)) { in nitrox_sriov_enable() 159 dev_err(DEV(ndev), "Invalid num_vfs %d\n", 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() 166 err = pci_enable_sriov(pdev, num_vfs); in nitrox_sriov_enable() [all …]
|
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
|
/linux-6.1.9/drivers/crypto/marvell/octeontx2/ |
D | otx2_cptpf_main.c | 17 int num_vfs) in cptpf_enable_vfpf_mbox_intr() argument 28 ena_bits = ((num_vfs - 1) % 64); in cptpf_enable_vfpf_mbox_intr() 33 if (num_vfs > 64) { in cptpf_enable_vfpf_mbox_intr() 35 ena_bits = num_vfs - 64 - 1; in cptpf_enable_vfpf_mbox_intr() 43 int num_vfs) in cptpf_disable_vfpf_mbox_intr() argument 59 if (num_vfs > 64) { in cptpf_disable_vfpf_mbox_intr() 68 int num_vfs) in cptpf_enable_vf_flr_me_intrs() argument 72 INTR_MASK(num_vfs)); in cptpf_enable_vf_flr_me_intrs() 76 RVU_PF_VFFLR_INT_ENA_W1SX(0), INTR_MASK(num_vfs)); in cptpf_enable_vf_flr_me_intrs() 79 INTR_MASK(num_vfs)); in cptpf_enable_vf_flr_me_intrs() [all …]
|
/linux-6.1.9/drivers/net/ethernet/mellanox/mlx5/core/ |
D | sriov.c | 72 static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs) in mlx5_device_enable_sriov() argument 80 err = mlx5_eswitch_enable(dev->priv.eswitch, num_vfs); in mlx5_device_enable_sriov() 88 num_msix_count = mlx5_get_default_msix_vec_count(dev, num_vfs); in mlx5_device_enable_sriov() 89 for (vf = 0; vf < num_vfs; vf++) { in mlx5_device_enable_sriov() 126 mlx5_device_disable_sriov(struct mlx5_core_dev *dev, int num_vfs, bool clear_vf) in mlx5_device_disable_sriov() argument 132 for (vf = num_vfs - 1; vf >= 0; vf--) { in mlx5_device_disable_sriov() 154 static int mlx5_sriov_enable(struct pci_dev *pdev, int num_vfs) in mlx5_sriov_enable() argument 161 err = mlx5_device_enable_sriov(dev, num_vfs); in mlx5_sriov_enable() 168 err = pci_enable_sriov(pdev, num_vfs); in mlx5_sriov_enable() 171 mlx5_device_disable_sriov(dev, num_vfs, true); in mlx5_sriov_enable() [all …]
|
D | eswitch.c | 998 mlx5_esw_for_each_vf_vport(esw, i, vport, esw->esw_funcs.num_vfs) { in mlx5_eswitch_clear_vf_vports_info() 1035 void mlx5_eswitch_unload_vf_vports(struct mlx5_eswitch *esw, u16 num_vfs) in mlx5_eswitch_unload_vf_vports() argument 1040 mlx5_esw_for_each_vf_vport(esw, i, vport, num_vfs) { in mlx5_eswitch_unload_vf_vports() 1047 int mlx5_eswitch_load_vf_vports(struct mlx5_eswitch *esw, u16 num_vfs, in mlx5_eswitch_load_vf_vports() argument 1054 mlx5_esw_for_each_vf_vport(esw, i, vport, num_vfs) { in mlx5_eswitch_load_vf_vports() 1063 mlx5_eswitch_unload_vf_vports(esw, num_vfs); in mlx5_eswitch_load_vf_vports() 1114 ret = mlx5_eswitch_load_vf_vports(esw, esw->esw_funcs.num_vfs, in mlx5_eswitch_enable_pf_vf_vports() 1135 mlx5_eswitch_unload_vf_vports(esw, esw->esw_funcs.num_vfs); in mlx5_eswitch_disable_pf_vf_vports() 1164 mlx5_eswitch_update_num_of_vfs(struct mlx5_eswitch *esw, int num_vfs) in mlx5_eswitch_update_num_of_vfs() argument 1168 if (num_vfs < 0) in mlx5_eswitch_update_num_of_vfs() [all …]
|
/linux-6.1.9/arch/powerpc/platforms/powernv/ |
D | pci-sriov.c | 284 static int pnv_pci_vf_release_m64(struct pci_dev *pdev, u16 num_vfs) in pnv_pci_vf_release_m64() argument 415 static int pnv_pci_vf_assign_m64(struct pci_dev *pdev, u16 num_vfs) in pnv_pci_vf_assign_m64() argument 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() 540 res2.end = res2.start + (size * num_vfs) - 1; 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() 593 u16 num_vfs, base_pe; in pnv_pci_sriov_disable() local [all …]
|
/linux-6.1.9/drivers/net/ethernet/broadcom/bnxt/ |
D | bnxt_sriov.c | 367 static int bnxt_set_vf_attr(struct bnxt *bp, int num_vfs) in bnxt_set_vf_attr() argument 372 for (i = 0; i < num_vfs; i++) { in bnxt_set_vf_attr() 379 static int bnxt_hwrm_func_vf_resource_free(struct bnxt *bp, int num_vfs) in bnxt_hwrm_func_vf_resource_free() argument 390 for (i = pf->first_vf_id; i < pf->first_vf_id + num_vfs; i++) { in bnxt_hwrm_func_vf_resource_free() 422 static int bnxt_alloc_vf_resources(struct bnxt *bp, int num_vfs) in bnxt_alloc_vf_resources() argument 427 bp->pf.vf = kcalloc(num_vfs, sizeof(struct bnxt_vf_info), GFP_KERNEL); in bnxt_alloc_vf_resources() 431 bnxt_set_vf_attr(bp, num_vfs); in bnxt_alloc_vf_resources() 433 size = num_vfs * BNXT_HWRM_REQ_MAX_SIZE; in bnxt_alloc_vf_resources() 447 for (j = 0; j < BNXT_HWRM_REQS_PER_PAGE && k < num_vfs; j++) { in bnxt_alloc_vf_resources() 524 static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, int num_vfs, bool reset) in bnxt_hwrm_func_vf_resc_cfg() argument [all …]
|
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() 378 u16 num_vfs = pci_num_vf(bp->pdev); in bnxt_vf_reps_free() local 384 for (i = 0; i < num_vfs; i++) in bnxt_vf_reps_free() 415 u16 *cfa_code_map = bp->cfa_code_map, num_vfs = pci_num_vf(bp->pdev); in bnxt_vf_reps_alloc() local 428 for (i = 0; i < num_vfs; i++) { in bnxt_vf_reps_alloc() 487 u16 *cfa_code_map = NULL, num_vfs = pci_num_vf(bp->pdev); in bnxt_vf_reps_create() local [all …]
|
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);
|
/linux-6.1.9/drivers/net/ethernet/intel/fm10k/ |
D | fm10k_iov.c | 179 i = iov_data->num_vfs; in fm10k_iov_event() 226 for (i = iov_data->next_vf_mbx ? : iov_data->num_vfs; i--;) { in fm10k_iov_mbx() 287 int num_vfs, i; in fm10k_iov_suspend() local 290 num_vfs = iov_data ? iov_data->num_vfs : 0; in fm10k_iov_suspend() 297 for (i = 0; i < num_vfs; i++) { 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() 362 for (i = 0; i < num_vfs; i++) { in fm10k_iov_resume() 395 if (vf_idx >= iov_data->num_vfs) in fm10k_iov_update_pvid() [all …]
|
D | fm10k_pf.c | 443 if (!hw->iov.num_vfs) in fm10k_update_int_moderator_pf() 585 u16 num_vfs = hw->iov.num_vfs; in fm10k_vf_queue_index() local 588 vf_q_idx -= fm10k_queues_per_pool(hw) * (num_vfs - vf_idx); in fm10k_vf_queue_index() 619 static s32 fm10k_iov_assign_resources_pf(struct fm10k_hw *hw, u16 num_vfs, in fm10k_iov_assign_resources_pf() argument 631 if ((num_vfs > num_pools) || (num_vfs > hw->iov.total_vfs)) in fm10k_iov_assign_resources_pf() 635 hw->iov.num_vfs = num_vfs; in fm10k_iov_assign_resources_pf() 639 qmap_stride = (num_vfs > 8) ? 32 : 256; in fm10k_iov_assign_resources_pf() 648 for (i = 0; i < num_vfs; i++) { in fm10k_iov_assign_resources_pf() 656 for (i = FM10K_VFMBMEM_LEN * num_vfs; i--;) in fm10k_iov_assign_resources_pf() 683 fm10k_vf_vector_index(hw, num_vfs - 1)); in fm10k_iov_assign_resources_pf() [all …]
|
/linux-6.1.9/drivers/net/ethernet/sfc/ |
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()
|
/linux-6.1.9/arch/powerpc/platforms/pseries/ |
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() 147 static int pseries_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs) in pseries_pci_sriov_enable() argument 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() [all …]
|
/linux-6.1.9/drivers/net/ethernet/pensando/ionic/ |
D | ionic_bus_pci.c | 119 for (i = ionic->num_vfs - 1; i >= 0; i--) { in ionic_vf_dealloc_locked() 133 ionic->num_vfs = 0; in ionic_vf_dealloc_locked() 143 static int ionic_vf_alloc(struct ionic *ionic, int num_vfs) in ionic_vf_alloc() argument 152 ionic->vfs = kcalloc(num_vfs, sizeof(struct ionic_vf), GFP_KERNEL); in ionic_vf_alloc() 158 for (i = 0; i < num_vfs; i++) { in ionic_vf_alloc() 168 ionic->num_vfs++; in ionic_vf_alloc() 182 static int ionic_sriov_configure(struct pci_dev *pdev, int num_vfs) in ionic_sriov_configure() argument 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() [all …]
|
/linux-6.1.9/drivers/net/ethernet/intel/ixgbe/ |
D | ixgbe_sriov.c | 25 unsigned int num_vfs) in ixgbe_alloc_vf_macvlans() argument 32 (IXGBE_MAX_PF_MACVLANS + 1 + num_vfs); in ixgbe_alloc_vf_macvlans() 51 unsigned int num_vfs) in __ixgbe_enable_sriov() argument 66 adapter->vfinfo = kcalloc(num_vfs, sizeof(struct vf_data_storage), in __ixgbe_enable_sriov() 71 adapter->num_vfs = num_vfs; in __ixgbe_enable_sriov() 73 ixgbe_alloc_vf_macvlans(adapter, num_vfs); in __ixgbe_enable_sriov() 74 adapter->ring_feature[RING_F_VMDQ].offset = num_vfs; in __ixgbe_enable_sriov() 81 if ((adapter->hw.mac.type == ixgbe_mac_82599EB) && (num_vfs < 16)) { in __ixgbe_enable_sriov() 84 } else if (num_vfs < 32) { in __ixgbe_enable_sriov() 96 for (i = 0; i < num_vfs; i++) { in __ixgbe_enable_sriov() [all …]
|
/linux-6.1.9/drivers/net/ethernet/intel/ice/ |
D | ice_sriov.c | 504 static int ice_set_per_vf_res(struct ice_pf *pf, u16 num_vfs) in ice_set_per_vf_res() argument 514 if (!num_vfs) in ice_set_per_vf_res() 523 msix_avail_per_vf = msix_avail_for_sriov / num_vfs; in ice_set_per_vf_res() 535 num_vfs); in ice_set_per_vf_res() 541 avail_qs = ice_get_avail_txq_count(pf) / num_vfs; in ice_set_per_vf_res() 549 avail_qs = ice_get_avail_rxq_count(pf) / num_vfs; in ice_set_per_vf_res() 557 ICE_MIN_QS_PER_VF, num_vfs); in ice_set_per_vf_res() 561 err = ice_sriov_set_msix_res(pf, num_msix_per_vf * num_vfs); in ice_set_per_vf_res() 564 num_vfs, err); in ice_set_per_vf_res() 572 num_vfs, pf->vfs.num_msix_per, pf->vfs.num_qps_per); in ice_set_per_vf_res() [all …]
|
/linux-6.1.9/drivers/net/ethernet/qlogic/qlcnic/ |
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() 95 temp = res->num_rx_ucast_mac_filters - num_macs * num_vfs; in qlcnic_sriov_pf_cal_res_limit() 97 temp = res->num_tx_mac_filters - num_macs * num_vfs; in qlcnic_sriov_pf_cal_res_limit() 99 temp = num_macs * num_vfs * QLCNIC_SRIOV_VF_MAX_MAC; in qlcnic_sriov_pf_cal_res_limit() 103 info->max_tx_ques = res->num_tx_queues - sriov->num_vfs; in qlcnic_sriov_pf_cal_res_limit() 162 total_fn = sriov->num_vfs + 1; in qlcnic_sriov_set_vf_max_vlan() 412 for (i = 0; i < sriov->num_vfs; i++) in qlcnic_sriov_pf_del_flr_queue() 566 static int qlcnic_sriov_pf_enable(struct qlcnic_adapter *adapter, int num_vfs) in qlcnic_sriov_pf_enable() argument [all …]
|
/linux-6.1.9/drivers/net/ethernet/netronome/nfp/ |
D | nfp_main.c | 242 static int nfp_pcie_sriov_enable(struct pci_dev *pdev, int num_vfs) in nfp_pcie_sriov_enable() argument 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() 274 dev_dbg(&pdev->dev, "Created %d VFs.\n", pf->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() 318 static int nfp_pcie_sriov_configure(struct pci_dev *pdev, int num_vfs) in nfp_pcie_sriov_configure() argument 323 if (num_vfs == 0) in nfp_pcie_sriov_configure() [all …]
|
/linux-6.1.9/drivers/crypto/cavium/cpt/ |
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()
|
/linux-6.1.9/drivers/pci/ |
D | iov.c | 399 u16 num_vfs; in sriov_numvfs_show() local 403 num_vfs = pdev->sriov->num_VFs; in sriov_numvfs_show() 406 return sysfs_emit(buf, "%u\n", num_vfs); in sriov_numvfs_show() 422 u16 num_vfs; in sriov_numvfs_store() local 424 if (kstrtou16(buf, 0, &num_vfs) < 0) in sriov_numvfs_store() 427 if (num_vfs > pci_sriov_get_totalvfs(pdev)) in sriov_numvfs_store() 432 if (num_vfs == pdev->sriov->num_VFs) in sriov_numvfs_store() 449 if (num_vfs == 0) { in sriov_numvfs_store() 458 pdev->sriov->num_VFs, num_vfs); in sriov_numvfs_store() 463 ret = pdev->driver->sriov_configure(pdev, num_vfs); in sriov_numvfs_store() [all …]
|
/linux-6.1.9/drivers/net/ethernet/huawei/hinic/ |
D | hinic_sriov.c | 586 if (vf >= sriov_info->num_vfs) in hinic_ndo_get_vf_config() 631 if (!is_valid_ether_addr(mac) || vf >= sriov_info->num_vfs) in hinic_ndo_set_vf_mac() 778 if (vf >= sriov_info->num_vfs || vlan >= VLAN_N_VID || qos > HINIC_MAX_QOS) in hinic_ndo_set_vf_vlan() 819 if (vf >= sriov_info->num_vfs) in hinic_ndo_set_vf_trust() 850 if (vf >= nic_dev->sriov_info.num_vfs) { in hinic_ndo_set_vf_bw() 852 nic_dev->sriov_info.num_vfs); in hinic_ndo_set_vf_bw() 938 if (vf >= sriov_info->num_vfs) in hinic_ndo_set_vf_spoofchk() 1002 if (vf_id >= sriov_info->num_vfs) { in hinic_ndo_set_vf_link_state() 1284 tmp_vfs = (u16)sriov_info->num_vfs; in hinic_pci_sriov_disable() 1285 sriov_info->num_vfs = 0; in hinic_pci_sriov_disable() [all …]
|
/linux-6.1.9/drivers/net/netdevsim/ |
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()
|
/linux-6.1.9/drivers/net/ethernet/cavium/liquidio/ |
D | lio_vf_rep.c | 494 int i, num_vfs; in lio_vf_rep_create() local 502 num_vfs = oct->sriov_info.num_vfs_alloced; in lio_vf_rep_create() 504 oct->vf_rep_list.num_vfs = 0; in lio_vf_rep_create() 505 for (i = 0; i < num_vfs; i++) { in lio_vf_rep_create() 543 oct->vf_rep_list.num_vfs++; in lio_vf_rep_create() 558 for (i = 0; i < oct->vf_rep_list.num_vfs; i++) { in lio_vf_rep_create() 570 oct->vf_rep_list.num_vfs = 0; in lio_vf_rep_create() 588 for (i = 0; i < oct->vf_rep_list.num_vfs; i++) { in lio_vf_rep_destroy() 603 oct->vf_rep_list.num_vfs = 0; in lio_vf_rep_destroy()
|
/linux-6.1.9/drivers/crypto/qat/qat_common/ |
D | adf_pfvf_pf_msg.c | 13 int i, num_vfs = pci_num_vf(accel_to_pci_dev(accel_dev)); in adf_pf2vf_notify_restarting() local 15 for (i = 0, vf = accel_dev->pf.vf_info; i < num_vfs; i++, vf++) { in adf_pf2vf_notify_restarting()
|
/linux-6.1.9/drivers/fpga/ |
D | dfl-pci.c | 410 static int cci_pci_sriov_configure(struct pci_dev *pcidev, int num_vfs) in cci_pci_sriov_configure() argument 415 if (!num_vfs) { in cci_pci_sriov_configure() 431 ret = dfl_fpga_cdev_config_ports_vf(cdev, num_vfs); in cci_pci_sriov_configure() 435 ret = pci_enable_sriov(pcidev, num_vfs); in cci_pci_sriov_configure() 442 return num_vfs; in cci_pci_sriov_configure()
|