All of lore.kernel.org
 help / color / mirror / Atom feed
* [Accel-config] [PATCH 3/3] accel-config/test: Skip shared wq config test if shm support
@ 2021-08-12  2:34 ramesh.thomas
  0 siblings, 0 replies; only message in thread
From: ramesh.thomas @ 2021-08-12  2:34 UTC (permalink / raw)
  To: accel-config

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

From: Ramesh Thomas <ramesh.thomas(a)intel.com>

Skip config tests that use shared wqs if shared memory support is not
available.

Signed-off-by: Ramesh Thomas <ramesh.thomas(a)intel.com>
---
 test/libaccfg.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/test/libaccfg.c b/test/libaccfg.c
index 9ac4bcd..5a17650 100644
--- a/test/libaccfg.c
+++ b/test/libaccfg.c
@@ -244,7 +244,9 @@ static int config_wq(struct accfg_ctx *ctx, struct accfg_device *device,
 {
 	int rc = 0;
 
-	SET_ERR(rc, accfg_wq_set_str_mode(wq, wq_param->mode));
+	rc = accfg_wq_set_str_mode(wq, wq_param->mode);
+	if (rc)
+		return rc;
 	SET_ERR(rc, accfg_wq_set_str_type(wq, wq_param->type));
 	SET_ERR(rc, accfg_wq_set_str_name(wq, wq_param->name));
 	SET_ERR(rc, accfg_wq_set_size(wq, wq_param->wq_size));
@@ -677,8 +679,14 @@ static int test_config_shared(struct accfg_ctx *ctx)
 		return rc;
 
 	rc = set_config(ctx, &test_ctx, "shared");
-	if (rc)
+	if (rc) {
+		if (rc == -EINVAL) {
+			fprintf(stderr, "shared wq support not available\n");
+			device_test_reset(ctx, test_ctx.device, false);
+			return -EOPNOTSUPP;
+		}
 		return rc;
+	}
 
 	rc = check_config(ctx, &test_ctx, "shared");
 	if (rc)
-- 
2.26.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-12  2:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12  2:34 [Accel-config] [PATCH 3/3] accel-config/test: Skip shared wq config test if shm support 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.