Skip to contentSkip to conversation

accel-config: Fix ats_disable unit test

PATCH In review Xiaochen Shen 2 participants 2 messages Jul 16, 2021

lore
Share & tools
lore

Xiaochen Shen

author
#0 lore raw

PATCH 1/1 accel-config: Fix ats_disable unit test

Don't fail test if per wq ats disable is not supported.

Fixes 7de00a1e1a58 ("accel-config: Add ats_disable unit test")
Signed-off-by Xiaochen Shen <xiaochen.shen(a)intel.com>
---
 test/libaccfg.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
test/libaccfg.c +5 -1
index 7849d63..1816f8e 100644
@@ -254,10 +254,14 @@ static int config_wq(struct accfg_ctx *ctx, struct accfg_device *device,
 	SET_ERR(rc, accfg_wq_set_max_batch_size(wq, wq_param->max_batch_size));
 	SET_ERR(rc, accfg_wq_set_max_transfer_size(wq,
 				wq_param->max_transfer_size));
-	SET_ERR(rc, accfg_wq_set_ats_disable(wq, wq_param->ats_disable));
 	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));
+	/* Don't fail test if per wq ats disable is not supported */
+	if (rc == -EOPNOTSUPP)
+		rc = 0;
+
 	return rc;
 }
 
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Xiaochen Shen

Don't fail test if per wq ats disable is not supported.

Fixes 7de00a1e1a58 ("accel-config: Add ats_disable unit test")
Signed-off-by Xiaochen Shen <xiaochen.shen(a)intel.com>
Reviewed-by Dave Jiang <dave.jiang(a)intel.com>
Quoted 24 lines
---
  test/libaccfg.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
test/libaccfg.c +5 -1
index 7849d63..1816f8e 100644
@@ -254,10 +254,14 @@ static int config_wq(struct accfg_ctx *ctx, struct accfg_device *device,
  	SET_ERR(rc, accfg_wq_set_max_batch_size(wq, wq_param->max_batch_size));
  	SET_ERR(rc, accfg_wq_set_max_transfer_size(wq,
  				wq_param->max_transfer_size));
-	SET_ERR(rc, accfg_wq_set_ats_disable(wq, wq_param->ats_disable));
  	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));
+	/* Don't fail test if per wq ats disable is not supported */
+	if (rc == -EOPNOTSUPP)
+		rc = 0;
+
  	return rc;
  }