The max_vfs parameter used by the Xe driver has its default value
definition, but it could be altered by the module parameter or by
the device specific configfs attribute.
To avoid mistakes or code duplication, always rely on the configfs
helper (or stub), which will provide necessary fallback if needed.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20260121214218.2817-4-michal.wajdeczko@intel.com
#include "instructions/xe_mi_commands.h"
#include "xe_configfs.h"
+#include "xe_defaults.h"
#include "xe_gt_types.h"
#include "xe_hw_engine_types.h"
#include "xe_module.h"
.survivability_mode = false,
.enable_psmi = false,
.sriov = {
- .max_vfs = UINT_MAX,
+ .max_vfs = XE_DEFAULT_MAX_VFS,
},
};
#include <linux/types.h>
#include "xe_hw_engine_types.h"
+#include "xe_module.h"
struct pci_dev;
const u32 **cs) { return 0; }
static inline u32 xe_configfs_get_ctx_restore_post_bb(struct pci_dev *pdev, enum xe_engine_class,
const u32 **cs) { return 0; }
-static inline unsigned int xe_configfs_get_max_vfs(struct pci_dev *pdev) { return UINT_MAX; }
+#ifdef CONFIG_PCI_IOV
+static inline unsigned int xe_configfs_get_max_vfs(struct pci_dev *pdev)
+{
+ return xe_modparam.max_vfs;
+}
+#endif
#endif
#endif
static unsigned int wanted_max_vfs(struct xe_device *xe)
{
- if (IS_ENABLED(CONFIG_CONFIGFS_FS))
- return xe_configfs_get_max_vfs(to_pci_dev(xe->drm.dev));
- return xe_modparam.max_vfs;
+ return xe_configfs_get_max_vfs(to_pci_dev(xe->drm.dev));
}
static int pf_reduce_totalvfs(struct xe_device *xe, int limit)