| /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() 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 …]
|
| 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
|
| /linux/drivers/crypto/marvell/octeontx2/ |
| H A D | otx2_cptpf_main.c | 22 int num_vfs) in cptpf_enable_vfpf_mbox_intr() argument 33 ena_bits = ((num_vfs - 1) % 64); in cptpf_enable_vfpf_mbox_intr() 38 if (num_vfs > 64) { in cptpf_enable_vfpf_mbox_intr() 40 ena_bits = num_vfs - 64 - 1; in cptpf_enable_vfpf_mbox_intr() 48 int num_vfs) in cptpf_disable_vfpf_mbox_intr() argument 64 if (num_vfs > 64) { in cptpf_disable_vfpf_mbox_intr() 73 int num_vfs) in cptpf_enable_vf_flr_me_intrs() argument 77 INTR_MASK(num_vfs)); in cptpf_enable_vf_flr_me_intrs() 81 RVU_PF_VFFLR_INT_ENA_W1SX(0), INTR_MASK(num_vfs)); in cptpf_enable_vf_flr_me_intrs() 84 INTR_MASK(num_vfs)); in cptpf_enable_vf_flr_me_intrs() [all …]
|
| /linux/drivers/net/ethernet/mellanox/mlx5/core/ |
| H A D | sriov.c | 72 static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs) in mlx5_device_enable_sriov() argument 78 err = mlx5_eswitch_enable(dev->priv.eswitch, num_vfs); in mlx5_device_enable_sriov() 85 num_msix_count = mlx5_get_default_msix_vec_count(dev, num_vfs); in mlx5_device_enable_sriov() 86 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, bool num_vf_change) in mlx5_device_disable_sriov() argument 134 for (vf = num_vfs - 1; vf >= 0; vf--) { in mlx5_device_disable_sriov() 179 static int mlx5_sriov_enable(struct pci_dev *pdev, int num_vfs) in mlx5_sriov_enable() argument 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() 197 mlx5_device_disable_sriov(dev, num_vfs, true, true); in mlx5_sriov_enable() [all …]
|
| H A D | eswitch.c | 1108 mlx5_esw_for_each_vf_vport(esw, i, vport, esw->esw_funcs.num_vfs) { in mlx5_eswitch_clear_vf_vports_info() 1227 void mlx5_eswitch_unload_vf_vports(struct mlx5_eswitch *esw, u16 num_vfs) in mlx5_eswitch_unload_vf_vports() argument 1232 mlx5_esw_for_each_vf_vport(esw, i, vport, num_vfs) { in mlx5_eswitch_unload_vf_vports() 1289 int mlx5_eswitch_load_vf_vports(struct mlx5_eswitch *esw, u16 num_vfs, in mlx5_eswitch_load_vf_vports() argument 1296 mlx5_esw_for_each_vf_vport(esw, i, vport, num_vfs) { in mlx5_eswitch_load_vf_vports() 1305 mlx5_eswitch_unload_vf_vports(esw, num_vfs); in mlx5_eswitch_load_vf_vports() 1422 ret = mlx5_eswitch_load_vf_vports(esw, esw->esw_funcs.num_vfs, in mlx5_eswitch_enable_pf_vf_vports() 1435 mlx5_eswitch_unload_vf_vports(esw, esw->esw_funcs.num_vfs); in mlx5_eswitch_enable_pf_vf_vports() 1458 mlx5_eswitch_unload_vf_vports(esw, esw->esw_funcs.num_vfs); in mlx5_eswitch_disable_pf_vf_vports() 1497 mlx5_eswitch_update_num_of_vfs(struct mlx5_eswitch *esw, int num_vfs) in mlx5_eswitch_update_num_of_vfs() argument [all …]
|
| /linux/arch/powerpc/platforms/powernv/ |
| H A 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/drivers/net/ethernet/intel/fm10k/ |
| H A 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 …]
|
| /linux/arch/powerpc/platforms/pseries/ |
| H A D | pci.c | 30 static int pseries_send_map_pe(struct pci_dev *pdev, u16 num_vfs, in pseries_send_map_pe() argument 50 num_vfs * sizeof(struct pe_map_bar_entry)); in pseries_send_map_pe() 76 static int pseries_associate_pes(struct pci_dev *pdev, u16 num_vfs) in pseries_associate_pes() argument 90 for (vf_index = 0; vf_index < num_vfs; vf_index++) { in pseries_associate_pes() 109 rc = pseries_send_map_pe(pdev, num_vfs, vf_pe_array); in pseries_associate_pes() 112 for (vf_index = 0; vf_index < num_vfs; vf_index++) in pseries_associate_pes() 120 static int pseries_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs) in pseries_pci_sriov_enable() argument 135 if (max_config_vfs < num_vfs && num_vfs > MAX_VFS_FOR_MAP_PE) { in pseries_pci_sriov_enable() 138 num_vfs, (num_vfs > MAX_VFS_FOR_MAP_PE) ? in pseries_pci_sriov_enable() 144 pdn->pe_num_map = kmalloc_objs(*pdn->pe_num_map, num_vfs); in pseries_pci_sriov_enable() [all …]
|
| /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()
|
| /linux/drivers/crypto/intel/qat/qat_common/ |
| H A D | adf_pfvf_pf_msg.c | 17 int i, num_vfs = pci_num_vf(accel_to_pci_dev(accel_dev)); in adf_pf2vf_notify_restarting() local 20 for (i = 0, vf = accel_dev->pf.vf_info; i < num_vfs; i++, vf++) { in adf_pf2vf_notify_restarting() 37 int num_vfs = pci_num_vf(accel_to_pci_dev(accel_dev)); in adf_pf2vf_wait_for_restarting_complete() local 45 for (i = 0, vf = accel_dev->pf.vf_info; i < num_vfs; i++, vf++) in adf_pf2vf_wait_for_restarting_complete() 60 int i, num_vfs = pci_num_vf(accel_to_pci_dev(accel_dev)); in adf_pf2vf_notify_restarted() local 64 for (i = 0, vf = accel_dev->pf.vf_info; i < num_vfs; i++, vf++) { in adf_pf2vf_notify_restarted() 75 int i, num_vfs = pci_num_vf(accel_to_pci_dev(accel_dev)); in adf_pf2vf_notify_fatal_error() local 79 for (i = 0, vf = accel_dev->pf.vf_info; i < num_vfs; i++, vf++) { in adf_pf2vf_notify_fatal_error()
|
| /linux/drivers/net/ethernet/pensando/ionic/ |
| H A D | ionic_bus_pci.c | 121 for (i = ionic->num_vfs - 1; i >= 0; i--) { in ionic_vf_dealloc_locked() 135 ionic->num_vfs = 0; in ionic_vf_dealloc_locked() 145 static int ionic_vf_alloc(struct ionic *ionic, int num_vfs) in ionic_vf_alloc() argument 154 ionic->vfs = kzalloc_objs(struct ionic_vf, num_vfs); in ionic_vf_alloc() 160 for (i = 0; i < num_vfs; i++) { in ionic_vf_alloc() 170 ionic->num_vfs++; in ionic_vf_alloc() 184 static int ionic_sriov_configure(struct pci_dev *pdev, int num_vfs) in ionic_sriov_configure() argument 194 if (num_vfs > 0) { in ionic_sriov_configure() 195 ret = pci_enable_sriov(pdev, num_vfs); in ionic_sriov_configure() 201 ret = ionic_vf_alloc(ionic, num_vfs); in ionic_sriov_configure() [all …]
|
| /linux/drivers/net/ethernet/intel/ixgbe/ |
| H A D | ixgbe_sriov.c | 26 unsigned int num_vfs) in ixgbe_alloc_vf_macvlans() argument 36 (IXGBE_MAX_PF_MACVLANS + 1 + num_vfs); in ixgbe_alloc_vf_macvlans() 52 unsigned int num_vfs) in __ixgbe_enable_sriov() argument 67 adapter->vfinfo = kzalloc_objs(struct vf_data_storage, num_vfs); 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/drivers/net/ethernet/wangxun/libwx/ |
| H A D | wx_sriov.c | 22 static int wx_alloc_vf_macvlans(struct wx *wx, u8 num_vfs) in wx_alloc_vf_macvlans() argument 31 (WX_MAX_PF_MACVLANS + 1 + num_vfs); in wx_alloc_vf_macvlans() 52 wx->num_vfs = 0; in wx_sriov_clear_data() 73 static int __wx_enable_sriov(struct wx *wx, u8 num_vfs) in __wx_enable_sriov() argument 79 dev_info(&wx->pdev->dev, "SR-IOV enabled with %d VFs\n", num_vfs); in __wx_enable_sriov() 81 if (num_vfs == 7 && wx->mac.type == wx_mac_em) in __wx_enable_sriov() 88 wx->ring_feature[RING_F_VMDQ].offset = num_vfs; in __wx_enable_sriov() 90 wx->vfinfo = kzalloc_objs(struct vf_data_storage, num_vfs); in __wx_enable_sriov() 94 ret = wx_alloc_vf_macvlans(wx, num_vfs); in __wx_enable_sriov() 101 for (i = 0; i < num_vfs; i++) { in __wx_enable_sriov() [all …]
|
| /linux/drivers/net/ethernet/freescale/enetc/ |
| H A D | enetc_msg.c | 11 psiier = enetc_rd(hw, ENETC_PSIIER) & ~ENETC_PSIMR_MASK(pf->num_vfs); in enetc_msg_disable_mr_int() 22 psiier = enetc_rd(hw, ENETC_PSIIER) | ENETC_PSIMR_MASK(pf->num_vfs); in enetc_msg_enable_mr_int() 41 u32 mr_mask = ENETC_PSIMR_MASK(pf->num_vfs); in enetc_msg_task() 51 for (i = 0; i < pf->num_vfs; i++) { in enetc_msg_task() 121 for (i = 0; i < pf->num_vfs; i++) { in enetc_msg_psi_init() 172 for (i = 0; i < pf->num_vfs; i++) in enetc_msg_psi_free()
|
| H A D | enetc_pf.c | 559 static int enetc_sriov_configure(struct pci_dev *pdev, int num_vfs) in enetc_sriov_configure() argument 565 if (!num_vfs) { in enetc_sriov_configure() 568 pf->num_vfs = 0; in enetc_sriov_configure() 570 pf->num_vfs = num_vfs; in enetc_sriov_configure() 578 err = pci_enable_sriov(pdev, num_vfs); in enetc_sriov_configure() 585 return num_vfs; in enetc_sriov_configure() 590 pf->num_vfs = 0; in enetc_sriov_configure() 595 #define enetc_sriov_configure(pdev, num_vfs) (void)0 argument 1095 if (pf->num_vfs) in enetc_pf_remove()
|
| /linux/drivers/net/ethernet/intel/ice/ |
| H A D | ice_sriov.c | 371 static int ice_set_per_vf_res(struct ice_pf *pf, u16 num_vfs) in ice_set_per_vf_res() argument 379 if (!num_vfs) in ice_set_per_vf_res() 384 msix_avail_per_vf = msix_avail_for_sriov / num_vfs; in ice_set_per_vf_res() 396 num_vfs); in ice_set_per_vf_res() 402 avail_qs = ice_get_avail_txq_count(pf) / num_vfs; in ice_set_per_vf_res() 410 avail_qs = ice_get_avail_rxq_count(pf) / num_vfs; in ice_set_per_vf_res() 418 ICE_MIN_QS_PER_VF, num_vfs); in ice_set_per_vf_res() 426 num_vfs, pf->vfs.num_msix_per, pf->vfs.num_qps_per); in ice_set_per_vf_res() 683 static int ice_create_vf_entries(struct ice_pf *pf, u16 num_vfs) in ice_create_vf_entries() argument 697 for (u16 vf_id = 0; vf_id < num_vfs; vf_id++) { in ice_create_vf_entries() [all …]
|
| /linux/drivers/net/ethernet/broadcom/bnxt/ |
| H A D | bnxt_vfr.c | 265 u16 num_vfs, i; in bnxt_vf_reps_close() local 270 num_vfs = pci_num_vf(bp->pdev); in bnxt_vf_reps_close() 271 for (i = 0; i < num_vfs; i++) { in bnxt_vf_reps_close() 313 u16 num_vfs = pci_num_vf(bp->pdev); in __bnxt_vf_reps_destroy() local 317 for (i = 0; i < num_vfs; i++) { in __bnxt_vf_reps_destroy() 381 u16 num_vfs = pci_num_vf(bp->pdev); in bnxt_vf_reps_free() local 387 for (i = 0; i < num_vfs; i++) in bnxt_vf_reps_free() 418 u16 *cfa_code_map = bp->cfa_code_map, num_vfs = pci_num_vf(bp->pdev); in bnxt_vf_reps_alloc() local 431 for (i = 0; i < num_vfs; i++) { in bnxt_vf_reps_alloc() 491 u16 *cfa_code_map = NULL, num_vfs = pci_num_vf(bp->pdev); in bnxt_vf_reps_create() local [all …]
|
| /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() 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/drivers/pci/ |
| H A D | iov.c | 446 u16 num_vfs; in sriov_numvfs_show() local 450 num_vfs = pdev->sriov->num_VFs; in sriov_numvfs_show() 453 return sysfs_emit(buf, "%u\n", num_vfs); in sriov_numvfs_show() 469 u16 num_vfs; in sriov_numvfs_store() local 471 if (kstrtou16(buf, 0, &num_vfs) < 0) in sriov_numvfs_store() 474 if (num_vfs > pci_sriov_get_totalvfs(pdev)) in sriov_numvfs_store() 479 if (num_vfs == pdev->sriov->num_VFs) in sriov_numvfs_store() 496 if (num_vfs == 0) { in sriov_numvfs_store() 507 pdev->sriov->num_VFs, num_vfs); in sriov_numvfs_store() 513 ret = pdev->driver->sriov_configure(pdev, num_vfs); in sriov_numvfs_store() [all …]
|
| /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() 649 if (!is_valid_ether_addr(mac) || vf >= sriov_info->num_vfs) in hinic_ndo_set_vf_mac() 796 if (vf >= sriov_info->num_vfs || vlan >= VLAN_N_VID || qos > HINIC_MAX_QOS) in hinic_ndo_set_vf_vlan() 837 if (vf >= sriov_info->num_vfs) in hinic_ndo_set_vf_trust() 868 if (vf >= nic_dev->sriov_info.num_vfs) { in hinic_ndo_set_vf_bw() 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() [all …]
|
| H A D | hinic_sriov.h | 30 unsigned int num_vfs; member 105 int hinic_pci_sriov_configure(struct pci_dev *dev, int num_vfs);
|
| /linux/drivers/net/ethernet/amd/pds_core/ |
| H A D | main.c | 142 static int pdsc_sriov_configure(struct pci_dev *pdev, int num_vfs) in pdsc_sriov_configure() argument 148 if (num_vfs > 0) { in pdsc_sriov_configure() 149 pdsc->vfs = kzalloc_objs(struct pdsc_vf, num_vfs); 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()
|
| /linux/drivers/fpga/ |
| H A D | dfl-pci.c | 391 static int cci_pci_sriov_configure(struct pci_dev *pcidev, int num_vfs) in cci_pci_sriov_configure() argument 396 if (!num_vfs) { in cci_pci_sriov_configure() 412 ret = dfl_fpga_cdev_config_ports_vf(cdev, num_vfs); in cci_pci_sriov_configure() 416 ret = pci_enable_sriov(pcidev, num_vfs); in cci_pci_sriov_configure() 423 return num_vfs; in cci_pci_sriov_configure()
|
| /linux/drivers/vdpa/octeon_ep/ |
| H A D | octep_vdpa_main.c | 717 static int octep_sriov_enable(struct pci_dev *pdev, int num_vfs) in octep_sriov_enable() argument 726 ret = pci_enable_sriov(pdev, num_vfs); in octep_sriov_enable() 730 pf->enabled_vfs = num_vfs; in octep_sriov_enable() 737 if (++index == num_vfs) { in octep_sriov_enable() 749 return num_vfs; in octep_sriov_enable() 765 static int octep_vdpa_sriov_configure(struct pci_dev *pdev, int num_vfs) in octep_vdpa_sriov_configure() argument 767 if (num_vfs > 0) in octep_vdpa_sriov_configure() 768 return octep_sriov_enable(pdev, num_vfs); in octep_vdpa_sriov_configure()
|
| /linux/drivers/net/ethernet/marvell/octeon_ep/ |
| H A D | octep_pfvf_mbox.c | 264 int i = 0, num_vfs = 0, rings_per_vf = 0; in octep_setup_pfvf_mbox() local 267 num_vfs = oct->conf->sriov_cfg.active_vfs; in octep_setup_pfvf_mbox() 270 for (i = 0; i < num_vfs; i++) { in octep_setup_pfvf_mbox() 303 int num_vfs = oct->conf->sriov_cfg.active_vfs; in octep_delete_pfvf_mbox() local 306 for (i = 0; i < num_vfs; i++) { in octep_delete_pfvf_mbox()
|