From c58ef06259e6a4454ac6389be588934595ed6020 Mon Sep 17 00:00:00 2001 From: Jeff Shaw Date: Tue, 20 May 2025 12:45:20 -0700 Subject: [PATCH] dma_intel: fix ats_disable attribute handling Some DSA devices allow the Address Translation Service (ATS) to be controlled at the workqueue level. For those devices, the ats_disable attribute is exposed in sysfs. For devices that do not support ATS control per workqueue, and are driven by an idxd kernel driver >= 6.6, the ats_disable attribute is not visible in sysfs. This change fixes the DSA workqueue initialization to handle the case where the ats_disable sysfs attribute is not present. Type: fix Change-Id: Ia11a90686b9e1916ab50a4209b67f3270190c3f1 Signed-off-by: Jeff Shaw --- src/plugins/dma_intel/main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/dma_intel/main.c b/src/plugins/dma_intel/main.c index 0f9ac185b9d..ac5724355d9 100644 --- a/src/plugins/dma_intel/main.c +++ b/src/plugins/dma_intel/main.c @@ -161,9 +161,17 @@ intel_dsa_get_info (intel_dsa_channel_t *ch, clib_error_t **error) vec_reset_length (f); f = format (f, "%v/ats_disable%c", wq_dir_name, 0); err = clib_sysfs_read ((char *) f, "%s", &tmpstr); - if (err) + if (err && err->code == ENOENT) + { + /* ats_disable is not supported when it is invisible */ + ch->ats_disable = 0; + vec_free (err); + err = NULL; + } + else if (err) goto error; - ch->ats_disable = atoi ((char *) tmpstr); + else + ch->ats_disable = atoi ((char *) tmpstr); vec_reset_length (f); f = format (f, "%v/block_on_fault%c", wq_dir_name, 0); -- 2.16.6