[PATCH i-g-t] tests/sriov_basic: Skip tests if sriov_totalvfs is zero

Kamil Konieczny kamil.konieczny at linux.intel.com
Thu May 9 09:34:34 UTC 2024


Hi Marcin,
On 2024-05-08 at 19:32:58 +0000, Marcin Bernatowicz wrote:
> There is no point to run the tests if no VFs can be enabled.
> Additionally, the `for_random_sriov_num_vfs` macro will lead
> to undefined behavior if `sriov_totalvfs` is zero.
> 
> Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz at linux.intel.com>
> ---
>  tests/sriov_basic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/sriov_basic.c b/tests/sriov_basic.c
> index f58b3b7ba..1bc082d76 100644
> --- a/tests/sriov_basic.c
> +++ b/tests/sriov_basic.c
> @@ -120,7 +120,7 @@ igt_main
>  
>  	igt_fixture {
>  		pf_fd = drm_open_driver(DRIVER_ANY);
> -		igt_require(igt_sriov_is_pf(pf_fd));

Could you keep this require here?

Regards,
Kamil

> +		igt_require(igt_sriov_vfs_supported(pf_fd));
>  		igt_require(igt_sriov_get_enabled_vfs(pf_fd) == 0);
>  		autoprobe = igt_sriov_is_driver_autoprobe_enabled(pf_fd);
>  	}
> -- 
> 2.31.1
> 


More information about the igt-dev mailing list