accel-config: Return error if DSA environment not found
ramesh.thomas at intel.com
PATCH 1/1 accel-config: Return error if DSA environment not found
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
Check for presence of DSA sysfs folder /sys/bus/dsa before running commands. If not found print an error message and return -ENOENT
--- accfg/accel-config.c | 6 ++++++ 1 file changed, 6 insertions(+)
accfg/accel-config.c +6 -0
@@ -95,6 +95,12 @@ int main(int argc, const char **argv)return 0 ; } +if (access ("/sys/bus/dsa" ,R_OK )) { +fprintf (stderr, +"DSA environment not found. Is the driver loaded?\n" ); +return -ENOENT ; + } + rc =accfg_new (&ctx);if (rc)return 0 ;
Signature · 1 line
2.26.2
Dave Jiang
Quoted 15 lines · ramesh.thomas(a)intel.com
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
Check for presence of DSA sysfs folder
/sys/bus/dsabefore running commands. If not found print an error message and return-ENOENTSigned-off-by Ramesh Thomas <ramesh.thomas(a)intel.com>--- accfg/accel-config.c | 6 ++++++ 1 file changed, 6 insertions(+)accfg/accel-config.c +0
-0
accfg/accel-config.c int main(int argc, const char **argv) · line 98
Quoted 4 lines
accfg/accel-config.c +1
-0@@ -95,6 +95,12 @@ int main(int argc, const char **argv)return 0 ; } +if (access ("/sys/bus/dsa" ,R_OK )) {
For the most part this is fine. I wonder if there will ever be a platform with IAX and no DSA. Maybe check for dsa || iax?
Quoted 8 lines
accfg/accel-config.c +5
-0+fprintf (stderr, +"DSA environment not found. Is the driver loaded?\n" ); +return -ENOENT ; + } + rc =accfg_new (&ctx);if (rc)return 0 ;
Luck
Quoted 2 lines
For the most part this is fine. I wonder if there will ever be a platform with IAX and no DSA. Maybe check for dsa || iax?
Yes. Lunar Lake plans to include IAX for sure, but doubtful that DSA will be.
-Tony
Thomas
Quoted 5 lines · Tony Luck
Quoted 2 lines
For the most part this is fine. I wonder if there will ever be a platform with IAX and no DSA. Maybe check for dsa || iax?
Yes. Lunar Lake plans to include IAX for sure, but doubtful that DSA will be.
I think checking for idxd kernel module being loaded would take care of all scenarios.
- Ramesh
Dave Jiang
Quoted 9 lines · Ramesh
Quoted 4 lines · Tony Luck
Quoted 2 lines
For the most part this is fine. I wonder if there will ever be a platform with IAX and no DSA. Maybe check for dsa || iax?
Yes. Lunar Lake plans to include IAX for sure, but doubtful that DSA will be.
I think checking for idxd kernel module being loaded would take care of all scenarios.
- Ramesh
Yes I think so.