static void pf_set_admin_mode(struct xe_device *xe, bool enable)
{
/* should match logic of xe_sriov_pf_admin_only() */
- xe->info.probe_display = !enable;
+ xe->sriov.pf.admin_only = enable;
KUNIT_EXPECT_EQ(kunit_get_current_test(), enable, xe_sriov_pf_admin_only(xe));
}
#include "xe_sriov_pf_sysfs.h"
#include "xe_sriov_printk.h"
+static bool wanted_admin_only(struct xe_device *xe)
+{
+ return !xe->info.probe_display;
+}
+
static unsigned int wanted_max_vfs(struct xe_device *xe)
{
return xe_configfs_get_max_vfs(to_pci_dev(xe->drm.dev));
pf_reduce_totalvfs(xe, newlimit);
+ xe->sriov.pf.admin_only = wanted_admin_only(xe);
xe->sriov.pf.device_total_vfs = totalvfs;
xe->sriov.pf.driver_max_vfs = newlimit;
*/
static inline bool xe_sriov_pf_admin_only(const struct xe_device *xe)
{
- return !xe->info.probe_display;
+ xe_assert(xe, IS_SRIOV_PF(xe));
+ return xe->sriov.pf.admin_only;
}
static inline struct mutex *xe_sriov_pf_master_mutex(struct xe_device *xe)
* @XE_SRIOV_MODE_PF mode.
*/
struct xe_device_pf {
+ /** @admin_only: PF functionality focused on VFs management only. */
+ bool admin_only;
+
/** @device_total_vfs: Maximum number of VFs supported by the device. */
u16 device_total_vfs;