[RFC] drm/xe/vf: Allow to inject VF provisioning errors
Lucas De Marchi
lucas.demarchi at intel.com
Fri May 16 15:53:28 UTC 2025
On Tue, Apr 15, 2025 at 01:26:47PM +0530, Satyanarayana K V P wrote:
>In unlikely event, due to PF malfunction or misconfiguration, VF may
>receive incomplete or invalid configuration and it must be prepared
>to handle such cases without causing a crash.
>
>Since we believe that our PF implementation will not provide invalid VF
>config, reuse existing FUNCTION_ERROR_INJECTION framework to alter VF
>provisioning to verify driver reaction to unexpected or invalid
>configurations.
>
>However we can't use FUNCTION_ERROR_INJECTION directly on functions that
>query VF provisioning, as all detected error conditions will cause
>immediate abort. Instead define dummy functions, where we could inject
>error using FUNCTION_ERROR_INJECTION framework, and any errors from these
>functions will be used to adjust the received valid provisioning data into
>the invalid one.
>
>The following errors are recognized by these functions and to trigger
>specific provisioning misconfiguration.
>
>-ENODATA (-61) : Force resource size to zero (unprovisioned)
>-EREMCHG (-78) : Force resource size smaller than received (should be
> harmless until driver detects inconsistency)
>-EINVAL (-22) : Force resource location invalid (like GGTT base
> below WOPCM)
>-ENOSPC (-28) : Force resource size bigger than HW limit
>-EDQUOT (-122) : Force resource size larger than received (will cause use
> of unassigned part of the resource)
>-ESRMNT (-69) : Force resource size larger than received with invalid
> base address. (Will cause use of unassigned part of the
> resource).
>
>Fault can be injected with below steps (using GGTT resource and -ENODATA
>error as an example)
>
>$ FAILFUNC=xe_should_fail_ggtt_provisioning
>
>$ echo $FAILFUNC > /sys/kernel/debug/fail_function/inject
>$ printf %#x -61 > /sys/kernel/debug/fail_function/$FAILFUNC/retval
>$ echo 100 > /sys/kernel/debug/fail_function/probability
>$ echo 0 > /sys/kernel/debug/fail_function/space
>
>Signed-off-by: Satyanarayana K V P <satyanarayana.k.v.p at intel.com>
>Suggested-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
Acked-by: Lucas De Marchi <lucas.demarchi at intel.com>
>
>---
>An IGT will be developed to further test and validate the functionality
>introduced by this patch based on acceptance of this RFC patch.
yeah, looks like a good/clean approach.
Thanks
Lucas De Marchi
More information about the Intel-xe
mailing list