Content-Type: multipart/mixed; boundary="===============8591085608111625460==" MIME-Version: 1.0 From: Dave Jiang Subject: [Accel-config] Re: [PATCH v2] accel-config/test: Call uacce API to get wq file descriptor Date: Mon, 05 Apr 2021 21:13:57 -0700 Message-ID: In-Reply-To: 20210406014151.463929-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============8591085608111625460== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 4/5/2021 6:41 PM, ramesh.thomas(a)intel.com wrote: > From: Ramesh Thomas > > Char dev major/minor method of getting file descriptor is being replaced > by uacce interface. Replace calls to char dev API with new API to open > uacce device. > > Signed-off-by: Ramesh Thomas Reviewed-by: Dave Jiang > --- > V2: > Call the changed API name to get user device path > > test/dsa.c | 18 +++++++----------- > 1 file changed, 7 insertions(+), 11 deletions(-) > > diff --git a/test/dsa.c b/test/dsa.c > index 602bfb8..65ce807 100644 > --- a/test/dsa.c > +++ b/test/dsa.c > @@ -69,19 +69,15 @@ struct dsa_context *dsa_init(void) > = > static int dsa_setup_wq(struct dsa_context *ctx, struct accfg_wq *wq) > { > - struct accfg_device *dev; > - int major, minor; > - char path[1024]; > + char path[PATH_MAX]; > + int rc; > = > - dev =3D accfg_wq_get_device(wq); > - major =3D accfg_device_get_cdev_major(dev); > - if (major < 0) > - return -ENODEV; > - minor =3D accfg_wq_get_cdev_minor(wq); > - if (minor < 0) > - return -ENODEV; > + rc =3D accfg_wq_get_user_dev_path(wq, path, PATH_MAX); > + if (rc) { > + fprintf(stderr, "Error getting uacce device path\n"); > + return rc; > + } > = > - sprintf(path, "/dev/char/%u:%u", major, minor); > ctx->fd =3D open(path, O_RDWR); > if (ctx->fd < 0) { > perror("open"); --===============8591085608111625460==--