Skip to contentSkip to conversation

accel-config/test: fix dedicated mode wq size 1 failure

PATCH In review Tony Zhu 3 participants 3 messages Mar 29, 2022 – Mar 30, 2022

lore
Share & tools
lore

Tony Zhu

author
#0 lore raw

PATCH 1/1 accel-config/test: fix dedicated mode wq size 1 failure

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(-)
test/dsa_test.c +6 -6
index 8e8dc25..f593cdf 100644
@@ -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;
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · 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>
Reviewed-by Dave Jiang <dave.jiang(a)intel.com>

Wonder why it was set to size - 1 before.....

Quoted 62 lines
---
  test/dsa_test.c | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
test/dsa_test.c +6 -6
index 8e8dc25..f593cdf 100644
@@ -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;
Reviewed-by Dave Jiang
#2 lore raw

No confidence to remove the -1 when porting it.
That value is original used for both shared and dedicated, usually, when shared mode the threshold is less 1 than size(the logic is not good). I modified when shared mode loop range equal threshold, but didn't remove -1 for dedicated.
So the issue happened.

Tony(zhu, xinzhan)
Cube:SHZ1-3W-279
iNet:8821-5077

-----Original Message-----
From: Jiang, Dave <dave.jiang(a)intel.com>
Sent: Tuesday, March 29, 2022 11:11 PM
To: Zhu, Tony <tony.zhu(a)intel.com>; accel-config(a)lists.01.org; Thomas, Ramesh <ramesh.thomas(a)intel.com>
Subject: Re: [PATCH 1/1] accel-config/test: fix dedicated mode wq size 1 failure

Quoted 7 lines · 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>
Reviewed-by Dave Jiang <dave.jiang(a)intel.com>

Wonder why it was set to size - 1 before.....

Quoted 62 lines
---
  test/dsa_test.c | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
test/dsa_test.c index 8e8dc25..f593cdf renamed from test/dsa_test.c +0 -0

100644

test/dsa_test.c +6 -6
@@ -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;