* [Accel-config] [PATCH v2 3/5] accel-config: Add ats_disable attr to config-wq command
@ 2021-07-09 5:18 Xiaochen Shen
0 siblings, 0 replies; only message in thread
From: Xiaochen Shen @ 2021-07-09 5:18 UTC (permalink / raw)
To: accel-config
[-- Attachment #1: Type: text/plain, Size: 1629 bytes --]
Add ats_disable wq attribute to config-wq command.
Signed-off-by: Xiaochen Shen <xiaochen.shen(a)intel.com>
---
accfg/config_attr.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/accfg/config_attr.c b/accfg/config_attr.c
index e09b9b6..479b5a4 100644
--- a/accfg/config_attr.c
+++ b/accfg/config_attr.c
@@ -37,6 +37,7 @@ static struct wq_parameters wq_param = {
.threshold = INT_MAX,
.max_batch_size = INT_MAX,
.max_transfer_size = INT_MAX,
+ .ats_disable = INT_MAX,
};
static struct engine_parameters engine_param;
@@ -191,6 +192,13 @@ static int accel_config_parse_wq_attribs(struct accfg_device *device,
return -EINVAL;
}
+ if (wq_params->ats_disable > 1
+ && (wq_params->ats_disable != INT_MAX)) {
+ fprintf(stderr,
+ "valid ats-disable should be either 0 or 1\n");
+ return -EINVAL;
+ }
+
if (wq_params->mode) {
rc = accfg_wq_set_str_mode(wq, wq_params->mode);
if (rc < 0)
@@ -252,6 +260,12 @@ static int accel_config_parse_wq_attribs(struct accfg_device *device,
return rc;
}
+ if (wq_params->ats_disable != INT_MAX) {
+ rc = accfg_wq_set_ats_disable(wq, wq_params->ats_disable);
+ if (rc < 0)
+ return rc;
+ }
+
return 0;
}
@@ -411,6 +425,8 @@ int cmd_config_wq(int argc, const char **argv, void *ctx)
"specify max-batch-size used by wq"),
OPT_U64('x', "max-transfer-size", &wq_param.max_transfer_size,
"specify max-transfer-size used by wq"),
+ OPT_INTEGER('a', "ats-disable", &wq_param.ats_disable,
+ "specify ats-disble by wq"),
OPT_END(),
};
--
1.8.3.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-09 5:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 5:18 [Accel-config] [PATCH v2 3/5] accel-config: Add ats_disable attr to config-wq command Xiaochen Shen
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.