Lines Matching +full:sr +full:- +full:iov

1 // SPDX-License-Identifier: GPL-2.0
3 * PCI Express I/O Virtualization (IOV) support
4 * Single Root IOV 1.0
22 #define VIRTFN_ID_LEN 17 /* "virtfn%u\0" for 2^32 - 1 */
26 if (!dev->is_physfn) in pci_iov_virtfn_bus()
27 return -EINVAL; in pci_iov_virtfn_bus()
28 return dev->bus->number + ((dev->devfn + dev->sriov->offset + in pci_iov_virtfn_bus()
29 dev->sriov->stride * vf_id) >> 8); in pci_iov_virtfn_bus()
34 if (!dev->is_physfn) in pci_iov_virtfn_devfn()
35 return -EINVAL; in pci_iov_virtfn_devfn()
36 return (dev->devfn + dev->sriov->offset + in pci_iov_virtfn_devfn()
37 dev->sriov->stride * vf_id) & 0xff; in pci_iov_virtfn_devfn()
45 if (!dev->is_virtfn) in pci_iov_vf_id()
46 return -EINVAL; in pci_iov_vf_id()
49 return (pci_dev_id(dev) - (pci_dev_id(pf) + pf->sriov->offset)) / in pci_iov_vf_id()
50 pf->sriov->stride; in pci_iov_vf_id()
55 * pci_iov_get_pf_drvdata - Return the drvdata of a PF
74 if (!dev->is_virtfn) in pci_iov_get_pf_drvdata()
75 return ERR_PTR(-EINVAL); in pci_iov_get_pf_drvdata()
76 pf_dev = dev->physfn; in pci_iov_get_pf_drvdata()
77 if (pf_dev->driver != pf_driver) in pci_iov_get_pf_drvdata()
78 return ERR_PTR(-EINVAL); in pci_iov_get_pf_drvdata()
84 * Per SR-IOV spec sec 3.3.10 and 3.3.11, First VF Offset and VF Stride may
87 * Update iov->offset and iov->stride when NumVFs is written.
91 struct pci_sriov *iov = dev->sriov; in pci_iov_set_numvfs() local
93 pci_write_config_word(dev, iov->pos + PCI_SRIOV_NUM_VF, nr_virtfn); in pci_iov_set_numvfs()
94 pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_OFFSET, &iov->offset); in pci_iov_set_numvfs()
95 pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_STRIDE, &iov->stride); in pci_iov_set_numvfs()
107 struct pci_sriov *iov = dev->sriov; in compute_max_vf_buses() local
110 for (nr_virtfn = iov->total_VFs; nr_virtfn; nr_virtfn--) { in compute_max_vf_buses()
112 if (!iov->offset || (nr_virtfn > 1 && !iov->stride)) { in compute_max_vf_buses()
113 rc = -EIO; in compute_max_vf_buses()
117 busnr = pci_iov_virtfn_bus(dev, nr_virtfn - 1); in compute_max_vf_buses()
118 if (busnr > iov->max_VF_buses) in compute_max_vf_buses()
119 iov->max_VF_buses = busnr; in compute_max_vf_buses()
131 if (bus->number == busnr) in virtfn_add_bus()
149 if (physbus != virtbus && list_empty(&virtbus->devices)) in virtfn_remove_bus()
155 if (!dev->is_physfn) in pci_iov_resource_size()
158 return dev->sriov->barsz[pci_resource_num_to_vf_bar(resno)]; in pci_iov_resource_size()
165 pci_warn(dev, "%s is not an IOV resource\n", in pci_iov_resource_set_size()
170 dev->sriov->barsz[pci_resource_num_to_vf_bar(resno)] = size; in pci_iov_resource_set_size()
177 pci_read_config_word(dev, dev->sriov->pos + PCI_SRIOV_CTRL, &cmd); in pci_iov_is_memory_decoding_enabled()
184 struct pci_dev *physfn = virtfn->physfn; in pci_read_vf_config_common()
196 &physfn->sriov->class); in pci_read_vf_config_common()
198 &physfn->sriov->hdr_type); in pci_read_vf_config_common()
200 &physfn->sriov->subsystem_vendor); in pci_read_vf_config_common()
202 &physfn->sriov->subsystem_device); in pci_read_vf_config_common()
212 rc = sysfs_create_link(&dev->dev.kobj, &virtfn->dev.kobj, buf); in pci_iov_sysfs_link()
215 rc = sysfs_create_link(&virtfn->dev.kobj, &dev->dev.kobj, "physfn"); in pci_iov_sysfs_link()
219 kobject_uevent(&virtfn->dev.kobj, KOBJ_CHANGE); in pci_iov_sysfs_link()
224 sysfs_remove_link(&dev->dev.kobj, buf); in pci_iov_sysfs_link()
238 if (!pdev->driver || !pdev->driver->sriov_get_vf_total_msix) in sriov_vf_total_msix_show()
241 vf_total_msix = pdev->driver->sriov_get_vf_total_msix(pdev); in sriov_vf_total_msix_show()
257 return -EINVAL; in sriov_vf_msix_count_store()
260 return -EINVAL; in sriov_vf_msix_count_store()
262 device_lock(&pdev->dev); in sriov_vf_msix_count_store()
263 if (!pdev->driver || !pdev->driver->sriov_set_msix_vec_count) { in sriov_vf_msix_count_store()
264 ret = -EOPNOTSUPP; in sriov_vf_msix_count_store()
268 device_lock(&vf_dev->dev); in sriov_vf_msix_count_store()
269 if (vf_dev->driver) { in sriov_vf_msix_count_store()
272 * itself based on the current MSI-X vector count. Changing in sriov_vf_msix_count_store()
275 ret = -EBUSY; in sriov_vf_msix_count_store()
279 ret = pdev->driver->sriov_set_msix_vec_count(vf_dev, val); in sriov_vf_msix_count_store()
282 device_unlock(&vf_dev->dev); in sriov_vf_msix_count_store()
284 device_unlock(&pdev->dev); in sriov_vf_msix_count_store()
303 if (!pdev->is_virtfn) in sriov_vf_attrs_are_visible()
306 return a->mode; in sriov_vf_attrs_are_visible()
317 struct pci_sriov *iov = dev->sriov; in pci_iov_scan_device() local
323 return ERR_PTR(-ENOMEM); in pci_iov_scan_device()
325 virtfn->devfn = pci_iov_virtfn_devfn(dev, id); in pci_iov_scan_device()
326 virtfn->vendor = dev->vendor; in pci_iov_scan_device()
327 virtfn->device = iov->vf_device; in pci_iov_scan_device()
328 virtfn->is_virtfn = 1; in pci_iov_scan_device()
329 virtfn->physfn = pci_dev_get(dev); in pci_iov_scan_device()
330 virtfn->no_command_memory = 1; in pci_iov_scan_device()
338 pci_bus_put(virtfn->bus); in pci_iov_scan_device()
354 bus = virtfn_add_bus(dev->bus, pci_iov_virtfn_bus(dev, id)); in pci_iov_add_virtfn()
356 rc = -ENOMEM; in pci_iov_add_virtfn()
366 virtfn->dev.parent = dev->dev.parent; in pci_iov_add_virtfn()
367 virtfn->multifunction = 0; in pci_iov_add_virtfn()
372 res = &dev->resource[idx]; in pci_iov_add_virtfn()
373 if (!res->parent) in pci_iov_add_virtfn()
375 virtfn->resource[i].name = pci_name(virtfn); in pci_iov_add_virtfn()
376 virtfn->resource[i].flags = res->flags; in pci_iov_add_virtfn()
378 resource_set_range(&virtfn->resource[i], in pci_iov_add_virtfn()
379 res->start + size * id, size); in pci_iov_add_virtfn()
380 rc = request_resource(res, &virtfn->resource[i]); in pci_iov_add_virtfn()
384 pci_device_add(virtfn, virtfn->bus); in pci_iov_add_virtfn()
397 virtfn_remove_bus(dev->bus, bus); in pci_iov_add_virtfn()
408 virtfn = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus), in pci_iov_remove_virtfn()
415 sysfs_remove_link(&dev->dev.kobj, buf); in pci_iov_remove_virtfn()
421 if (virtfn->dev.kobj.sd) in pci_iov_remove_virtfn()
422 sysfs_remove_link(&virtfn->dev.kobj, "physfn"); in pci_iov_remove_virtfn()
425 virtfn_remove_bus(dev->bus, virtfn->bus); in pci_iov_remove_virtfn()
449 device_lock(&pdev->dev); in sriov_numvfs_show()
450 num_vfs = pdev->sriov->num_VFs; in sriov_numvfs_show()
451 device_unlock(&pdev->dev); in sriov_numvfs_show()
472 return -EINVAL; in sriov_numvfs_store()
475 return -ERANGE; in sriov_numvfs_store()
477 device_lock(&pdev->dev); in sriov_numvfs_store()
479 if (num_vfs == pdev->sriov->num_VFs) in sriov_numvfs_store()
483 if (!pdev->driver) { in sriov_numvfs_store()
484 pci_info(pdev, "no driver bound to device; cannot configure SR-IOV\n"); in sriov_numvfs_store()
485 ret = -ENOENT; in sriov_numvfs_store()
490 if (!pdev->driver->sriov_configure) { in sriov_numvfs_store()
491 pci_info(pdev, "driver does not support SR-IOV configuration via sysfs\n"); in sriov_numvfs_store()
492 ret = -ENOENT; in sriov_numvfs_store()
498 ret = pdev->driver->sriov_configure(pdev, 0); in sriov_numvfs_store()
503 if (pdev->sriov->num_VFs) { in sriov_numvfs_store()
505 pdev->sriov->num_VFs, num_vfs); in sriov_numvfs_store()
506 ret = -EBUSY; in sriov_numvfs_store()
510 ret = pdev->driver->sriov_configure(pdev, num_vfs); in sriov_numvfs_store()
519 device_unlock(&pdev->dev); in sriov_numvfs_store()
533 return sysfs_emit(buf, "%u\n", pdev->sriov->offset); in sriov_offset_show()
542 return sysfs_emit(buf, "%u\n", pdev->sriov->stride); in sriov_stride_show()
551 return sysfs_emit(buf, "%x\n", pdev->sriov->vf_device); in sriov_vf_device_show()
560 return sysfs_emit(buf, "%u\n", pdev->sriov->drivers_autoprobe); in sriov_drivers_autoprobe_show()
571 return -EINVAL; in sriov_drivers_autoprobe_store()
573 pdev->sriov->drivers_autoprobe = drivers_autoprobe; in sriov_drivers_autoprobe_store()
606 return a->mode; in sriov_pf_attrs_are_visible()
629 if (dev->no_vf_scan) in sriov_add_vfs()
641 while (i--) in sriov_add_vfs()
656 struct pci_sriov *iov = dev->sriov; in sriov_enable() local
663 if (iov->num_VFs) in sriov_enable()
664 return -EINVAL; in sriov_enable()
666 pci_read_config_word(dev, iov->pos + PCI_SRIOV_INITIAL_VF, &initial); in sriov_enable()
667 if (initial > iov->total_VFs || in sriov_enable()
668 (!(iov->cap & PCI_SRIOV_CAP_VFM) && (initial != iov->total_VFs))) in sriov_enable()
669 return -EIO; in sriov_enable()
671 if (nr_virtfn < 0 || nr_virtfn > iov->total_VFs || in sriov_enable()
672 (!(iov->cap & PCI_SRIOV_CAP_VFM) && (nr_virtfn > initial))) in sriov_enable()
673 return -EINVAL; in sriov_enable()
681 res = &dev->resource[idx]; in sriov_enable()
684 if (res->parent) in sriov_enable()
687 if (nres != iov->nres) { in sriov_enable()
688 pci_err(dev, "not enough MMIO resources for SR-IOV\n"); in sriov_enable()
689 return -ENOMEM; in sriov_enable()
692 bus = pci_iov_virtfn_bus(dev, nr_virtfn - 1); in sriov_enable()
693 if (bus > dev->bus->busn_res.end) { in sriov_enable()
695 nr_virtfn, bus, &dev->bus->busn_res); in sriov_enable()
696 return -ENOMEM; in sriov_enable()
700 pci_err(dev, "SR-IOV: IOV BARS not allocated\n"); in sriov_enable()
701 return -ENOMEM; in sriov_enable()
704 if (iov->link != dev->devfn) { in sriov_enable()
705 pdev = pci_get_slot(dev->bus, iov->link); in sriov_enable()
707 return -ENODEV; in sriov_enable()
709 if (!pdev->is_physfn) { in sriov_enable()
711 return -ENOSYS; in sriov_enable()
714 rc = sysfs_create_link(&dev->dev.kobj, in sriov_enable()
715 &pdev->dev.kobj, "dep_link"); in sriov_enable()
721 iov->initial_VFs = initial; in sriov_enable()
732 iov->ctrl |= PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE; in sriov_enable()
734 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl); in sriov_enable()
742 kobject_uevent(&dev->dev.kobj, KOBJ_CHANGE); in sriov_enable()
743 iov->num_VFs = nr_virtfn; in sriov_enable()
748 iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE); in sriov_enable()
750 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl); in sriov_enable()
756 if (iov->link != dev->devfn) in sriov_enable()
757 sysfs_remove_link(&dev->dev.kobj, "dep_link"); in sriov_enable()
765 struct pci_sriov *iov = dev->sriov; in sriov_del_vfs() local
769 for (i = 0; i < iov->num_VFs; i++) in sriov_del_vfs()
776 struct pci_sriov *iov = dev->sriov; in sriov_disable() local
778 if (!iov->num_VFs) in sriov_disable()
782 iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE); in sriov_disable()
784 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl); in sriov_disable()
790 if (iov->link != dev->devfn) in sriov_disable()
791 sysfs_remove_link(&dev->dev.kobj, "dep_link"); in sriov_disable()
793 iov->num_VFs = 0; in sriov_disable()
804 struct pci_sriov *iov; in sriov_init() local
817 list_for_each_entry(pdev, &dev->bus->devices, bus_list) in sriov_init()
818 if (pdev->is_physfn) in sriov_init()
822 if (pci_ari_enabled(dev->bus)) in sriov_init()
833 i = PAGE_SHIFT > 12 ? PAGE_SHIFT - 12 : 0; in sriov_init()
834 pgsz &= ~((1 << i) - 1); in sriov_init()
836 return -EIO; in sriov_init()
838 pgsz &= ~(pgsz - 1); in sriov_init()
841 iov = kzalloc(sizeof(*iov), GFP_KERNEL); in sriov_init()
842 if (!iov) in sriov_init()
843 return -ENOMEM; in sriov_init()
845 /* Sizing SR-IOV BARs with VF Enable cleared - no decode */ in sriov_init()
853 res = &dev->resource[idx]; in sriov_init()
860 if (res->flags & IORESOURCE_PCI_FIXED) in sriov_init()
861 bar64 = (res->flags & IORESOURCE_MEM_64) ? 1 : 0; in sriov_init()
866 if (!res->flags) in sriov_init()
868 if (resource_size(res) & (PAGE_SIZE - 1)) { in sriov_init()
869 rc = -EIO; in sriov_init()
872 iov->barsz[i] = resource_size(res); in sriov_init()
880 iov->pos = pos; in sriov_init()
881 iov->nres = nres; in sriov_init()
882 iov->ctrl = ctrl; in sriov_init()
883 iov->total_VFs = total; in sriov_init()
884 iov->driver_max_VFs = total; in sriov_init()
885 pci_read_config_word(dev, pos + PCI_SRIOV_VF_DID, &iov->vf_device); in sriov_init()
886 iov->pgsz = pgsz; in sriov_init()
887 iov->self = dev; in sriov_init()
888 iov->drivers_autoprobe = true; in sriov_init()
889 pci_read_config_dword(dev, pos + PCI_SRIOV_CAP, &iov->cap); in sriov_init()
890 pci_read_config_byte(dev, pos + PCI_SRIOV_FUNC_LINK, &iov->link); in sriov_init()
892 iov->link = PCI_DEVFN(PCI_SLOT(dev->devfn), iov->link); in sriov_init()
893 iov->vf_rebar_cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_VF_REBAR); in sriov_init()
896 iov->dev = pci_dev_get(pdev); in sriov_init()
898 iov->dev = dev; in sriov_init()
900 dev->sriov = iov; in sriov_init()
901 dev->is_physfn = 1; in sriov_init()
909 dev->sriov = NULL; in sriov_init()
910 dev->is_physfn = 0; in sriov_init()
913 res = &dev->resource[pci_resource_num_from_vf_bar(i)]; in sriov_init()
914 res->flags = 0; in sriov_init()
917 kfree(iov); in sriov_init()
923 BUG_ON(dev->sriov->num_VFs); in sriov_release()
925 if (dev != dev->sriov->dev) in sriov_release()
926 pci_dev_put(dev->sriov->dev); in sriov_release()
928 kfree(dev->sriov); in sriov_release()
929 dev->sriov = NULL; in sriov_release()
949 size = pci_rebar_bytes_to_size(dev->sriov->barsz[bar_idx]); in sriov_restore_vf_rebar_state()
960 struct pci_sriov *iov = dev->sriov; in sriov_restore_state() local
962 pci_read_config_word(dev, iov->pos + PCI_SRIOV_CTRL, &ctrl); in sriov_restore_state()
971 ctrl |= iov->ctrl & PCI_SRIOV_CTRL_ARI; in sriov_restore_state()
972 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, ctrl); in sriov_restore_state()
977 pci_write_config_dword(dev, iov->pos + PCI_SRIOV_SYS_PGSIZE, iov->pgsz); in sriov_restore_state()
978 pci_iov_set_numvfs(dev, iov->num_VFs); in sriov_restore_state()
979 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl); in sriov_restore_state()
980 if (iov->ctrl & PCI_SRIOV_CTRL_VFE) in sriov_restore_state()
985 * pci_iov_init - initialize the IOV capability
995 return -ENODEV; in pci_iov_init()
1001 return -ENODEV; in pci_iov_init()
1005 * pci_iov_release - release resources used by the IOV capability
1010 if (dev->is_physfn) in pci_iov_release()
1015 * pci_iov_remove - clean up SR-IOV state after PF driver is detached
1020 struct pci_sriov *iov = dev->sriov; in pci_iov_remove() local
1022 if (!dev->is_physfn) in pci_iov_remove()
1025 iov->driver_max_VFs = iov->total_VFs; in pci_iov_remove()
1026 if (iov->num_VFs) in pci_iov_remove()
1027 pci_warn(dev, "driver left SR-IOV enabled after remove\n"); in pci_iov_remove()
1031 * pci_iov_update_resource - update a VF BAR
1035 * Update a VF BAR in the SR-IOV capability of a PF.
1039 struct pci_sriov *iov = dev->is_physfn ? dev->sriov : NULL; in pci_iov_update_resource() local
1049 * including VFs and non-SR-IOV devices. If this is not a PF, we in pci_iov_update_resource()
1052 if (!iov) in pci_iov_update_resource()
1055 pci_read_config_word(dev, iov->pos + PCI_SRIOV_CTRL, &cmd); in pci_iov_update_resource()
1057 dev_WARN(&dev->dev, "can't update enabled VF BAR%d %pR\n", in pci_iov_update_resource()
1063 * Ignore unimplemented BARs, unused resource slots for 64-bit in pci_iov_update_resource()
1064 * BARs, and non-movable resources, e.g., those described via in pci_iov_update_resource()
1067 if (!res->flags) in pci_iov_update_resource()
1070 if (res->flags & IORESOURCE_UNSET) in pci_iov_update_resource()
1073 if (res->flags & IORESOURCE_PCI_FIXED) in pci_iov_update_resource()
1076 pcibios_resource_to_bus(dev->bus, &region, res); in pci_iov_update_resource()
1078 new |= res->flags & ~PCI_BASE_ADDRESS_MEM_MASK; in pci_iov_update_resource()
1080 reg = iov->pos + PCI_SRIOV_BAR + 4 * vf_bar; in pci_iov_update_resource()
1082 if (res->flags & IORESOURCE_MEM_64) { in pci_iov_update_resource()
1095 * pci_sriov_resource_alignment - get resource alignment for VF BAR
1099 * Returns the alignment of the VF BAR found in the SR-IOV capability.
1110 * pci_restore_iov_state - restore the state of the IOV capability
1115 if (dev->is_physfn) { in pci_restore_iov_state()
1122 * pci_vf_drivers_autoprobe - set PF property drivers_autoprobe for VFs
1128 if (dev->is_physfn) in pci_vf_drivers_autoprobe()
1129 dev->sriov->drivers_autoprobe = auto_probe; in pci_vf_drivers_autoprobe()
1133 * pci_iov_bus_range - find bus range used by Virtual Function
1144 list_for_each_entry(dev, &bus->devices, bus_list) { in pci_iov_bus_range()
1145 if (!dev->is_physfn) in pci_iov_bus_range()
1147 if (dev->sriov->max_VF_buses > max) in pci_iov_bus_range()
1148 max = dev->sriov->max_VF_buses; in pci_iov_bus_range()
1151 return max ? max - bus->number : 0; in pci_iov_bus_range()
1155 * pci_enable_sriov - enable the SR-IOV capability
1165 if (!dev->is_physfn) in pci_enable_sriov()
1166 return -ENOSYS; in pci_enable_sriov()
1173 * pci_disable_sriov - disable the SR-IOV capability
1180 if (!dev->is_physfn) in pci_disable_sriov()
1188 * pci_num_vf - return number of VFs associated with a PF device_release_driver
1191 * Returns number of VFs, or 0 if SR-IOV is not enabled.
1195 if (!dev->is_physfn) in pci_num_vf()
1198 return dev->sriov->num_VFs; in pci_num_vf()
1203 * pci_vfs_assigned - returns number of VFs are assigned to a guest
1216 if (!dev->is_physfn) in pci_vfs_assigned()
1223 dev_id = dev->sriov->vf_device; in pci_vfs_assigned()
1226 vfdev = pci_get_device(dev->vendor, dev_id, NULL); in pci_vfs_assigned()
1232 if (vfdev->is_virtfn && (vfdev->physfn == dev) && in pci_vfs_assigned()
1236 vfdev = pci_get_device(dev->vendor, dev_id, vfdev); in pci_vfs_assigned()
1244 * pci_sriov_set_totalvfs -- reduce the TotalVFs available
1251 * Returns 0 if PF is an SRIOV-capable device and
1252 * value of numvfs valid. If not a PF return -ENOSYS;
1253 * if numvfs is invalid return -EINVAL;
1254 * if VFs already enabled, return -EBUSY.
1258 if (!dev->is_physfn) in pci_sriov_set_totalvfs()
1259 return -ENOSYS; in pci_sriov_set_totalvfs()
1261 if (numvfs > dev->sriov->total_VFs) in pci_sriov_set_totalvfs()
1262 return -EINVAL; in pci_sriov_set_totalvfs()
1265 if (dev->sriov->ctrl & PCI_SRIOV_CTRL_VFE) in pci_sriov_set_totalvfs()
1266 return -EBUSY; in pci_sriov_set_totalvfs()
1268 dev->sriov->driver_max_VFs = numvfs; in pci_sriov_set_totalvfs()
1274 * pci_sriov_get_totalvfs -- get total VFs supported on this device
1283 if (!dev->is_physfn) in pci_sriov_get_totalvfs()
1286 return dev->sriov->driver_max_VFs; in pci_sriov_get_totalvfs()
1291 * pci_sriov_configure_simple - helper to configure SR-IOV
1295 * Enable or disable SR-IOV for devices that don't require any PF setup
1296 * before enabling SR-IOV. Return value is negative on error, or number of
1305 if (!dev->is_physfn) in pci_sriov_configure_simple()
1306 return -ENODEV; in pci_sriov_configure_simple()
1309 pci_warn(dev, "Cannot modify SR-IOV while VFs are assigned\n"); in pci_sriov_configure_simple()
1310 return -EPERM; in pci_sriov_configure_simple()
1327 * pci_iov_vf_bar_set_size - set a new size for a VF BAR
1346 return -EINVAL; in pci_iov_vf_bar_set_size()
1349 return -EBUSY; in pci_iov_vf_bar_set_size()
1353 return -ENOTSUPP; in pci_iov_vf_bar_set_size()
1356 return -EINVAL; in pci_iov_vf_bar_set_size()
1369 * pci_iov_vf_bar_get_sizes - get VF BAR sizes allowing to create up to num_vfs
1389 sizes = (roundup_pow_of_two(vf_len + 1) - 1) >> ilog2(SZ_1M); in pci_iov_vf_bar_get_sizes()