Re: [PATCH i-g-t 2/6] lib/xe/xe_sriov_admin: Rename restore defaults helpers
"Laguna, Lukasz" <[email protected]>
| Newsgroups | org.freedesktop.lists.igt-dev |
|---|---|
| Message-ID | <[email protected]> |
On 8/18/2026 14:39, Marcin Bernatowicz wrote: > The restore helpers only reset execution quantum, preemption timeout and > scheduling priority. Resource provisioning is restored separately by > xe_sriov_disable_vfs_restore_auto_provisioning(), so the plain "defaults" > naming promises more than the helpers deliver. > > Rename them to say scheduling defaults. No functional changes. > > Assisted-by: Copilot:Claude-Opus-5 > Signed-off-by: Marcin Bernatowicz <[email protected]> > Cc: Adam Miszczak <[email protected]> > Cc: Jakub Kolakowski <[email protected]> > Cc: Lukasz Laguna <[email protected]> Reviewed-by: Lukasz Laguna <[email protected]> > Cc: Michal Wajdeczko <[email protected]> > --- > lib/xe/xe_sriov_admin.c | 26 +++++++++++++------------- > lib/xe/xe_sriov_admin.h | 12 ++++++------ > tests/intel/xe_pmu.c | 4 ++-- > tests/intel/xe_sriov_admin.c | 4 ++-- > tests/intel/xe_sriov_scheduling.c | 2 +- > 5 files changed, 24 insertions(+), 24 deletions(-) > > diff --git a/lib/xe/xe_sriov_admin.c b/lib/xe/xe_sriov_admin.c > index 0e7ffb52d..b03e77b08 100644 > --- a/lib/xe/xe_sriov_admin.c > +++ b/lib/xe/xe_sriov_admin.c > @@ -541,7 +541,7 @@ void xe_sriov_admin_vf_stop(int pf_fd, unsigned int vf_num) > } > > /** > - * __xe_sriov_admin_restore_defaults - Restore scheduling defaults for a VF > + * __xe_sriov_admin_restore_sched_defaults - Restore scheduling defaults for a VF > * @pf_fd: PF device file descriptor. > * @vf_num: VF index (0 for PF, >0 for VFs). > * > @@ -549,7 +549,7 @@ void xe_sriov_admin_vf_stop(int pf_fd, unsigned int vf_num) > * > * Returns: 0 on success or negative errno on error. > */ > -int __xe_sriov_admin_restore_defaults(int pf_fd, unsigned int vf_num) > +int __xe_sriov_admin_restore_sched_defaults(int pf_fd, unsigned int vf_num) > { > int ret_eq, ret_pt, ret_prio; > int ret = 0; > @@ -574,24 +574,24 @@ int __xe_sriov_admin_restore_defaults(int pf_fd, unsigned int vf_num) > } > > /** > - * xe_sriov_admin_restore_defaults - Assert wrapper restoring VF defaults > + * xe_sriov_admin_restore_sched_defaults - Assert wrapper restoring VF defaults > * @pf_fd: PF device file descriptor. > * @vf_num: VF index (0 for PF, >0 for VFs). > */ > -void xe_sriov_admin_restore_defaults(int pf_fd, unsigned int vf_num) > +void xe_sriov_admin_restore_sched_defaults(int pf_fd, unsigned int vf_num) > { > - igt_assert_eq(0, __xe_sriov_admin_restore_defaults(pf_fd, vf_num)); > + igt_assert_eq(0, __xe_sriov_admin_restore_sched_defaults(pf_fd, vf_num)); > } > > /** > - * __xe_sriov_admin_bulk_restore_defaults - Restore scheduling defaults for PF and all VFs > + * __xe_sriov_admin_bulk_restore_sched_defaults - Restore scheduling defaults for PF and all VFs > * @pf_fd: PF device file descriptor. > * > * Resets PF and all VFs to driver default scheduling parameters. > * > * Returns: 0 on success or negative errno on error. > */ > -int __xe_sriov_admin_bulk_restore_defaults(int pf_fd) > +int __xe_sriov_admin_bulk_restore_sched_defaults(int pf_fd) > { > int ret_eq, ret_pt, ret_prio; > int ret = 0; > @@ -616,16 +616,16 @@ int __xe_sriov_admin_bulk_restore_defaults(int pf_fd) > } > > /** > - * xe_sriov_admin_bulk_restore_defaults - Assert wrapper for restoring defaults on PF and all VFs > + * xe_sriov_admin_bulk_restore_sched_defaults - Assert wrapper restoring defaults on PF and all VFs > * @pf_fd: PF device file descriptor. > */ > -void xe_sriov_admin_bulk_restore_defaults(int pf_fd) > +void xe_sriov_admin_bulk_restore_sched_defaults(int pf_fd) > { > - igt_assert_eq(0, __xe_sriov_admin_bulk_restore_defaults(pf_fd)); > + igt_assert_eq(0, __xe_sriov_admin_bulk_restore_sched_defaults(pf_fd)); > } > > /** > - * xe_sriov_admin_exit_cleanup_restore_defaults - Best-effort SR-IOV defaults restore callback > + * xe_sriov_admin_exit_cleanup_restore_sched_defaults - Best-effort SR-IOV defaults restore callback > * @pf_fd: PF device file descriptor > * @sig: Exit signal number, or 0 on normal exit > * @user_data: Unused > @@ -634,7 +634,7 @@ void xe_sriov_admin_bulk_restore_defaults(int pf_fd) > * XE SR-IOV scheduling defaults. Restores PF and VF scheduling attributes to > * driver defaults. Failures are ignored so the callback remains best-effort. > */ > -void xe_sriov_admin_exit_cleanup_restore_defaults(int pf_fd, int sig, void *user_data) > +void xe_sriov_admin_exit_cleanup_restore_sched_defaults(int pf_fd, int sig, void *user_data) > { > (void)sig; > (void)user_data; > @@ -642,5 +642,5 @@ void xe_sriov_admin_exit_cleanup_restore_defaults(int pf_fd, int sig, void *user > if (!xe_sriov_admin_is_present(pf_fd)) > return; > > - (void)__xe_sriov_admin_bulk_restore_defaults(pf_fd); > + (void)__xe_sriov_admin_bulk_restore_sched_defaults(pf_fd); > } > diff --git a/lib/xe/xe_sriov_admin.h b/lib/xe/xe_sriov_admin.h > index 3db13c2ac..4eb9c83a6 100644 > --- a/lib/xe/xe_sriov_admin.h > +++ b/lib/xe/xe_sriov_admin.h > @@ -52,11 +52,11 @@ void xe_sriov_admin_bulk_set_sched_priority(int pf_fd, > int __xe_sriov_admin_vf_stop(int pf_fd, unsigned int vf_num); > void xe_sriov_admin_vf_stop(int pf_fd, unsigned int vf_num); > > -int __xe_sriov_admin_restore_defaults(int pf_fd, unsigned int vf_num); > -void xe_sriov_admin_restore_defaults(int pf_fd, unsigned int vf_num); > -int __xe_sriov_admin_bulk_restore_defaults(int pf_fd); > -void xe_sriov_admin_bulk_restore_defaults(int pf_fd); > -void xe_sriov_admin_exit_cleanup_restore_defaults(int pf_fd, int sig, > - void *user_data); > +int __xe_sriov_admin_restore_sched_defaults(int pf_fd, unsigned int vf_num); > +void xe_sriov_admin_restore_sched_defaults(int pf_fd, unsigned int vf_num); > +int __xe_sriov_admin_bulk_restore_sched_defaults(int pf_fd); > +void xe_sriov_admin_bulk_restore_sched_defaults(int pf_fd); > +void xe_sriov_admin_exit_cleanup_restore_sched_defaults(int pf_fd, int sig, > + void *user_data); > > #endif /* __XE_SRIOV_ADMIN_H__ */ > diff --git a/tests/intel/xe_pmu.c b/tests/intel/xe_pmu.c > index f4c03faa2..2d1bc1f61 100644 > --- a/tests/intel/xe_pmu.c > +++ b/tests/intel/xe_pmu.c > @@ -991,7 +991,7 @@ static unsigned int enable_and_provision_vfs(int fd) > igt_require(igt_sriov_get_enabled_vfs(fd) == 0); > xe_sriov_require_default_scheduling_attributes(fd); > igt_sriov_install_exit_handler(fd, > - xe_sriov_admin_exit_cleanup_restore_defaults, > + xe_sriov_admin_exit_cleanup_restore_sched_defaults, > NULL); > autoprobe = igt_sriov_is_driver_autoprobe_enabled(fd); > > @@ -1023,7 +1023,7 @@ static void unprovision_and_disable_vfs(int fd) > { > int ret; > > - ret = __xe_sriov_admin_bulk_restore_defaults(fd); > + ret = __xe_sriov_admin_bulk_restore_sched_defaults(fd); > xe_sriov_disable_vfs_restore_auto_provisioning(fd); > /* abort to avoid execution of next tests with enabled VFs */ > igt_abort_on_f(igt_sriov_get_enabled_vfs(fd) > 0, > diff --git a/tests/intel/xe_sriov_admin.c b/tests/intel/xe_sriov_admin.c > index 8b400a01f..904c2ed7f 100644 > --- a/tests/intel/xe_sriov_admin.c > +++ b/tests/intel/xe_sriov_admin.c > @@ -347,7 +347,7 @@ int igt_main() > igt_require(igt_sriov_get_enabled_vfs(pf_fd) == 0); > igt_require(xe_sriov_admin_is_present(pf_fd)); > igt_sriov_install_exit_handler(pf_fd, > - xe_sriov_admin_exit_cleanup_restore_defaults, > + xe_sriov_admin_exit_cleanup_restore_sched_defaults, > NULL); > total_vfs = igt_sriov_get_total_vfs(pf_fd); > } > @@ -426,7 +426,7 @@ int igt_main() > igt_fixture() { > int ret; > > - ret = __xe_sriov_admin_bulk_restore_defaults(pf_fd); > + ret = __xe_sriov_admin_bulk_restore_sched_defaults(pf_fd); > igt_sriov_disable_vfs(pf_fd); > /* abort to avoid execution of next tests with enabled VFs */ > igt_abort_on_f(igt_sriov_get_enabled_vfs(pf_fd) > 0, > diff --git a/tests/intel/xe_sriov_scheduling.c b/tests/intel/xe_sriov_scheduling.c > index a2240e473..5e4001219 100644 > --- a/tests/intel/xe_sriov_scheduling.c > +++ b/tests/intel/xe_sriov_scheduling.c > @@ -1470,7 +1470,7 @@ int igt_main_args("", long_opts, help_str, subm_opts_handler, NULL) > igt_require(igt_sriov_get_enabled_vfs(pf_fd) == 0); > igt_require(xe_sriov_admin_is_present(pf_fd)); > igt_sriov_install_exit_handler(pf_fd, > - xe_sriov_admin_exit_cleanup_restore_defaults, > + xe_sriov_admin_exit_cleanup_restore_sched_defaults, > NULL); > autoprobe = igt_sriov_is_driver_autoprobe_enabled(pf_fd); > xe_sriov_require_default_scheduling_attributes(pf_fd);