accel-config/SOURCES/0001-accel-config-test-only...

55 lines
2.0 KiB
Diff

From bcc6e90baa61434568e8225a7fcdc070610dae46 Mon Sep 17 00:00:00 2001
From: Jerry Snitselaar <jsnitsel@redhat.com>
Date: Thu, 30 Nov 2023 14:58:06 -0700
Subject: [PATCH] accel-config/test: only configure ats_disable if supported
'Content-type: text/plain'
Upstream Status: RHEL-only
Don't try to configure ats_disable if it isn't supported.
Temporary work around until there is a complete upstream
solution, and we don't ship the testing bits just use
them for test.
Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
---
test/libaccfg.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/test/libaccfg.c b/test/libaccfg.c
index bfe277b996cf..4a580b2bb02e 100644
--- a/test/libaccfg.c
+++ b/test/libaccfg.c
@@ -240,7 +240,9 @@ static int config_wq(struct accfg_ctx *ctx, struct accfg_device *device,
if (wq_param->threshold)
SET_ERR(rc, accfg_wq_set_threshold(wq, wq_param->threshold));
- SET_ERR(rc, accfg_wq_set_ats_disable(wq, wq_param->ats_disable));
+ if (accfg_wq_get_ats_disable(wq) >= 0) {
+ SET_ERR(rc, accfg_wq_set_ats_disable(wq, wq_param->ats_disable));
+ }
/* Don't fail test if per wq ats disable is not supported */
if (rc == -EOPNOTSUPP)
rc = 0;
@@ -251,6 +253,7 @@ static int config_wq(struct accfg_ctx *ctx, struct accfg_device *device,
static int check_wq(struct accfg_ctx *ctx, struct accfg_device *device,
struct accfg_wq *wq, struct wq_parameters *wq_param)
{
+ int ats_disable = 0;
if (wq_param->wq_size != accfg_wq_get_size(wq)) {
fprintf(stderr, "%s failed on wq_size\n", __func__);
@@ -290,7 +293,8 @@ static int check_wq(struct accfg_ctx *ctx, struct accfg_device *device,
fprintf(stderr, "%s failed on wq name\n", __func__);
return -EINVAL;
}
- if (wq_param->ats_disable != accfg_wq_get_ats_disable(wq)) {
+ ats_disable = accfg_wq_get_ats_disable(wq);
+ if (ats_disable >= 0 && (wq_param->ats_disable != ats_disable)) {
fprintf(stderr, "%s failed on ats_disable\n", __func__);
return -EINVAL;
}
--
2.41.0