From: ramesh.thomas at intel.com
To: accel-config@lists.01.org
Subject: [Accel-config] [PATCH v1 3/6] accel-config: Add API to check for mdev support availability
Date: Sat, 23 Jan 2021 00:35:39 -0500 [thread overview]
Message-ID: <20210123053542.615622-4-ramesh.thomas@intel.com> (raw)
In-Reply-To: 20210123053542.615622-1-ramesh.thomas@intel.com
[-- Attachment #1: Type: text/plain, Size: 2014 bytes --]
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
Add a function to check for mdev support availability to allow
mdev command implementations to bail out if support is not available.
Signed-off-by: Ramesh Thomas <ramesh.thomas(a)intel.com>
---
accfg/lib/libaccel-config.sym | 1 +
accfg/lib/libaccfg.c | 6 ++++++
accfg/libaccel_config.h | 1 +
3 files changed, 8 insertions(+)
diff --git a/accfg/lib/libaccel-config.sym b/accfg/lib/libaccel-config.sym
index 00f97d5..4de2a49 100644
--- a/accfg/lib/libaccel-config.sym
+++ b/accfg/lib/libaccel-config.sym
@@ -139,4 +139,5 @@ global:
accfg_mdev_basenames;
accfg_create_mdev;
accfg_remove_mdev;
+ accfg_device_get_mdev_enabled;
} LIBACCFG_6;
diff --git a/accfg/lib/libaccfg.c b/accfg/lib/libaccfg.c
index 69f0f71..a596c90 100644
--- a/accfg/lib/libaccfg.c
+++ b/accfg/lib/libaccfg.c
@@ -1229,6 +1229,12 @@ ACCFG_EXPORT bool accfg_device_get_pasid_enabled(
return device->pasid_enabled;
}
+ACCFG_EXPORT bool accfg_device_get_mdev_enabled(
+ struct accfg_device *device)
+{
+ return device->mdev_path != NULL;
+}
+
ACCFG_EXPORT int accfg_device_get_errors(struct accfg_device *device,
struct accfg_error *error)
{
diff --git a/accfg/libaccel_config.h b/accfg/libaccel_config.h
index 7fa3c2b..239d393 100644
--- a/accfg/libaccel_config.h
+++ b/accfg/libaccel_config.h
@@ -172,6 +172,7 @@ unsigned long accfg_device_get_op_cap(struct accfg_device *device);
unsigned long accfg_device_get_gen_cap(struct accfg_device *device);
unsigned int accfg_device_get_configurable(struct accfg_device *device);
bool accfg_device_get_pasid_enabled(struct accfg_device *device);
+bool accfg_device_get_mdev_enabled(struct accfg_device *device);
int accfg_device_get_errors(struct accfg_device *device, struct accfg_error *error);
enum accfg_device_state accfg_device_get_state(struct accfg_device *device);
unsigned int accfg_device_get_max_tokens(struct accfg_device *device);
--
2.26.2
reply other threads:[~2021-01-23 5:35 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=20210123053542.615622-4-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.