From: "Purkait, Soham" <soham.purkait@intel.com>
To: Ravi Kishore Koppuravuri <ravi.kishore.koppuravuri@intel.com>,
<igt-dev@lists.freedesktop.org>
Cc: Riana Tauro <riana.tauro@intel.com>,
Gupta Anshuman <anshuman.gupta@intel.com>,
Jadav Raag <raag.jadav@intel.com>,
Nilawar Badal <badal.nilawar@intel.com>,
Koujalagi Mallesh <mallesh.koujalagi@intel.com>,
Harish Chegondi <harish.chegondi@intel.com>
Subject: Re: [PATCH v4 09/10] tests/intel/xe_err_injection: Add tests for L2 bank Corr err threshold scenarios
Date: Fri, 11 Sep 2026 13:44:23 +0530 [thread overview]
Message-ID: <92a2a31f-c7a5-49e0-91a8-3037631b1dc4@intel.com> (raw)
In-Reply-To: <20260903073335.339540-10-ravi.kishore.koppuravuri@intel.com>
[-- Attachment #1: Type: text/plain, Size: 15306 bytes --]
Hi Ravi,
On 03-09-2026 13:03, Ravi Kishore Koppuravuri wrote:
> Introduced L2 bank correctable error threshold subtests:
> - single correctable error
> - Correctable error with threshold set to 1
> - 16 Correctable error injections with threshold set to 0xF
>
> Add DRM RAS netlink error-notify event subscription to verify
> correctable error detection across all the above subtests.
>
> Cc: Purkait Soham<soham.purkait@intel.com>
> Cc: Riana Tauro<riana.tauro@intel.com>
> Cc: Gupta Anshuman<anshuman.gupta@intel.com>
> Cc: Jadav Raag<raag.jadav@intel.com>
> Cc: Nilawar Badal<badal.nilawar@intel.com>
> Cc: Koujalagi Mallesh<mallesh.koujalagi@intel.com>
> Cc: Harish Chegondi<harish.chegondi@intel.com>
> Signed-off-by: Ravi Kishore Koppuravuri<ravi.kishore.koppuravuri@intel.com>
> ---
> v2:Disabled multicast before arming the injection to perform an unicast
> injection.
> Updated the condition to verify response from wait_for_error_notify_event
> condition from an event error value of exactly 1 to the configured error
> threshold.
> v4:Add support for steer semaphore while disabling and enabling
> multicast (Soham)
> Used updated library names with igt_drm_netlink_* prefix (Nikula
> Jani & Kamil)
> Updated error event name from error-notify to error-report to align
> with the latest changes in drm-uapi/drm_ras.h
> ---
> tests/intel/xe_err_injection.c | 292 +++++++++++++++++++++++++++++++++
> tests/intel/xe_err_injection.h | 11 ++
> 2 files changed, 303 insertions(+)
>
> diff --git a/tests/intel/xe_err_injection.c b/tests/intel/xe_err_injection.c
> index 683994d1c..cdf15f70b 100644
> --- a/tests/intel/xe_err_injection.c
> +++ b/tests/intel/xe_err_injection.c
> @@ -35,6 +35,14 @@ enum {
> RECOVERY_TIMEOUT,
> };
>
> +time_t event_timeout = 10 * 1000; /* 10 seconds */
> +
> +/* Cleanup helper for injection test functions */
> +#define CLEANUP_ON_ERROR(ctx, fw_handle) do { \
> + igt_drm_netlink_cleanup(&ctx); \
> + release_forcewake(fw_handle); \
> +} while (0)
> +
> static void run_xe_compute_on_all_engines(int fd, bool state)
> {
> struct drm_xe_engine_class_instance *hwe;
> @@ -295,6 +303,272 @@ static void wkr_cmd_parity_err_injection(struct xe_mmio *mmio, int fd)
> gt_uc_wkr_parity_recovered = true;
> }
>
> +/* Inject a GT correctable error */
> +static void l2_bank_corr_err_injection(struct xe_mmio *mmio, int fd)
> +{
> + /* Disable Multicast for unicast error injection */
> + acquire_steering_semaphore(mmio);
> + write_reg(mmio, MC_PKT_CTRL_MGSR_3D_ADDRESS, 0x0);
> +
> + /* Arm the Injection */
> + write_reg(mmio, L2_BANK_ERR_INJ, L2_BANK_DATA_1BIT_ERR_INJ_CONFIG);
> + igt_info("Armed L2 Bank Correctable Error Injection\n");
> +
> + /* Rollback to Multicast */
> + modify_reg_bit(mmio,
> + MC_PKT_CTRL_MGSR_3D_ADDRESS,
> + MC_PKT_CTRL_MGSR_3D_VALUE,
> + true);
> + release_steering_semaphore(mmio);
> +}
> +
> +/**
> + * SUBTEST: test_l2-bank-corr-err-threshold-1
> + * Description: Inject single bit error injection in SSA data array when this bit is written
> + * (this bit is a self clearing bit, event will be generated once written) - Correctable Error
> + * Functionality: error injection
> + */
> +static void test_l2_bank_corr_err_injection_with_threshold_1(struct xe_mmio *mmio, int fd)
> +{
> + int fw_handle;
> + int ret;
> + uint32_t current_threshold = UINT32_MAX;
> + struct app_context ctx;
> +
> + fw_handle = acquire_forcewake(fd);
> +
> + ret = igt_drm_netlink_init(&ctx);
> + if (ret < 0) {
> + release_forcewake(fw_handle);
> + igt_assert_f(false, "Failed to initialize netlink socket (ret=%d)\n", ret);
> + }
> +
> + /* Subscribe to error-report event */
> + ret = igt_drm_netlink_subscribe_error_report(&ctx, DRM_RAS_MCGRP_ERROR_REPORT);
> + if (ret < 0) {
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> + igt_assert_f(false, "Failed to subscribe to error-report event (ret=%d)\n", ret);
> + }
> +
> + /* get current GT Correctable error threshold */
> + /** TODO
> + * Fetching node_id and error_id dynamically is pending to implement.
> + * For now, using
> + * node_id=0 (correctable_errors) and
> + * error_id=1 (core_compute)
> + */
> + ctx.node_id = NODE_ID_CORRECTABLE_ERROR;
> + ctx.error_id = ERROR_ID_CORE_COMPUTE;
> + ret = igt_drm_netlink_get_error_threshold(&ctx);
> + if (ret < 0) {
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> + igt_assert_f(false, "Failed to query GT correctable error threshold before injection\n");
> + }
> + current_threshold = ctx.error_threshold;
> + igt_info("Current GT Correctable error threshold: %u\n", current_threshold);
> +
> + /* Set GT Correctable error threshold to 1 */
> + ctx.error_threshold = 1;
> + ret = igt_drm_netlink_set_error_threshold(&ctx);
Instead of setting the the threshold value separately better pass it
through a parameter in "igt_drm_netlink_set_error_threshold" and check
the validity of the same.
Thanks, Soham
> + if (ret < 0) {
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> + igt_assert_f(false, "Failed to set GT correctable error threshold before injection\n");
> + }
> +
> + /* Inject a GT correctable error */
> + l2_bank_corr_err_injection(mmio, fd);
> +
> + /* wait for 10 secs */
> + ret = igt_drm_netlink_wait_for_error_report_event(&ctx, event_timeout);
> + if (ret == 0 && ctx.event_error_value >= ctx.error_threshold) {
> + log_status(true, "L2 Bank Correctable Error with threshold 1");
> + igt_info("Received error-report event Notification from %s:node_id=%u error_id=%u "
> + "value=%u match=%d\n",
> + DRM_RAS_MCGRP_ERROR_REPORT, ctx.event_node_id, ctx.event_error_id,
> + ctx.event_error_value, ctx.event_received);
> + } else {
> + log_status(false, "L2 Bank Correctable Error with threshold 1");
> + /* restore threshold before failing */
> + ctx.error_threshold = current_threshold;
> + igt_drm_netlink_set_error_threshold(&ctx);
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> + igt_assert_f(false, "Did not receive expected RAS event or error_value after injection\n");
> + }
> +
> + /* restore GT Correctable error threshold to original value */
> + ctx.error_threshold = current_threshold;
> + ret = igt_drm_netlink_set_error_threshold(&ctx);
> + if (ret < 0) {
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> + igt_assert_f(false, "Failed to restore GT correctable error threshold after injection\n");
> + }
> +
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> +}
> +
> +/**
> + * SUBTEST: test_l2-bank-corr-err-16-times
> + * Description: Inject single bit error injection in SSA data array when this bit is written
> + * (this bit is a self clearing bit, event will be generated once written) - Correctable Error
> + * Functionality: error injection
> + */
> +static void test_l2_bank_corr_err_injection_16_times(struct xe_mmio *mmio, int fd)
> +{
> + int fw_handle;
> + uint32_t current_threshold = UINT32_MAX;
> + uint32_t gt_corr_counter_before = 0, gt_corr_counter_current = 0;
> + int ret;
> + struct app_context ctx;
> +
> + fw_handle = acquire_forcewake(fd);
> +
> + ret = igt_drm_netlink_init(&ctx);
> + if (ret < 0) {
> + release_forcewake(fw_handle);
> + igt_assert_f(false, "Failed to initialize netlink socket (ret=%d)\n", ret);
> + }
> +
> + ret = igt_drm_netlink_subscribe_error_report(&ctx, DRM_RAS_MCGRP_ERROR_REPORT);
> + if (ret < 0) {
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> + igt_assert_f(false, "Failed to subscribe to error-report event (ret=%d)\n", ret);
> + }
> +
> + /* Query error counter before injection */
> + /** TODO
> + * Fetching node_id and error_id dynamically is pending to implement.
> + * For now, using
> + * node_id=0 (correctable_errors) and
> + * error_id=1 (core_compute)
> + */
> + ctx.node_id = NODE_ID_CORRECTABLE_ERROR;
> + ctx.error_id = ERROR_ID_CORE_COMPUTE;
> + ret = igt_drm_netlink_get_error_counter(&ctx);
> + if (ret < 0) {
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> + igt_assert_f(false,
> + "Failed to query GT correctable error counter before injection\n");
> + }
> + gt_corr_counter_before = ctx.error_value;
> +
> + /* get current GT Correctable error threshold */
> + ret = igt_drm_netlink_get_error_threshold(&ctx);
> + if (ret < 0) {
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> + igt_assert_f(false,
> + "Failed to query GT correctable error threshold before injection\n");
> + }
> + current_threshold = ctx.error_threshold;
> + igt_info("Current GT Correctable error threshold: %u\n", current_threshold);
> +
> + for (int i = 0; i < 16; i++) {
> + igt_info("****** Injection iteration: %d ***********\n", i + 1);
> + /* Inject a GT correctable error */
> + l2_bank_corr_err_injection(mmio, fd);
> +
> + /* Query error counter after injection */
> + ret = igt_drm_netlink_get_error_counter(&ctx);
> + if (ret < 0) {
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> + igt_assert_f(false,
> + "Failed to query GT correctable error counter:iteration %d\n",
> + i + 1);
> + }
> + gt_corr_counter_current = ctx.error_value;
> + igt_info("GT Correctable error counter incremented by : %u "
> + "since before initial injection\n",
> + gt_corr_counter_current - gt_corr_counter_before);
> + }
> +
> + /* Confirm whether error counter incremented by 16 after 16 injections */
> + if ((gt_corr_counter_current - gt_corr_counter_before) == 16) {
> + log_status(true, "L2 Bank Correctable Error Injection 16 times");
> + } else {
> + log_status(false, "L2 Bank Correctable Error Injection 16 times");
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> + igt_assert_f(false,
> + "GT Correctable error counter didn't increment "
> + "by 16 after 16 injections\n");
> + }
> +
> + ret = igt_drm_netlink_wait_for_error_report_event(&ctx, event_timeout);
> + if (ret == 0 && ctx.event_error_value == 1) {
> + log_status(true, "L2 Bank Correctable Error Injection 16 times");
> + } else {
> + log_status(false, "L2 Bank Correctable Error Injection 16 times");
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> + igt_assert_f(false, "Did not receive expected error-report event or "
> + "error_value after injection\n");
> + }
> +
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> +}
> +
> +/**
> + * SUBTEST: test_l2-bank-single-corr-err
> + * Description: Inject single bit error injection in SSA data array when this bit is written
> + * (this bit is a self clearing bit, event will be generated once written) - Correctable Error
> + * Functionality: error injection
> + */
> +static void test_l2_bank_single_corr_err_injection(struct xe_mmio *mmio, int fd)
> +{
> + int fw_handle;
> + int ret;
> + uint32_t gt_corr_counter_before = 0, gt_corr_counter_after = 0;
> + struct app_context ctx;
> +
> + fw_handle = acquire_forcewake(fd);
> +
> + ret = igt_drm_netlink_init(&ctx);
> + if (ret < 0) {
> + release_forcewake(fw_handle);
> + igt_assert_f(false, "Failed to initialize netlink socket (ret=%d)\n", ret);
> + }
> +
> + /* Query error counter before injection */
> + /** TODO
> + * Fetching node_id and error_id dynamically is pending to implement.
> + * For now, using
> + * node_id=0 (correctable_errors) and
> + * error_id=1 (core_compute)
> + */
> + ctx.node_id = NODE_ID_CORRECTABLE_ERROR;
> + ctx.error_id = ERROR_ID_CORE_COMPUTE;
> + ret = igt_drm_netlink_get_error_counter(&ctx);
> + if (ret < 0) {
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> + igt_assert_f(false,
> + "Failed to query GT correctable error counter before injection\n");
> + }
> + gt_corr_counter_before = ctx.error_value;
> + igt_info("GT Correctable error counter before injection: %u\n", gt_corr_counter_before);
> +
> + /* Inject a GT correctable error */
> + l2_bank_corr_err_injection(mmio, fd);
> +
> + /* Query error counter after injection */
> + ret = igt_drm_netlink_get_error_counter(&ctx);
> + if (ret < 0) {
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> + igt_assert_f(false,
> + "Failed to query GT correctable error counter after injection\n");
> + }
> + gt_corr_counter_after = ctx.error_value;
> + igt_info("GT Correctable error counter after injection: %u\n", gt_corr_counter_after);
> +
> + if (gt_corr_counter_after > gt_corr_counter_before) {
> + igt_info("GT Correctable error counter incremented by %u after injection\n",
> + gt_corr_counter_after - gt_corr_counter_before);
> + log_status(true, "L2 Bank Correctable Error");
> + } else {
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> + igt_assert_f(false,
> + "L2 Bank (GT) Correctable Error Injection count not incremented\n");
> + }
> +
> + CLEANUP_ON_ERROR(ctx, fw_handle);
> +}
> +
> static void inject_error(const char *injection, struct xe_mmio *mmio, int fd)
> {
> igt_info("Starting Error Injection test: %s\n", injection);
> @@ -302,6 +576,12 @@ static void inject_error(const char *injection, struct xe_mmio *mmio, int fd)
> wkr_cmd_parity_err_injection(mmio, fd);
> else if (strcmp(injection, "test_GT-UC-unicast-wkr-cmd-parity-err-post-recovery-wl") == 0)
> run_xe_compute_on_all_engines(fd, POST_RECOVERY_WL);
> + else if (strcmp(injection, "test_l2-bank-corr-err-threshold-1") == 0)
> + test_l2_bank_corr_err_injection_with_threshold_1(mmio, fd);
> + else if (strcmp(injection, "test_l2-bank-corr-err-16-times") == 0)
> + test_l2_bank_corr_err_injection_16_times(mmio, fd);
> + else if (strcmp(injection, "test_l2-bank-single-corr-err") == 0)
> + test_l2_bank_single_corr_err_injection(mmio, fd);
> else
> igt_info("Invalid Error Injection specified\n");
> }
> @@ -335,6 +615,18 @@ int igt_main()
> inject_error("test_GT-UC-unicast-wkr-cmd-parity-err-post-recovery-wl", &mmio, fd);
> }
>
> + igt_describe("Inject GT correctable error and validate error-report event with threshold set to 1.");
> + igt_subtest("test_l2-bank-corr-err-threshold-1")
> + inject_error("test_l2-bank-corr-err-threshold-1", &mmio, fd);
> +
> + igt_describe("Inject GT correctable error 16 times and validate counter/event behavior.");
> + igt_subtest("test_l2-bank-corr-err-16-times")
> + inject_error("test_l2-bank-corr-err-16-times", &mmio, fd);
> +
> + igt_describe("Inject a single GT correctable error and validate counter increment.");
> + igt_subtest("test_l2-bank-single-corr-err")
> + inject_error("test_l2-bank-single-corr-err", &mmio, fd);
> +
> igt_fixture() {
> xe_mmio_access_fini(&mmio);
> drm_close_driver(fd);
> diff --git a/tests/intel/xe_err_injection.h b/tests/intel/xe_err_injection.h
> index a70e6af22..a4b99711e 100644
> --- a/tests/intel/xe_err_injection.h
> +++ b/tests/intel/xe_err_injection.h
> @@ -22,10 +22,21 @@
> #define STEER_SEMAPHORE_MGSR_3D_VALUE 0x1
>
> /* Node types for error counters*/
> +#define NODE_ID_CORRECTABLE_ERROR 0
> #define NODE_ID_UNCORRECTABLE_ERROR 1
>
> /* Error types for error counter */
> #define ERROR_ID_CORE_COMPUTE 1
>
> +/* L2 Bank (LBCFLOCKMSGREG) error injection */
> +#define L2_BANK_ERR_INJ 0xB1B4
> +#define DATA_1BIT_ERR_INJ_REQ (1 << 3)
> +#define FUSA_TEST_MODE_ERR_INJ_REQ (1 << 2)
> +#define MASK_BIT_FOR_DATA_1BIT_ERR_INJ_REQ (1 << 19)
> +#define MASK_BIT_FOR_FUSA_TEST_MODE_ERR_INJ_REQ (1 << 18)
> +#define L2_BANK_DATA_1BIT_ERR_INJ_CONFIG \
> + (DATA_1BIT_ERR_INJ_REQ | FUSA_TEST_MODE_ERR_INJ_REQ | \
> + MASK_BIT_FOR_DATA_1BIT_ERR_INJ_REQ | MASK_BIT_FOR_FUSA_TEST_MODE_ERR_INJ_REQ)
> +
> #endif /* XE_ERR_INJECTION_H */
>
[-- Attachment #2: Type: text/html, Size: 16521 bytes --]
next prev parent reply other threads:[~2026-09-11 8:22 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 7:33 [PATCH v4 00/10] Xe3P GPU Error Injection Test Suite with DRM RAS Netlink Support Ravi Kishore Koppuravuri
2026-09-03 7:33 ` [PATCH v4 01/10] drm-uapi/drm_ras: Sync with kernel b2207d4c4e84 Ravi Kishore Koppuravuri
2026-09-10 11:12 ` Raag Jadav
2026-09-11 4:19 ` Koppuravuri, Ravi Kishore
2026-09-03 7:33 ` [PATCH v4 02/10] lib/meson: Add libnl dependencies for DRM RAS support Ravi Kishore Koppuravuri
2026-09-10 8:45 ` Purkait, Soham
2026-09-03 7:33 ` [PATCH v4 03/10] lib/igt_drm_netlink: Introduce DRM RAS Netlink interface library Ravi Kishore Koppuravuri
2026-09-10 6:17 ` Purkait, Soham
2026-09-21 5:16 ` Tauro, Riana
2026-10-01 7:49 ` Koppuravuri, Ravi Kishore
2026-09-03 7:33 ` [PATCH v4 04/10] lib/igt_drm_netlink: add get_error_counter support Ravi Kishore Koppuravuri
2026-09-10 12:05 ` Purkait, Soham
2026-09-28 8:57 ` Tauro, Riana
2026-10-01 7:58 ` Koppuravuri, Ravi Kishore
2026-09-03 7:33 ` [PATCH v4 05/10] lib/igt_drm_netlink: add get_error_threshold command support Ravi Kishore Koppuravuri
2026-09-18 13:58 ` Purkait, Soham
2026-09-03 7:33 ` [PATCH v4 06/10] lib/igt_drm_netlink: add set_error_threshold " Ravi Kishore Koppuravuri
2026-09-11 11:48 ` Purkait, Soham
2026-10-01 8:07 ` Koppuravuri, Ravi Kishore
2026-09-03 7:33 ` [PATCH v4 07/10] tests/intel/xe_err_injection: Add GT UC Unicast GAM Walker Command Parity Error Injection Ravi Kishore Koppuravuri
2026-09-03 16:45 ` Purkait, Soham
2026-10-01 7:47 ` Koppuravuri, Ravi Kishore
2026-09-11 15:03 ` Kamil Konieczny
2026-10-01 8:07 ` Koppuravuri, Ravi Kishore
2026-09-21 5:09 ` Tauro, Riana
2026-09-03 7:33 ` [PATCH v4 08/10] lib/igt_drm_netlink: add event notify subscription and event wait support Ravi Kishore Koppuravuri
2026-09-18 15:03 ` Purkait, Soham
2026-09-03 7:33 ` [PATCH v4 09/10] tests/intel/xe_err_injection: Add tests for L2 bank Corr err threshold scenarios Ravi Kishore Koppuravuri
2026-09-11 8:14 ` Purkait, Soham [this message]
2026-10-01 8:02 ` Koppuravuri, Ravi Kishore
2026-09-03 7:33 ` [PATCH v4 10/10] tests/intel/xe_err_injection: add CRI GPU requirement check Ravi Kishore Koppuravuri
2026-09-10 6:19 ` Purkait, Soham
2026-10-01 7:55 ` Koppuravuri, Ravi Kishore
2026-09-03 20:21 ` ✓ Xe.CI.BAT: success for Xe3P GPU Error Injection Test Suite with DRM RAS Netlink Support (rev7) Patchwork
2026-09-03 20:56 ` ✓ i915.CI.BAT: " Patchwork
2026-09-04 8:50 ` ✓ Xe.CI.FULL: " Patchwork
2026-09-04 10:51 ` ✗ i915.CI.Full: failure " 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=92a2a31f-c7a5-49e0-91a8-3037631b1dc4@intel.com \
--to=soham.purkait@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=badal.nilawar@intel.com \
--cc=harish.chegondi@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=mallesh.koujalagi@intel.com \
--cc=raag.jadav@intel.com \
--cc=ravi.kishore.koppuravuri@intel.com \
--cc=riana.tauro@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.