From: ramesh.thomas at intel.com
To: accel-config@lists.01.org
Subject: [Accel-config] [PATCH] accel-config/test: Call uacce API to get wq file descriptor
Date: Mon, 05 Apr 2021 20:44:01 -0400 [thread overview]
Message-ID: <20210406004401.459221-1-ramesh.thomas@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
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 <ramesh.thomas(a)intel.com>
---
test/dsa.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/test/dsa.c b/test/dsa.c
index 602bfb8..b4e107b 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 = accfg_wq_get_device(wq);
- major = accfg_device_get_cdev_major(dev);
- if (major < 0)
- return -ENODEV;
- minor = accfg_wq_get_cdev_minor(wq);
- if (minor < 0)
- return -ENODEV;
+ rc = accfg_wq_get_uacce_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 = open(path, O_RDWR);
if (ctx->fd < 0) {
perror("open");
--
2.26.3
reply other threads:[~2021-04-06 0:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210406004401.459221-1-ramesh.thomas@intel.com \
--to=accel-config@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.