Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Francois Dugast <francois.dugast@intel.com>
To: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
Cc: igt-dev@lists.freedesktop.org, lucas.demarchi@intel.com,
	"Michał Wajdeczko" <michal.wajdeczko@intel.com>
Subject: Re: [PATCH i-g-t v4 3/3] tests/intel/xe_fault_injection: Do not assert for probe_guc_fail_* functions.
Date: Thu, 3 Apr 2025 10:13:55 +0200	[thread overview]
Message-ID: <Z-5DODJTZjV6b2vr@fdugast-desk> (raw)
In-Reply-To: <20250328111532.16620-4-satyanarayana.k.v.p@intel.com>

On Fri, Mar 28, 2025 at 04:45:32PM +0530, Satyanarayana K V P wrote:
> In the current implementation, test asserts if the captured error is not same as
> injected error. It is possible that the error received is translated to other
> error which can be returned to application and in some scenarios driver retries
> in case of failure and so, no error might be captured.
> 
> Considering above cases, added flags to control the assertion after injecting
> error. Test does not assert for probe_guc_fail_* functions as driver some times
> retries in case of failure. The main idea of injecting errors for these guc
> functions is to check the robustness of the driver.
> 
> Signed-off-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
> Cc: Michał Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Francois Dugast <francois.dugast@intel.com>

LGTM, we can specify flags per section in the future if needed.

Reviewed-by: Francois Dugast <francois.dugast@intel.com>

> ---
>  tests/intel/xe_fault_injection.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/intel/xe_fault_injection.c b/tests/intel/xe_fault_injection.c
> index a49070b4d..a03dd3fbe 100644
> --- a/tests/intel/xe_fault_injection.c
> +++ b/tests/intel/xe_fault_injection.c
> @@ -33,6 +33,11 @@ enum injection_list_action {
>  	INJECTION_LIST_REMOVE,
>  };
>  
> +enum assert_flags {
> +	INJECT_ASSERT_ON_FAIL,
> +	INJECT_NOASSERT_ON_FAIL,
> +};
> +
>  struct fault_injection_params {
>  	/* @probability: Likelihood of failure injection, in percent. */
>  	uint32_t probability;
> @@ -234,7 +239,7 @@ static void set_retval(const char function_name[], long long retval)
>   * @xe_wopcm_init:		xe_wopcm_init
>   */
>  static void
> -inject_fault_probe(int fd, char pci_slot[], const char function_name[])
> +inject_fault_probe(int fd, int flags, char pci_slot[], const char function_name[])
>  {
>  	igt_info("Injecting error \"%s\" (%d) in function \"%s\"\n",
>  		 strerror(-INJECT_ERRNO), INJECT_ERRNO, function_name);
> @@ -243,7 +248,8 @@ inject_fault_probe(int fd, char pci_slot[], const char function_name[])
>  	injection_list_do(INJECTION_LIST_ADD, function_name);
>  	set_retval(function_name, INJECT_ERRNO);
>  	xe_sysfs_driver_do(fd, pci_slot, XE_SYSFS_DRIVER_TRY_BIND);
> -	igt_assert_eq(-errno, INJECT_ERRNO);
> +	if (flags & INJECT_ASSERT_ON_FAIL)
> +		igt_assert_eq(-errno, INJECT_ERRNO);
>  	injection_list_do(INJECTION_LIST_REMOVE, function_name);
>  }
>  
> @@ -270,7 +276,7 @@ static void probe_fail_guc(int fd, char pci_slot[], const char function_name[],
>  	for (int i = iter_start; i < iter_end; i++) {
>  		fault_params->space = i;
>  		setup_injection_fault(fault_params);
> -		inject_fault_probe(fd, pci_slot, function_name);
> +		inject_fault_probe(fd, INJECT_NOASSERT_ON_FAIL, pci_slot, function_name);
>  		igt_kmod_unbind("xe", pci_slot);
>  	}
>  }
> @@ -557,7 +563,7 @@ igt_main
>  
>  	for (const struct section *s = probe_fail_functions; s->name; s++)
>  		igt_subtest_f("inject-fault-probe-function-%s", s->name)
> -			inject_fault_probe(fd, pci_slot, s->name);
> +			inject_fault_probe(fd, INJECT_ASSERT_ON_FAIL, pci_slot, s->name);
>  
>     for (const struct section *s = guc_fail_functions; s->name; s++)
>         igt_subtest_f("probe-fail-guc-%s", s->name) {
> -- 
> 2.35.3
> 

  reply	other threads:[~2025-04-03  8:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-28 11:15 [PATCH i-g-t v4 0/3] tests/intel/xe_fault_injection: Inject errors during xe_guc_ct_send_recv() xe_guc_mmio_send_recv() Satyanarayana K V P
2025-03-28 11:15 ` [PATCH i-g-t v4 1/3] tests/intel/xe_fault_injection: Make setup_injection_fault() programmable Satyanarayana K V P
2025-03-28 11:15 ` [PATCH i-g-t v4 2/3] tests/intel/xe_fault_injection: Inject errors during xe_guc_ct_send_recv & xe_guc_mmio_send_recv Satyanarayana K V P
2025-04-03 13:34   ` [i-g-t,v4,2/3] " Laguna, Lukasz
2025-04-04  6:04     ` K V P, Satyanarayana
2025-04-04  6:25       ` Laguna, Lukasz
2025-04-04 15:17         ` Lucas De Marchi
2025-04-04 13:37   ` [PATCH i-g-t v4 2/3] " Kamil Konieczny
2025-03-28 11:15 ` [PATCH i-g-t v4 3/3] tests/intel/xe_fault_injection: Do not assert for probe_guc_fail_* functions Satyanarayana K V P
2025-04-03  8:13   ` Francois Dugast [this message]
2025-03-28 23:39 ` ✓ Xe.CI.BAT: success for tests/intel/xe_fault_injection: Inject errors during xe_guc_ct_send_recv() xe_guc_mmio_send_recv() (rev4) Patchwork
2025-03-28 23:54 ` ✓ i915.CI.BAT: " Patchwork
2025-03-29  4:42 ` ✗ i915.CI.Full: failure " Patchwork
2025-03-29 15:55 ` ✗ Xe.CI.Full: " Patchwork
2025-04-06 19:16 ` Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z-5DODJTZjV6b2vr@fdugast-desk \
    --to=francois.dugast@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=satyanarayana.k.v.p@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox