[Accel-config] [PATCH v3 3/5] accel-config: Add ats_disable attr to config-wq command

Xiaochen Shen <xiaochen.shen at intel.com>
Newsgroups dev.linux.lists.accel-config
Message-ID <[email protected]>
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..0f736a7 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 per wq ats-disble"),
 		OPT_END(),
 	};
 
-- 
1.8.3.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.