| /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
|
| H A D | nitrox_mbx.c | 184 ndev->iov.vfdev = kcalloc(ndev->iov.num_vfs, in nitrox_mbox_init() 189 for (i = 0; i < ndev->iov.num_vfs; i++) { in nitrox_mbox_init()
|
| /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() 196 mlx5_device_disable_sriov(dev, num_vfs, true, true); in mlx5_sriov_enable() [all …]
|
| H A D | eswitch.c | 1086 mlx5_esw_for_each_vf_vport(esw, i, vport, esw->esw_funcs.num_vfs) { in mlx5_eswitch_clear_vf_vports_info() 1205 void mlx5_eswitch_unload_vf_vports(struct mlx5_eswitch *esw, u16 num_vfs) in mlx5_eswitch_unload_vf_vports() argument 1210 mlx5_esw_for_each_vf_vport(esw, i, vport, num_vfs) { in mlx5_eswitch_unload_vf_vports() 1267 int mlx5_eswitch_load_vf_vports(struct mlx5_eswitch *esw, u16 num_vfs, in mlx5_eswitch_load_vf_vports() argument 1274 mlx5_esw_for_each_vf_vport(esw, i, vport, num_vfs) { in mlx5_eswitch_load_vf_vports() 1283 mlx5_eswitch_unload_vf_vports(esw, num_vfs); in mlx5_eswitch_load_vf_vports() 1372 ret = mlx5_eswitch_load_vf_vports(esw, esw->esw_funcs.num_vfs, in mlx5_eswitch_enable_pf_vf_vports() 1385 mlx5_eswitch_unload_vf_vports(esw, esw->esw_funcs.num_vfs); in mlx5_eswitch_enable_pf_vf_vports() 1408 mlx5_eswitch_unload_vf_vports(esw, esw->esw_funcs.num_vfs); in mlx5_eswitch_disable_pf_vf_vports() 1447 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_array(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()
|
| H A D | ef10_sriov.c | 377 static int efx_ef10_pci_sriov_enable(struct efx_nic *efx, int num_vfs) in efx_ef10_pci_sriov_enable() argument 382 efx->vf_count = num_vfs; in efx_ef10_pci_sriov_enable() 388 rc = pci_enable_sriov(dev, num_vfs); in efx_ef10_pci_sriov_enable() 434 int efx_ef10_sriov_configure(struct efx_nic *efx, int num_vfs) in efx_ef10_sriov_configure() argument 436 if (num_vfs == 0) in efx_ef10_sriov_configure() 439 return efx_ef10_pci_sriov_enable(efx, num_vfs); in efx_ef10_sriov_configure()
|
| H A D | ef100_sriov.h | 13 int efx_ef100_sriov_configure(struct efx_nic *efx, int num_vfs);
|
| /linux/drivers/gpu/drm/xe/ |
| H A D | xe_gt_sriov_pf_config.c | 599 static int pf_config_bulk_set_u64_done(struct xe_gt *gt, unsigned int first, unsigned int num_vfs, in pf_config_bulk_set_u64_done() argument 606 xe_gt_assert(gt, num_vfs); in pf_config_bulk_set_u64_done() 609 if (num_vfs == 1) in pf_config_bulk_set_u64_done() 614 first, first + num_vfs - 1, what); in pf_config_bulk_set_u64_done() 625 first, first + num_vfs - 1, value, size, what); in pf_config_bulk_set_u64_done() 641 unsigned int num_vfs, u64 size) in xe_gt_sriov_pf_config_bulk_set_ggtt() argument 649 if (!num_vfs) in xe_gt_sriov_pf_config_bulk_set_ggtt() 653 for (n = vfid; n < vfid + num_vfs; n++) { in xe_gt_sriov_pf_config_bulk_set_ggtt() 660 return pf_config_bulk_set_u64_done(gt, vfid, num_vfs, size, in xe_gt_sriov_pf_config_bulk_set_ggtt() 680 static u64 pf_estimate_fair_ggtt(struct xe_gt *gt, unsigned int num_vfs) in pf_estimate_fair_ggtt() argument [all …]
|
| /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/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() 53 unsigned int num_vfs) in __ixgbe_enable_sriov() argument 68 adapter->vfinfo = kcalloc(num_vfs, sizeof(struct vf_data_storage), in __ixgbe_enable_sriov() 73 adapter->num_vfs = num_vfs; in __ixgbe_enable_sriov() 75 ixgbe_alloc_vf_macvlans(adapter, num_vfs); in __ixgbe_enable_sriov() 76 adapter->ring_feature[RING_F_VMDQ].offset = num_vfs; in __ixgbe_enable_sriov() 83 if ((adapter->hw.mac.type == ixgbe_mac_82599EB) && (num_vfs < 16)) { in __ixgbe_enable_sriov() 86 } else if (num_vfs < 32) { in __ixgbe_enable_sriov() 98 for (i = 0; i < num_vfs; i++) { in __ixgbe_enable_sriov() [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/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/freescale/enetc/ |
| H A D | enetc_msg.c | 47 for (i = 0; i < pf->num_vfs; i++) { in enetc_msg_task() 129 for (i = 0; i < pf->num_vfs; i++) { in enetc_msg_psi_init() 159 for (i = 0; i < pf->num_vfs; i++) in enetc_msg_psi_free()
|
| H A D | enetc_pf.c | 527 static int enetc_sriov_configure(struct pci_dev *pdev, int num_vfs) in enetc_sriov_configure() argument 533 if (!num_vfs) { in enetc_sriov_configure() 535 pf->num_vfs = 0; in enetc_sriov_configure() 538 pf->num_vfs = num_vfs; in enetc_sriov_configure() 546 err = pci_enable_sriov(pdev, num_vfs); in enetc_sriov_configure() 553 return num_vfs; in enetc_sriov_configure() 558 pf->num_vfs = 0; in enetc_sriov_configure() 563 #define enetc_sriov_configure(pdev, num_vfs) (void)0 argument 1058 if (pf->num_vfs) in enetc_pf_remove()
|
| /linux/drivers/net/netdevsim/ |
| H A D | bus.c | 35 unsigned int num_vfs; in nsim_bus_dev_numvfs_store() local 38 ret = kstrtouint(buf, 0, &num_vfs); in nsim_bus_dev_numvfs_store() 45 ret = nsim_drv_configure_vfs(nsim_bus_dev, num_vfs); in nsim_bus_dev_numvfs_store() 57 return sprintf(buf, "%u\n", nsim_bus_dev->num_vfs); in nsim_bus_dev_numvfs_show() 426 return nsim_bus_dev->num_vfs; in nsim_num_vf()
|
| /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()
|
| /linux/drivers/net/ethernet/mellanox/mlx4/ |
| H A D | port.c | 1100 dev->persist->num_vfs + 1); in mlx4_get_slave_num_gids() 1102 vfs = bitmap_weight(slaves_pport.slaves, dev->persist->num_vfs + 1) - 1; in mlx4_get_slave_num_gids() 1137 dev->persist->num_vfs + 1); in mlx4_get_base_gid_ix() 1140 vfs = bitmap_weight(slaves_pport.slaves, dev->persist->num_vfs + 1) - 1; in mlx4_get_base_gid_ix() 1191 if (slave < 0 || slave > dev->persist->num_vfs) in mlx4_reset_roce_gids() 1844 unsigned num_vfs; in mlx4_get_slave_from_roce_gid() local 1851 num_vfs = bitmap_weight(slaves_pport.slaves, in mlx4_get_slave_from_roce_gid() 1852 dev->persist->num_vfs + 1) - 1; in mlx4_get_slave_from_roce_gid() 1868 else if (found_ix < MLX4_ROCE_PF_GIDS + (vf_gids % num_vfs) * in mlx4_get_slave_from_roce_gid() 1869 (vf_gids / num_vfs + 1)) in mlx4_get_slave_from_roce_gid() [all …]
|
| /linux/drivers/net/ethernet/emulex/benet/ |
| H A D | be_main.c | 30 static unsigned int num_vfs; variable 31 module_param(num_vfs, uint, 0444); 32 MODULE_PARM_DESC(num_vfs, "Number of PCI VFs to initialize"); 1865 if (!is_valid_ether_addr(mac) || vf >= adapter->num_vfs) in be_set_vf_mac() 1905 if (vf >= adapter->num_vfs) in be_get_vf_config() 1986 if (vf >= adapter->num_vfs || vlan > 4095 || qos > 7) in be_set_vf_vlan() 2022 if (vf >= adapter->num_vfs) in be_set_vf_tx_rate() 2081 if (vf >= adapter->num_vfs) in be_set_vf_link_state() 2106 if (vf >= adapter->num_vfs) in be_set_vf_spoofchk() 3939 adapter->num_vfs = 0; in be_vf_clear() [all …]
|