Lines Matching +full:0 +full:xe

27 static int pf_provision_vfs(struct xe_device *xe, unsigned int num_vfs)  in pf_provision_vfs()  argument
31 int result = 0, err; in pf_provision_vfs()
33 for_each_gt(gt, xe, id) { in pf_provision_vfs()
43 static void pf_unprovision_vfs(struct xe_device *xe, unsigned int num_vfs) in pf_unprovision_vfs() argument
49 for_each_gt(gt, xe, id) in pf_unprovision_vfs()
54 static void pf_reset_vfs(struct xe_device *xe, unsigned int num_vfs) in pf_reset_vfs() argument
60 for_each_gt(gt, xe, id) in pf_reset_vfs()
65 static int pf_enable_vfs(struct xe_device *xe, int num_vfs) in pf_enable_vfs() argument
67 struct pci_dev *pdev = to_pci_dev(xe->drm.dev); in pf_enable_vfs()
68 int total_vfs = xe_sriov_pf_get_totalvfs(xe); in pf_enable_vfs()
71 xe_assert(xe, IS_SRIOV_PF(xe)); in pf_enable_vfs()
72 xe_assert(xe, num_vfs > 0); in pf_enable_vfs()
73 xe_assert(xe, num_vfs <= total_vfs); in pf_enable_vfs()
74 xe_sriov_dbg(xe, "enabling %u VF%s\n", num_vfs, str_plural(num_vfs)); in pf_enable_vfs()
85 xe_pm_runtime_get_noresume(xe); in pf_enable_vfs()
87 err = pf_provision_vfs(xe, num_vfs); in pf_enable_vfs()
88 if (err < 0) in pf_enable_vfs()
92 if (err < 0) in pf_enable_vfs()
95 xe_sriov_info(xe, "Enabled %u of %u VF%s\n", in pf_enable_vfs()
100 pf_unprovision_vfs(xe, num_vfs); in pf_enable_vfs()
101 xe_pm_runtime_put(xe); in pf_enable_vfs()
103 xe_sriov_notice(xe, "Failed to enable %u VF%s (%pe)\n", in pf_enable_vfs()
108 static int pf_disable_vfs(struct xe_device *xe) in pf_disable_vfs() argument
110 struct device *dev = xe->drm.dev; in pf_disable_vfs()
114 xe_assert(xe, IS_SRIOV_PF(xe)); in pf_disable_vfs()
115 xe_sriov_dbg(xe, "disabling %u VF%s\n", num_vfs, str_plural(num_vfs)); in pf_disable_vfs()
118 return 0; in pf_disable_vfs()
122 pf_reset_vfs(xe, num_vfs); in pf_disable_vfs()
124 pf_unprovision_vfs(xe, num_vfs); in pf_disable_vfs()
127 xe_pm_runtime_put(xe); in pf_disable_vfs()
129 xe_sriov_info(xe, "Disabled %u VF%s\n", num_vfs, str_plural(num_vfs)); in pf_disable_vfs()
130 return 0; in pf_disable_vfs()
138 * This is the Xe implementation of struct pci_driver.sriov_configure callback.
147 struct xe_device *xe = pdev_to_xe_device(pdev); in xe_pci_sriov_configure() local
150 if (!IS_SRIOV_PF(xe)) in xe_pci_sriov_configure()
153 if (num_vfs < 0) in xe_pci_sriov_configure()
156 if (num_vfs > xe_sriov_pf_get_totalvfs(xe)) in xe_pci_sriov_configure()
162 xe_pm_runtime_get(xe); in xe_pci_sriov_configure()
163 if (num_vfs > 0) in xe_pci_sriov_configure()
164 ret = pf_enable_vfs(xe, num_vfs); in xe_pci_sriov_configure()
166 ret = pf_disable_vfs(xe); in xe_pci_sriov_configure()
167 xe_pm_runtime_put(xe); in xe_pci_sriov_configure()