* [Accel-config] [PATCH v1 3/6] accel-config: Add API to check for mdev support availability
@ 2021-01-23 5:35 ramesh.thomas
0 siblings, 0 replies; only message in thread
From: ramesh.thomas @ 2021-01-23 5:35 UTC (permalink / raw)
To: accel-config
[-- 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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-23 5:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-23 5:35 [Accel-config] [PATCH v1 3/6] accel-config: Add API to check for mdev support availability ramesh.thomas
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.