[PATCH 1/1] accel-config/test: fix dedicated mode wq size 1 failure
by Tony Zhu
dsa_test fails on dedicated WQ size 1, the root cause is if the size is
1 and subtract 1, it is 0. So it is looped there. The correct way is
if it is shared mode, the test range is threshold. If it is dedicated,
the test range is wq size, don't need to subtract 1.
Signed-off-by: Tony Zhu <tony.zhu(a)intel.com>
---
test/dsa_test.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/dsa_test.c b/test/dsa_test.c
index 8e8dc25..f593cdf 100644
--- a/test/dsa_test.c
+++ b/test/dsa_test.c
@@ -51,7 +51,7 @@ static int test_batch(struct dsa_context *ctx, size_t buf_size,
if (ctx->dedicated == ACCFG_WQ_SHARED)
range = ctx->threshold;
else
- range = ctx->wq_size - 1;
+ range = ctx->wq_size;
while (itr > 0 && rc == DSA_STATUS_OK) {
i = (itr < range) ? itr : range;
@@ -226,7 +226,7 @@ static int test_dif(struct dsa_context *ctx, size_t buf_size,
if (ctx->dedicated == ACCFG_WQ_SHARED)
range = ctx->threshold;
else
- range = ctx->wq_size - 1;
+ range = ctx->wq_size;
while (itr > 0 && rc == DSA_STATUS_OK) {
i = (itr < range) ? itr : range;
@@ -303,7 +303,7 @@ static int test_noop(struct dsa_context *ctx, int tflags, int num_desc)
if (ctx->dedicated == ACCFG_WQ_SHARED)
range = ctx->threshold;
else
- range = ctx->wq_size - 1;
+ range = ctx->wq_size;
while (itr > 0 && rc == DSA_STATUS_OK) {
i = (itr < range) ? itr : range;
@@ -353,7 +353,7 @@ static int test_memory(struct dsa_context *ctx, size_t buf_size,
if (ctx->dedicated == ACCFG_WQ_SHARED)
range = ctx->threshold;
else
- range = ctx->wq_size - 1;
+ range = ctx->wq_size;
while (itr > 0 && rc == DSA_STATUS_OK) {
i = (itr < range) ? itr : range;
@@ -514,7 +514,7 @@ static int test_delta(struct dsa_context *ctx, size_t buf_size,
if (ctx->dedicated == ACCFG_WQ_SHARED)
range = ctx->threshold;
else
- range = ctx->wq_size - 1;
+ range = ctx->wq_size;
while (itr > 0 && rc == DSA_STATUS_OK) {
i = (itr < range) ? itr : range;
@@ -584,7 +584,7 @@ static int test_crc(struct dsa_context *ctx, size_t buf_size,
if (ctx->dedicated == ACCFG_WQ_SHARED)
range = ctx->threshold;
else
- range = ctx->wq_size - 1;
+ range = ctx->wq_size;
while (itr > 0 && rc == DSA_STATUS_OK) {
i = (itr < range) ? itr : range;
--
2.27.0
3 months
[PATCH] accel-config: Skip writing driver_name attr if not present
by Ramesh Thomas
Older drivers do not create driver_name attr. Skip writing driver_name
instead of failing if not present.
Signed-off-by: Ramesh Thomas <ramesh.thomas(a)intel.com>
---
accfg/lib/libaccfg.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/accfg/lib/libaccfg.c b/accfg/lib/libaccfg.c
index b4a9725..6af5802 100644
--- a/accfg/lib/libaccfg.c
+++ b/accfg/lib/libaccfg.c
@@ -2459,7 +2459,11 @@ ACCFG_EXPORT int accfg_wq_set_str_##field( \
return -errno; \
} \
} \
- if (sysfs_write_attr(ctx, path, buf) < 0) { \
+ rc = sysfs_write_attr(ctx, path, buf); \
+ if (rc < 0) { \
+ /* Silently skip attrs not supported by driver */ \
+ if (rc == -ENOENT && !strcmp(#field, "driver_name")) \
+ return 0; \
err(ctx, "%s: write failed: %s\n", \
accfg_wq_get_devname(wq), \
strerror(errno)); \
--
2.34.1
3 months
[PATCH v2] accel-config: clearify set field error output
by Dave Jiang
Present a clearer error message on which attribute failed to be written.
Signed-off-by: Dave Jiang <dave.jiang(a)intel.com>
---
v2:
- Fix grammar with commit message. (Tony)
accfg/lib/libaccfg.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/accfg/lib/libaccfg.c b/accfg/lib/libaccfg.c
index d9c1140e213d..f39bf788cefe 100644
--- a/accfg/lib/libaccfg.c
+++ b/accfg/lib/libaccfg.c
@@ -1923,8 +1923,9 @@ ACCFG_EXPORT int accfg_group_set_##field( \
return -errno; \
} \
if (sysfs_write_attr(ctx, path, buf) < 0) { \
- err(ctx, "%s: write failed: %s\n", \
+ err(ctx, "%s: %s attribute write failed: %s\n", \
accfg_group_get_devname(group), \
+ #field, \
strerror(errno)); \
save_last_error(group->device, NULL, group, NULL); \
return -errno; \
@@ -2381,8 +2382,9 @@ ACCFG_EXPORT int accfg_wq_set_##field( \
} \
} \
if (sysfs_write_attr(ctx, path, buf) < 0) { \
- err(ctx, "%s: write failed: %s\n", \
+ err(ctx, "%s: %s attribute write failed: %s\n", \
accfg_wq_get_devname(wq), \
+ #field, \
strerror(errno)); \
save_last_error(wq->device, wq, NULL, NULL); \
return -errno; \
@@ -2607,8 +2609,9 @@ ACCFG_EXPORT int accfg_engine_set_##field( \
return -errno; \
} \
if (sysfs_write_attr(ctx, path, buf) < 0) { \
- err(ctx, "%s: write failed: %s\n", \
+ err(ctx, "%s: %s attribute write failed: %s\n", \
accfg_engine_get_devname(engine), \
+ #field, \
strerror(errno)); \
save_last_error(engine->device, NULL, NULL, engine); \
return -errno; \
3 months, 1 week
[PATCH] accel-config: clearify set field error output
by Dave Jiang
Present a more clearer error message on what attribute failed to be written.
Signed-off-by: Dave Jiang <dave.jiang(a)intel.com>
---
accfg/lib/libaccfg.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/accfg/lib/libaccfg.c b/accfg/lib/libaccfg.c
index d9c1140e213d..f39bf788cefe 100644
--- a/accfg/lib/libaccfg.c
+++ b/accfg/lib/libaccfg.c
@@ -1923,8 +1923,9 @@ ACCFG_EXPORT int accfg_group_set_##field( \
return -errno; \
} \
if (sysfs_write_attr(ctx, path, buf) < 0) { \
- err(ctx, "%s: write failed: %s\n", \
+ err(ctx, "%s: %s attribute write failed: %s\n", \
accfg_group_get_devname(group), \
+ #field, \
strerror(errno)); \
save_last_error(group->device, NULL, group, NULL); \
return -errno; \
@@ -2381,8 +2382,9 @@ ACCFG_EXPORT int accfg_wq_set_##field( \
} \
} \
if (sysfs_write_attr(ctx, path, buf) < 0) { \
- err(ctx, "%s: write failed: %s\n", \
+ err(ctx, "%s: %s attribute write failed: %s\n", \
accfg_wq_get_devname(wq), \
+ #field, \
strerror(errno)); \
save_last_error(wq->device, wq, NULL, NULL); \
return -errno; \
@@ -2607,8 +2609,9 @@ ACCFG_EXPORT int accfg_engine_set_##field( \
return -errno; \
} \
if (sysfs_write_attr(ctx, path, buf) < 0) { \
- err(ctx, "%s: write failed: %s\n", \
+ err(ctx, "%s: %s attribute write failed: %s\n", \
accfg_engine_get_devname(engine), \
+ #field, \
strerror(errno)); \
save_last_error(engine->device, NULL, NULL, engine); \
return -errno; \
3 months, 1 week
[PATCH v1 1/1] accel-config/test: add driver name for config file in contrib
by Tony Zhu
driver name must be configured if kernel has such change, update
all usage profiles.
Signed-off-by: Tony Zhu <tony.zhu(a)intel.com>
---
contrib/configs/app_profile.conf | 2 ++
contrib/configs/net_profile.conf | 4 ++++
contrib/configs/os_profile.conf | 1 +
contrib/configs/storage_profile.conf | 2 ++
4 files changed, 9 insertions(+)
diff --git a/contrib/configs/app_profile.conf b/contrib/configs/app_profile.conf
index 3aa16ac..4f8ad22 100644
--- a/contrib/configs/app_profile.conf
+++ b/contrib/configs/app_profile.conf
@@ -19,6 +19,7 @@
"max_batch_size":32,
"max_transfer_size":16384,
"type":"user",
+ "driver_name":"user",
"name":"app1",
"threshold":6
}
@@ -46,6 +47,7 @@
"max_batch_size":32,
"max_transfer_size":2097152,
"type":"user",
+ "driver_name":"user",
"name":"app2",
"threshold":28
}
diff --git a/contrib/configs/net_profile.conf b/contrib/configs/net_profile.conf
index d84aecc..55b84a8 100644
--- a/contrib/configs/net_profile.conf
+++ b/contrib/configs/net_profile.conf
@@ -19,6 +19,7 @@
"max_batch_size":1024,
"max_transfer_size":16384,
"type":"user",
+ "driver_name":"user",
"name":"app1",
"threshold":0
}
@@ -46,6 +47,7 @@
"max_batch_size":1024,
"max_transfer_size":16384,
"type":"user",
+ "driver_name":"user",
"name":"app2",
"threshold":0
}
@@ -73,6 +75,7 @@
"max_batch_size":1024,
"max_transfer_size":16384,
"type":"user",
+ "driver_name":"user",
"name":"app3",
"threshold":0
}
@@ -100,6 +103,7 @@
"max_batch_size":1024,
"max_transfer_size":16384,
"type":"user",
+ "driver_name":"user",
"name":"app4",
"threshold":0
}
diff --git a/contrib/configs/os_profile.conf b/contrib/configs/os_profile.conf
index 077ce58..88a9224 100644
--- a/contrib/configs/os_profile.conf
+++ b/contrib/configs/os_profile.conf
@@ -19,6 +19,7 @@
"max_batch_size":32,
"max_transfer_size":2097152,
"type":"kernel",
+ "driver_name":"dmaengine",
"name":"dmaengine",
"threshold":15
}
diff --git a/contrib/configs/storage_profile.conf b/contrib/configs/storage_profile.conf
index 13f58c5..1ed5fcf 100644
--- a/contrib/configs/storage_profile.conf
+++ b/contrib/configs/storage_profile.conf
@@ -19,6 +19,7 @@
"max_batch_size":32,
"max_transfer_size":16384,
"type":"user",
+ "driver_name":"user",
"name":"app1",
"threshold":0
}
@@ -46,6 +47,7 @@
"max_batch_size":32,
"max_transfer_size":2097152,
"type":"user",
+ "driver_name":"user",
"name":"app2",
"threshold":0
}
--
2.27.0
3 months, 1 week
[PATCH v1 1/1] accel-config/test: add driver_name attribute config for dsa_test
by Tony Zhu
driver_name is new attribute added by kernel. It must be configured.
Signed-off-by: Tony Zhu <tony.zhu(a)intel.com>
---
test/configs/2g2q_user_1.conf | 2 ++
1 file changed, 2 insertions(+)
diff --git a/test/configs/2g2q_user_1.conf b/test/configs/2g2q_user_1.conf
index 7c55e72..566ee35 100644
--- a/test/configs/2g2q_user_1.conf
+++ b/test/configs/2g2q_user_1.conf
@@ -17,6 +17,7 @@
"priority":10,
"block_on_fault":1,
"type":"user",
+ "driver_name":"user",
"name":"app1",
"threshold":15
}
@@ -46,6 +47,7 @@
"priority":10,
"block_on_fault":1,
"type":"user",
+ "driver_name":"user",
"name":"app2",
"threshold":0
}
--
2.27.0
3 months, 1 week