staticint pf_reduce_totalvfs(struct xe_device *xe, int limit)
{ struct device *dev = xe->drm.dev; struct pci_dev *pdev = to_pci_dev(dev); int err;
err = pci_sriov_set_totalvfs(pdev, limit); if (err)
xe_sriov_notice(xe, "Failed to set number of VFs to %d (%pe)\n",
limit, ERR_PTR(err)); return err;
}
/** * xe_sriov_pf_readiness - Check if PF functionality can be enabled. * @xe: the &xe_device to check * * This function is called as part of the SR-IOV probe to validate if all * PF prerequisites are satisfied and we can continue with enabling PF mode. * * Return: true if the PF mode can be turned on.
*/ bool xe_sriov_pf_readiness(struct xe_device *xe)
{ struct device *dev = xe->drm.dev; struct pci_dev *pdev = to_pci_dev(dev); int totalvfs = pci_sriov_get_totalvfs(pdev); int newlimit = min_t(u16, wanted_max_vfs(xe), totalvfs);
xe_assert(xe, totalvfs <= U16_MAX);
if (!dev_is_pf(dev)) returnfalse;
if (!xe_device_uc_enabled(xe)) return pf_continue_as_native(xe, "Guc submission disabled");
if (!newlimit) return pf_continue_as_native(xe, "all VFs disabled");
/** * xe_sriov_pf_init_early - Initialize SR-IOV PF specific data. * @xe: the &xe_device to initialize * * Return: 0 on success or a negative error code on failure.
*/ int xe_sriov_pf_init_early(struct xe_device *xe)
{ int err;
err = drmm_mutex_init(&xe->drm, &xe->sriov.pf.master_lock); if (err) return err;
xe_sriov_pf_service_init(xe);
return 0;
}
/** * xe_sriov_pf_wait_ready() - Wait until PF is ready to operate. * @xe: the &xe_device to test * * This function can only be called on PF. * * Return: 0 on success or a negative error code on failure.
*/ int xe_sriov_pf_wait_ready(struct xe_device *xe)
{ struct xe_gt *gt; unsignedint id; int err;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.