[v3,i-g-t,2/2] tests/intel/xe_sriov_flr: Add flr-twice subtest
Laguna, Lukasz
lukasz.laguna at intel.com
Wed Jan 29 11:17:34 UTC 2025
On 1/16/2025 20:29, Marcin Bernatowicz wrote:
> Introduce the `flr-twice` subtest, which initiates FLR twice in parallel
> on the same VF. This subtest covers a use case where two FLRs can occur
> within a short time frame, such as when starting a QEMU VM with
> a passed VF.
>
> Example log showing the behavior:
> [ 241.906514] vfio-pci 0000:00:02.1: resetting
> [ 241.907123] xe 0000:00:02.0: [drm] GT1: PF: VF1 FLR
> [ 241.907204] xe 0000:00:02.0: [drm] GT0: PF: VF1 FLR
> [ 242.013441] vfio-pci 0000:00:02.1: reset done
> [ 242.040918] vfio-pci 0000:00:02.1: resetting
> [ 242.041794] xe 0000:00:02.0: [drm] GT1: PF: VF1 FLR
> [ 242.041803] xe 0000:00:02.0: [drm:pf_enter_vf_flr_wip [xe]] GT1: PF:
> VF1 FLR is already in progress
> [ 242.042207] xe 0000:00:02.0: [drm] GT0: PF: VF1 FLR
> [ 242.042214] xe 0000:00:02.0: [drm:pf_enter_vf_flr_wip [xe]] GT0: PF:
> VF1 FLR is already in progress
> [ 242.149432] vfio-pci 0000:00:02.1: reset done
>
> Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz at linux.intel.com>
> Cc: Adam Miszczak <adam.miszczak at linux.intel.com>
> Cc: Jakub Kolakowski <jakub1.kolakowski at intel.com>
> Cc: Marcin Bernatowicz <marcin.bernatowicz at linux.intel.com>
> Cc: Michał Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Michał Winiarski <michal.winiarski at intel.com>
> Cc: Narasimha C V <narasimha.c.v at intel.com>
> Cc: Piotr Piórkowski <piotr.piorkowski at intel.com>
> Cc: Satyanarayana K V P <satyanarayana.k.v.p at intel.com>
> Cc: Tomasz Lis <tomasz.lis at intel.com>
> ---
> tests/intel/xe_sriov_flr.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/tests/intel/xe_sriov_flr.c b/tests/intel/xe_sriov_flr.c
> index a8d35be31..50f88fed4 100644
> --- a/tests/intel/xe_sriov_flr.c
> +++ b/tests/intel/xe_sriov_flr.c
> @@ -41,6 +41,13 @@
> * Run type: FULL
> * Description:
> * Executes FLR on all VFs simultaneously to validate correct behavior during parallel resets.
> + *
> + * SUBTEST: flr-twice
> + * Run type: FULL
> + * Description:
> + * Initiates FLR twice in parallel on the same VF to validate behavior
> + * when multiple resets occur within a short time frame, as seen in some
> + * real-world scenarios (e.g., when starting a QEMU VM with a passed VF).
> */
>
> IGT_TEST_DESCRIPTION("Xe tests for SR-IOV VF FLR (Functional Level Reset)");
> @@ -449,6 +456,14 @@ static int execute_parallel_flr(int pf_fd, int num_vfs, struct subcheck *checks,
> wait_flr_ms, 1);
> }
>
> +static int execute_parallel_flr_twice(int pf_fd, int num_vfs,
> + struct subcheck *checks, int num_checks,
> + const int wait_flr_ms)
> +{
> + return execute_parallel_flr_(pf_fd, num_vfs, checks, num_checks,
> + wait_flr_ms, 2);
> +}
> +
> #define GEN12_VF_CAP_REG 0x1901f8
> #define GGTT_PTE_TEST_FIELD_MASK GENMASK_ULL(19, 12)
> #define GGTT_PTE_ADDR_SHIFT 12
> @@ -1073,6 +1088,11 @@ igt_main
> clear_tests(pf_fd, total_vfs, execute_parallel_flr);
> }
>
> + igt_describe("Initiate FLR twice in parallel on same VF.");
> + igt_subtest("flr-twice") {
> + clear_tests(pf_fd, 1, execute_parallel_flr_twice);
> + }
> +
> igt_fixture {
> igt_sriov_disable_vfs(pf_fd);
> /* abort to avoid execution of next tests with enabled VFs */
LGTM,
Reviewed-by: Lukasz Laguna <lukasz.laguna at intel.com>
More information about the igt-dev
mailing list