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 <[email protected]>
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);