Content-Type: multipart/mixed; boundary="===============6550959457375944690==" MIME-Version: 1.0 From: Dave Jiang Subject: [Accel-config] Re: [PATCH v1] accel-config: Return error if DSA environment not found Date: Wed, 10 Feb 2021 11:23:03 -0700 Message-ID: <9a274444-1d97-3a54-7d6a-5cbb99ecc9b4@intel.com> In-Reply-To: 20210210180000.157677-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============6550959457375944690== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 2/10/2021 11:00 AM, ramesh.thomas(a)intel.com wrote: > From: Ramesh Thomas > > Check for presence of DSA sysfs folder /sys/bus/dsa before running > commands. If not found print an error message and return -ENOENT > > Signed-off-by: Ramesh Thomas > --- > accfg/accel-config.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/accfg/accel-config.c b/accfg/accel-config.c > index f963fc7..01a1cd9 100644 > --- a/accfg/accel-config.c > +++ b/accfg/accel-config.c > @@ -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? > + fprintf(stderr, > + "DSA environment not found. Is the driver loaded?\n"); > + return -ENOENT; > + } > + > rc =3D accfg_new(&ctx); > if (rc) > return 0; --===============6550959457375944690==--