/Linux-v4.19/drivers/net/ethernet/mellanox/mlx5/core/ |
D | sriov.c | 43 return !!sriov->num_vfs; in mlx5_sriov_is_enabled() 78 static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs) in mlx5_device_enable_sriov() argument 94 err = mlx5_eswitch_enable_sriov(dev->priv.eswitch, num_vfs, SRIOV_LEGACY); in mlx5_device_enable_sriov() 102 for (vf = 0; vf < num_vfs; vf++) { in mlx5_device_enable_sriov() 134 for (vf = 0; vf < sriov->num_vfs; vf++) { in mlx5_device_disable_sriov() 154 static int mlx5_pci_enable_sriov(struct pci_dev *pdev, int num_vfs) in mlx5_pci_enable_sriov() argument 164 err = pci_enable_sriov(pdev, num_vfs); in mlx5_pci_enable_sriov() 176 static int mlx5_sriov_enable(struct pci_dev *pdev, int num_vfs) in mlx5_sriov_enable() argument 182 err = mlx5_device_enable_sriov(dev, num_vfs); in mlx5_sriov_enable() 188 err = mlx5_pci_enable_sriov(pdev, num_vfs); in mlx5_sriov_enable() [all …]
|
D | eswitch_offloads.c | 712 ft_attr.max_fte = dev->priv.sriov.num_vfs + 2; in esw_create_offloads_table() 740 int nvports = priv->sriov.num_vfs + 2; in esw_create_vport_rx_group() 817 int err, err1, num_vfs = esw->dev->priv.sriov.num_vfs; in esw_offloads_start() local 825 err = mlx5_eswitch_enable_sriov(esw, num_vfs, SRIOV_OFFLOADS); in esw_offloads_start() 828 err1 = mlx5_eswitch_enable_sriov(esw, num_vfs, SRIOV_LEGACY); in esw_offloads_start() 834 num_vfs, in esw_offloads_start() 980 int err, err1, num_vfs = esw->dev->priv.sriov.num_vfs; in esw_offloads_stop() local 983 err = mlx5_eswitch_enable_sriov(esw, num_vfs, SRIOV_LEGACY); in esw_offloads_stop() 986 err1 = mlx5_eswitch_enable_sriov(esw, num_vfs, SRIOV_OFFLOADS); in esw_offloads_stop()
|
/Linux-v4.19/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() 286 int num_vfs, i; in fm10k_iov_suspend() local 289 num_vfs = iov_data ? iov_data->num_vfs : 0; in fm10k_iov_suspend() 296 for (i = 0; i < num_vfs; i++) { in fm10k_iov_suspend() 311 int num_vfs, i; in fm10k_iov_resume() local 314 num_vfs = iov_data ? iov_data->num_vfs : 0; in fm10k_iov_resume() 321 hw->iov.ops.assign_resources(hw, num_vfs, num_vfs); in fm10k_iov_resume() 335 for (i = 0; i < num_vfs; i++) { in fm10k_iov_resume() 368 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-v4.19/drivers/net/ethernet/broadcom/bnxt/ |
D | bnxt_sriov.c | 324 static int bnxt_set_vf_attr(struct bnxt *bp, int num_vfs) in bnxt_set_vf_attr() argument 329 for (i = 0; i < num_vfs; i++) { in bnxt_set_vf_attr() 336 static int bnxt_hwrm_func_vf_resource_free(struct bnxt *bp, int num_vfs) in bnxt_hwrm_func_vf_resource_free() argument 345 for (i = pf->first_vf_id; i < pf->first_vf_id + num_vfs; i++) { in bnxt_hwrm_func_vf_resource_free() 377 static int bnxt_alloc_vf_resources(struct bnxt *bp, int num_vfs) in bnxt_alloc_vf_resources() argument 382 bp->pf.vf = kcalloc(num_vfs, sizeof(struct bnxt_vf_info), GFP_KERNEL); in bnxt_alloc_vf_resources() 386 bnxt_set_vf_attr(bp, num_vfs); in bnxt_alloc_vf_resources() 388 size = num_vfs * BNXT_HWRM_REQ_MAX_SIZE; in bnxt_alloc_vf_resources() 402 for (j = 0; j < BNXT_HWRM_REQS_PER_PAGE && k < num_vfs; j++) { in bnxt_alloc_vf_resources() 443 static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, int num_vfs) in bnxt_hwrm_func_vf_resc_cfg() argument [all …]
|
D | bnxt_vfr.c | 283 u16 num_vfs, i; in bnxt_vf_reps_close() local 288 num_vfs = pci_num_vf(bp->pdev); in bnxt_vf_reps_close() 289 for (i = 0; i < num_vfs; i++) { in bnxt_vf_reps_close() 314 u16 num_vfs = pci_num_vf(bp->pdev); in __bnxt_vf_reps_destroy() local 318 for (i = 0; i < num_vfs; i++) { in __bnxt_vf_reps_destroy() 437 u16 *cfa_code_map = NULL, num_vfs = pci_num_vf(bp->pdev); in bnxt_vf_reps_create() local 442 bp->vf_reps = kcalloc(num_vfs, sizeof(vf_rep), GFP_KERNEL); in bnxt_vf_reps_create() 456 for (i = 0; i < num_vfs; i++) { in bnxt_vf_reps_create()
|
D | bnxt_sriov.h | 38 int bnxt_sriov_configure(struct pci_dev *pdev, int num_vfs);
|
/Linux-v4.19/arch/powerpc/platforms/pseries/ |
D | pci.c | 71 u16 num_vfs, in pseries_send_map_pe() argument 91 num_vfs * sizeof(struct pe_map_bar_entry)); in pseries_send_map_pe() 117 int pseries_associate_pes(struct pci_dev *pdev, u16 num_vfs) in pseries_associate_pes() argument 131 for (vf_index = 0; vf_index < num_vfs; vf_index++) { in pseries_associate_pes() 150 rc = pseries_send_map_pe(pdev, num_vfs, vf_pe_array); in pseries_associate_pes() 153 for (vf_index = 0; vf_index < num_vfs; vf_index++) in pseries_associate_pes() 161 int pseries_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs) in pseries_pci_sriov_enable() argument 176 if (max_config_vfs < num_vfs && num_vfs > MAX_VFS_FOR_MAP_PE) { in pseries_pci_sriov_enable() 179 num_vfs, (num_vfs > MAX_VFS_FOR_MAP_PE) ? in pseries_pci_sriov_enable() 185 pdn->pe_num_map = kmalloc_array(num_vfs, in pseries_pci_sriov_enable() [all …]
|
/Linux-v4.19/drivers/net/netdevsim/ |
D | netdev.c | 51 return ns->num_vfs; in nsim_num_vf() 60 static int nsim_vfs_enable(struct netdevsim *ns, unsigned int num_vfs) in nsim_vfs_enable() argument 62 ns->vfconfigs = kcalloc(num_vfs, sizeof(struct nsim_vf_config), in nsim_vfs_enable() 66 ns->num_vfs = num_vfs; in nsim_vfs_enable() 75 ns->num_vfs = 0; in nsim_vfs_disable() 83 unsigned int num_vfs; in nsim_numvfs_store() local 86 ret = kstrtouint(buf, 0, &num_vfs); in nsim_numvfs_store() 91 if (ns->num_vfs == num_vfs) in nsim_numvfs_store() 93 if (ns->num_vfs && num_vfs) { in nsim_numvfs_store() 98 if (num_vfs) { in nsim_numvfs_store() [all …]
|
/Linux-v4.19/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-v4.19/drivers/net/ethernet/netronome/nfp/ |
D | nfp_main.c | 255 static int nfp_pcie_sriov_enable(struct pci_dev *pdev, int num_vfs) in nfp_pcie_sriov_enable() argument 261 if (num_vfs > pf->limit_vfs) { in nfp_pcie_sriov_enable() 267 err = pci_enable_sriov(pdev, num_vfs); in nfp_pcie_sriov_enable() 275 err = nfp_app_sriov_enable(pf->app, num_vfs); in nfp_pcie_sriov_enable() 283 pf->num_vfs = num_vfs; in nfp_pcie_sriov_enable() 285 dev_dbg(&pdev->dev, "Created %d VFs.\n", pf->num_vfs); in nfp_pcie_sriov_enable() 288 return num_vfs; in nfp_pcie_sriov_enable() 317 pf->num_vfs = 0; in nfp_pcie_sriov_disable() 327 static int nfp_pcie_sriov_configure(struct pci_dev *pdev, int num_vfs) in nfp_pcie_sriov_configure() argument 329 if (num_vfs == 0) in nfp_pcie_sriov_configure() [all …]
|
D | nfp_app.h | 165 int (*sriov_enable)(struct nfp_app *app, int num_vfs); 419 static inline int nfp_app_sriov_enable(struct nfp_app *app, int num_vfs) in nfp_app_sriov_enable() argument 423 return app->type->sriov_enable(app, num_vfs); in nfp_app_sriov_enable()
|
/Linux-v4.19/drivers/net/ethernet/qlogic/qlcnic/ |
D | qlcnic_sriov_pf.c | 76 u32 num_vfs, max, temp; in qlcnic_sriov_pf_cal_res_limit() local 82 num_vfs = sriov->num_vfs; in qlcnic_sriov_pf_cal_res_limit() 83 max = num_vfs + 1; in qlcnic_sriov_pf_cal_res_limit() 96 temp = res->num_rx_ucast_mac_filters - num_macs * num_vfs; in qlcnic_sriov_pf_cal_res_limit() 98 temp = res->num_tx_mac_filters - num_macs * num_vfs; in qlcnic_sriov_pf_cal_res_limit() 100 temp = num_macs * num_vfs * QLCNIC_SRIOV_VF_MAX_MAC; in qlcnic_sriov_pf_cal_res_limit() 104 info->max_tx_ques = res->num_tx_queues - sriov->num_vfs; in qlcnic_sriov_pf_cal_res_limit() 163 total_fn = sriov->num_vfs + 1; in qlcnic_sriov_set_vf_max_vlan() 413 for (i = 0; i < sriov->num_vfs; i++) in qlcnic_sriov_pf_del_flr_queue() 567 static int qlcnic_sriov_pf_enable(struct qlcnic_adapter *adapter, int num_vfs) in qlcnic_sriov_pf_enable() argument [all …]
|
/Linux-v4.19/drivers/crypto/cavium/cpt/ |
D | cptpf_main.c | 23 static u32 num_vfs = 4; /* Default 4 VF enabled */ variable 24 module_param(num_vfs, uint, 0444); 25 MODULE_PARM_DESC(num_vfs, "Number of VFs to enable(1-16)"); 504 static int cpt_sriov_init(struct cpt_device *cpt, int num_vfs) in cpt_sriov_init() argument 517 cpt->num_vf_en = num_vfs; /* User requested VFs */ in cpt_sriov_init() 550 if (num_vfs > 16 || num_vfs < 4) { in cpt_probe() 552 num_vfs); in cpt_probe() 553 num_vfs = 4; in cpt_probe() 608 err = cpt_sriov_init(cpt, num_vfs); in cpt_probe()
|
/Linux-v4.19/drivers/net/ethernet/cavium/liquidio/ |
D | lio_vf_rep.c | 517 int i, num_vfs; in lio_vf_rep_create() local 525 num_vfs = oct->sriov_info.num_vfs_alloced; in lio_vf_rep_create() 527 oct->vf_rep_list.num_vfs = 0; in lio_vf_rep_create() 528 for (i = 0; i < num_vfs; i++) { in lio_vf_rep_create() 567 oct->vf_rep_list.num_vfs++; in lio_vf_rep_create() 582 for (i = 0; i < oct->vf_rep_list.num_vfs; i++) { in lio_vf_rep_create() 594 oct->vf_rep_list.num_vfs = 0; in lio_vf_rep_create() 612 for (i = 0; i < oct->vf_rep_list.num_vfs; i++) { in lio_vf_rep_destroy() 627 oct->vf_rep_list.num_vfs = 0; in lio_vf_rep_destroy()
|
/Linux-v4.19/arch/powerpc/platforms/powernv/ |
D | pci-ioda.c | 974 u16 num_vfs; in pnv_pci_vf_resource_shift() local 987 num_vfs = pdn->num_vfs; in pnv_pci_vf_resource_shift() 1002 res2.end = res2.start + (size * num_vfs) - 1; in pnv_pci_vf_resource_shift() 1006 i, &res2, res, num_vfs, offset); in pnv_pci_vf_resource_shift() 1030 num_vfs, offset); in pnv_pci_vf_resource_shift() 1300 static int pnv_pci_vf_release_m64(struct pci_dev *pdev, u16 num_vfs) in pnv_pci_vf_release_m64() argument 1315 m64_bars = num_vfs; in pnv_pci_vf_release_m64() 1333 static int pnv_pci_vf_assign_m64(struct pci_dev *pdev, u16 num_vfs) in pnv_pci_vf_assign_m64() argument 1355 m64_bars = num_vfs; in pnv_pci_vf_assign_m64() 1434 pnv_pci_vf_release_m64(pdev, num_vfs); in pnv_pci_vf_assign_m64() [all …]
|
/Linux-v4.19/drivers/net/ethernet/sfc/ |
D | ef10_sriov.c | 384 static int efx_ef10_pci_sriov_enable(struct efx_nic *efx, int num_vfs) in efx_ef10_pci_sriov_enable() argument 389 efx->vf_count = num_vfs; in efx_ef10_pci_sriov_enable() 395 rc = pci_enable_sriov(dev, num_vfs); in efx_ef10_pci_sriov_enable() 430 int efx_ef10_sriov_configure(struct efx_nic *efx, int num_vfs) in efx_ef10_sriov_configure() argument 432 if (num_vfs == 0) in efx_ef10_sriov_configure() 435 return efx_ef10_pci_sriov_enable(efx, num_vfs); in efx_ef10_sriov_configure()
|
D | siena_sriov.h | 44 int efx_siena_sriov_configure(struct efx_nic *efx, int num_vfs);
|
/Linux-v4.19/drivers/infiniband/hw/bnxt_re/ |
D | main.c | 104 u32 num_vfs; in bnxt_re_set_resource_limits() local 123 if (rdev->num_vfs) { in bnxt_re_set_resource_limits() 129 num_vfs = 100 * rdev->num_vfs; in bnxt_re_set_resource_limits() 130 vf_qps = (rdev->qplib_ctx.qpc_count * vf_pct) / num_vfs; in bnxt_re_set_resource_limits() 131 vf_srqs = (rdev->qplib_ctx.srqc_count * vf_pct) / num_vfs; in bnxt_re_set_resource_limits() 132 vf_cqs = (rdev->qplib_ctx.cq_count * vf_pct) / num_vfs; in bnxt_re_set_resource_limits() 143 vf_mrws = rdev->qplib_ctx.mrw_count * vf_pct / num_vfs; in bnxt_re_set_resource_limits() 146 BNXT_RE_RESVD_MR_FOR_PF) / rdev->num_vfs; in bnxt_re_set_resource_limits() 165 static void bnxt_re_sriov_config(void *p, int num_vfs) in bnxt_re_sriov_config() argument 172 rdev->num_vfs = num_vfs; in bnxt_re_sriov_config()
|
/Linux-v4.19/drivers/net/ethernet/mellanox/mlx4/ |
D | port.c | 1120 dev->persist->num_vfs + 1); in mlx4_get_slave_num_gids() 1122 vfs = bitmap_weight(slaves_pport.slaves, dev->persist->num_vfs + 1) - 1; in mlx4_get_slave_num_gids() 1157 dev->persist->num_vfs + 1); in mlx4_get_base_gid_ix() 1160 vfs = bitmap_weight(slaves_pport.slaves, dev->persist->num_vfs + 1) - 1; in mlx4_get_base_gid_ix() 1211 if (slave < 0 || slave > dev->persist->num_vfs) in mlx4_reset_roce_gids() 1864 unsigned num_vfs; in mlx4_get_slave_from_roce_gid() local 1871 num_vfs = bitmap_weight(slaves_pport.slaves, in mlx4_get_slave_from_roce_gid() 1872 dev->persist->num_vfs + 1) - 1; in mlx4_get_slave_from_roce_gid() 1888 else if (found_ix < MLX4_ROCE_PF_GIDS + (vf_gids % num_vfs) * in mlx4_get_slave_from_roce_gid() 1889 (vf_gids / num_vfs + 1)) in mlx4_get_slave_from_roce_gid() [all …]
|
/Linux-v4.19/drivers/net/ethernet/netronome/nfp/flower/ |
D | main.c | 327 static int nfp_flower_sriov_enable(struct nfp_app *app, int num_vfs) in nfp_flower_sriov_enable() argument 336 NFP_REPR_TYPE_VF, num_vfs); in nfp_flower_sriov_enable() 473 if (app->pf->num_vfs) in nfp_flower_vnic_clean() 498 if (app->pf->num_vfs) { in nfp_flower_vnic_init() 502 app->pf->num_vfs); in nfp_flower_vnic_init()
|
/Linux-v4.19/drivers/net/ethernet/netronome/nfp/nic/ |
D | main.c | 52 static int nfp_nic_sriov_enable(struct nfp_app *app, int num_vfs) in nfp_nic_sriov_enable() argument
|
/Linux-v4.19/drivers/net/ethernet/emulex/benet/ |
D | be_main.c | 36 static unsigned int num_vfs; variable 37 module_param(num_vfs, uint, 0444); 38 MODULE_PARM_DESC(num_vfs, "Number of PCI VFs to initialize"); 1868 if (!is_valid_ether_addr(mac) || vf >= adapter->num_vfs) in be_set_vf_mac() 1908 if (vf >= adapter->num_vfs) in be_get_vf_config() 1989 if (vf >= adapter->num_vfs || vlan > 4095 || qos > 7) in be_set_vf_vlan() 2025 if (vf >= adapter->num_vfs) in be_set_vf_tx_rate() 2084 if (vf >= adapter->num_vfs) in be_set_vf_link_state() 2109 if (vf >= adapter->num_vfs) in be_set_vf_spoofchk() 3942 adapter->num_vfs = 0; in be_vf_clear() [all …]
|
/Linux-v4.19/drivers/virtio/ |
D | virtio_pci_common.c | 593 static int virtio_pci_sriov_configure(struct pci_dev *pci_dev, int num_vfs) in virtio_pci_sriov_configure() argument 608 if (num_vfs == 0) { in virtio_pci_sriov_configure() 613 ret = pci_enable_sriov(pci_dev, num_vfs); in virtio_pci_sriov_configure() 617 return num_vfs; in virtio_pci_sriov_configure()
|
/Linux-v4.19/drivers/pci/ |
D | pci-sysfs.c | 585 u16 num_vfs; in sriov_numvfs_store() local 587 ret = kstrtou16(buf, 0, &num_vfs); in sriov_numvfs_store() 591 if (num_vfs > pci_sriov_get_totalvfs(pdev)) in sriov_numvfs_store() 596 if (num_vfs == pdev->sriov->num_VFs) in sriov_numvfs_store() 606 if (num_vfs == 0) { in sriov_numvfs_store() 615 pdev->sriov->num_VFs, num_vfs); in sriov_numvfs_store() 620 ret = pdev->driver->sriov_configure(pdev, num_vfs); in sriov_numvfs_store() 624 if (ret != num_vfs) in sriov_numvfs_store() 626 num_vfs, ret); in sriov_numvfs_store()
|