Skip to contentSkip to conversation

Add Zcompress32, Zdecompress32, Compress and Decompress test.

PATCH RESEND New Li Zhang 1 participant 15 messages Jun 7, 2022

lore
Share & tools
lore

Li Zhang

author
#0 lore raw

cover Add Zcompress32, Zdecompress32, Compress and Decompress test.

Add software algorithms of Zcompress32, Zdecompress32 and Decompress, add operation Zcompress32, Zdecompress32, Compress and Decompress test code, modify Makefile and test script.

Li Zhang (14):
accel-config/test: Add algorithm to do Zcompress32 accel-config/test: Add test code of operation Zcompress32 accel-config/test: Modify script for executing Zcompress32 test accel-config/test: Add algorithm to do Zdecompress32 accel-config/test: Add test code of operation Zdecompress32 accel-config/test: Modify script for executing Zdecompress32 test accel-config/test: Add function to do Decompress accel-config/test: Add macros for IAA Compress register accel-config/test: Add test code of operation Compress accel-config/test: Modify script for executing Compress test accel-config/test: Add macros for IAA Decompress register accel-config/test: Add element input_size to struct task accel-config/test: Add test code of operation Decompress accel-config/test: Modify script for executing Decompress test

 accfg/idxd.h                    |  10 +
 test/Makefile.am                |   5 +-
 test/accel_test.h               |   1 +
 test/algorithms/iaa_compress.c  |  58 ++++
 test/algorithms/iaa_compress.h  | 413 +++++++++++++++++++++++
 test/algorithms/iaa_zcompress.c |  77 +++++
 test/algorithms/iaa_zcompress.h |   2 +
 test/iaa.c                      | 569 +++++++++++++++++++++++++++++++-
 test/iaa.h                      |  13 +
 test/iaa_prep.c                 |  50 +++
 test/iaa_test.c                 |  97 +++++-
 test/iaa_user_test_runner.sh    |   4 +-
 12 files changed, 1292 insertions(+), 7 deletions(-)
 create mode 100644 test/algorithms/iaa_compress.c
 create mode 100644 test/algorithms/iaa_compress.h
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH RESEND 1/14 accel-config/test: Add algorithm to do Zcompress32

Add an algorithm to implement Zcompress32, it is used to generate a reference data for comparing with the result from IAA hardware.

Signed-off-by Li Zhang <li4.zhang(a)intel.com>
---
 test/algorithms/iaa_zcompress.c | 45 +++++++++++++++++++++++++++++++++
 test/algorithms/iaa_zcompress.h |  1 +
 2 files changed, 46 insertions(+)
test/algorithms/iaa_zcompress.c +45 -0
index b58a6e6..1126466 100644
@@ -86,6 +86,51 @@ int iaa_do_zcompress16(void *dst, void *src, int src_len)
 	return dst_len;
 }
 
+int iaa_do_zcompress32(void *dst, void *src, int src_len)
+{
+	int i, j, dst_len = 0;
+	uint32_t *tags;
+	int num_blocks = src_len / IAA_ZCOMPRESS_BLOCK_SIZE;
+	int remainder_bytes = src_len % IAA_ZCOMPRESS_BLOCK_SIZE;
+	uint32_t *src_ptr = (uint32_t *)src;
+	uint32_t *dst_ptr = (uint32_t *)dst;
+
+	for (i = 0; i < num_blocks; i++) {
+		tags = dst_ptr;
+		dst_ptr += 1;
+		dst_len += 4;
+		for (j = 0; j < (IAA_ZCOMPRESS_BLOCK_SIZE / 4); j++) {
+			if (*src_ptr != 0) {
+				*tags |= ((uint32_t)1 << j);
+				*dst_ptr++ = *src_ptr;
+				dst_len += 4;
+			}
+
+			src_ptr++;
+		}
+	}
+
+	if (remainder_bytes) {
+		tags = dst_ptr;
+		*tags = 0xFFFFFFFF;
+		dst_ptr += 1;
+		dst_len += 4;
+
+		for (i = 0; i < (remainder_bytes / 4); i++) {
+			if (*src_ptr == 0) {
+				*tags &= ~((uint32_t)1 << i);
+			} else {
+				*dst_ptr++ = *src_ptr;
+				dst_len += 4;
+			}
+
+			src_ptr++;
+		}
+	}
+
+	return dst_len;
+}
+
 int iaa_do_zdecompress16(void *dst, void *src, int src_len)
 {
 	int i, j, dst_len = 0;
test/algorithms/iaa_zcompress.h +1 -0
index eb47278..a2b37e9 100644
@@ -8,5 +8,6 @@
 void iaa_zcompress16_randomize_input(void *dst, uint64_t pattern, int len);
 int iaa_do_zcompress16(void *dst, void *src, int src_len);
 int iaa_do_zdecompress16(void *dst, void *src, int src_len);
+int iaa_do_zcompress32(void *dst, void *src, int src_len);
 
 #endif
Signature · 1 line
2.25.1
author
#2 lore raw

PATCH RESEND 2/14 accel-config/test: Add test code of operation Zcompress32

In reply to Li Zhang

Add test code of operation Zcompress32

Signed-off-by Li Zhang <li4.zhang(a)intel.com>
---
 test/iaa.c      | 125 +++++++++++++++++++++++++++++++++++++++++++++++-
 test/iaa.h      |   3 ++
 test/iaa_prep.c |  11 +++++
 test/iaa_test.c |  16 +++++--
 4 files changed, 148 insertions(+), 7 deletions(-)
test/iaa.c +123 -2
index 2002be1..f3d45f5 100644
@@ -94,6 +94,33 @@ static int init_zdecompress16(struct task *tsk, int tflags, int opcode, unsigned
 	return ACCTEST_STATUS_OK;
 }
 
+static int init_zcompress32(struct task *tsk, int tflags, int opcode, unsigned long src1_xfer_size)
+{
+	tsk->pattern = 0x98765432abcdef01;
+	tsk->opcode = opcode;
+	tsk->test_flags = tflags;
+	tsk->xfer_size = src1_xfer_size;
+
+	tsk->src1 = aligned_alloc(ADDR_ALIGNMENT, src1_xfer_size);
+	if (!tsk->src1)
+		return -ENOMEM;
+	iaa_zcompress16_randomize_input(tsk->src1, tsk->pattern, src1_xfer_size);
+
+	tsk->dst1 = aligned_alloc(ADDR_ALIGNMENT, src1_xfer_size * 2);
+	if (!tsk->dst1)
+		return -ENOMEM;
+	memset_pattern(tsk->dst1, 0, src1_xfer_size * 2);
+
+	tsk->output = aligned_alloc(ADDR_ALIGNMENT, src1_xfer_size * 2);
+	if (!tsk->output)
+		return -ENOMEM;
+	memset_pattern(tsk->output, 0, src1_xfer_size * 2);
+
+	tsk->iaa_max_dst_size = src1_xfer_size * 2;
+
+	return ACCTEST_STATUS_OK;
+}
+
 int init_task(struct task *tsk, int tflags, int opcode, unsigned long src1_xfer_size)
 {
 	int rc = 0;
@@ -111,6 +138,9 @@ int init_task(struct task *tsk, int tflags, int opcode, unsigned long src1_xfer_
 	case IAX_OPCODE_ZDECOMPRESS16:
 		rc = init_zdecompress16(tsk, tflags, opcode, src1_xfer_size);
 		break;
+	case IAX_OPCODE_ZCOMPRESS32:
+		rc = init_zcompress32(tsk, tflags, opcode, src1_xfer_size);
+		break;
 	}
 
 	if (rc != ACCTEST_STATUS_OK) {
@@ -309,6 +339,53 @@ int iaa_zdecompress16_multi_task_nodes(struct acctest_context *ctx)
 	return ret;
 }
 
+static int iaa_wait_zcompress32(struct acctest_context *ctx, struct task *tsk)
+{
+	struct completion_record *comp = tsk->comp;
+	int rc;
+
+	rc = acctest_wait_on_desc_timeout(comp, ctx, ms_timeout);
+	if (rc < 0) {
+		err("zcompress32 desc timeout\n");
+		return ACCTEST_STATUS_TIMEOUT;
+	}
+
+	return ACCTEST_STATUS_OK;
+}
+
+int iaa_zcompress32_multi_task_nodes(struct acctest_context *ctx)
+{
+	struct task_node *tsk_node = ctx->multi_task_node;
+	int ret = ACCTEST_STATUS_OK;
+
+	while (tsk_node) {
+		tsk_node->tsk->dflags |= (IDXD_OP_FLAG_CRAV | IDXD_OP_FLAG_RCR);
+		if ((tsk_node->tsk->test_flags & TEST_FLAGS_BOF) && ctx->bof)
+			tsk_node->tsk->dflags |= IDXD_OP_FLAG_BOF;
+
+		iaa_prep_zcompress32(tsk_node->tsk);
+		tsk_node = tsk_node->next;
+	}
+
+	info("Submitted all zcompress32 jobs\n");
+	tsk_node = ctx->multi_task_node;
+	while (tsk_node) {
+		acctest_desc_submit(ctx, tsk_node->tsk->desc);
+		tsk_node = tsk_node->next;
+	}
+
+	tsk_node = ctx->multi_task_node;
+	while (tsk_node) {
+		ret = iaa_wait_zcompress32(ctx, tsk_node->tsk);
+		if (ret != ACCTEST_STATUS_OK)
+			info("Desc: %p failed with ret: %d\n",
+			     tsk_node->tsk->desc, tsk_node->tsk->comp->status);
+		tsk_node = tsk_node->next;
+	}
+
+	return ret;
+}
+
 /* mismatch_expected: expect mismatched buffer with success status 0x1 */
 int iaa_task_result_verify(struct task *tsk, int mismatch_expected)
 {
@@ -329,6 +406,9 @@ int iaa_task_result_verify(struct task *tsk, int mismatch_expected)
 	case IAX_OPCODE_ZDECOMPRESS16:
 		ret = task_result_verify_zdecompress16(tsk, mismatch_expected);
 		break;
+	case IAX_OPCODE_ZCOMPRESS32:
+		ret = task_result_verify_zcompress32(tsk, mismatch_expected);
+		break;
 	}
 
 	if (ret == ACCTEST_STATUS_OK)
@@ -416,7 +496,7 @@ int task_result_verify_zcompress16(struct task *tsk, int mismatch_expected)
 		if (rc) {
 			err("zcompress16 mismatch, memcmp rc %d\n", rc);
 			for (i = 0; i < (expected_len / 2); i++) {
-				printf("Exp[%d]=0x%04X, Act[%d]=0x%4X\n",
+				printf("Exp[%d]=0x%04X, Act[%d]=0x%04X\n",
 				       i, ((uint16_t *)tsk->output)[i],
 				       i, ((uint16_t *)tsk->dst1)[i]);
 			}
@@ -457,7 +537,7 @@ int task_result_verify_zdecompress16(struct task *tsk, int mismatch_expected)
 		if (rc) {
 			err("zdecompress16 mismatch, memcmp rc %d\n", rc);
 			for (i = 0; i < (expected_len / 2); i++) {
-				printf("Exp[%d]=0x%04X, Act[%d]=0x%4X\n",
+				printf("Exp[%d]=0x%04X, Act[%d]=0x%04X\n",
 				       i, ((uint16_t *)tsk->output)[i],
 				       i, ((uint16_t *)tsk->dst1)[i]);
 			}
@@ -475,3 +555,44 @@ int task_result_verify_zdecompress16(struct task *tsk, int mismatch_expected)
 
 	return -ENXIO;
 }
+
+int task_result_verify_zcompress32(struct task *tsk, int mismatch_expected)
+{
+	int i;
+	int rc;
+	int expected_len;
+
+	if (mismatch_expected)
+		warn("invalid arg mismatch_expected for %d\n", tsk->opcode);
+
+	expected_len = iaa_do_zcompress32(tsk->output, tsk->src1, tsk->xfer_size);
+	rc = memcmp(tsk->dst1, tsk->output, expected_len);
+
+	if (!mismatch_expected) {
+		if (expected_len - tsk->comp->iax_output_size) {
+			err("zcompress32 mismatch, exp len %d, act len %d\n",
+			    expected_len, tsk->comp->iax_output_size);
+
+			return -ENXIO;
+		}
+		if (rc) {
+			err("zcompress32 mismatch, memcmp rc %d\n", rc);
+			for (i = 0; i < (expected_len / 4); i++) {
+				printf("Exp[%d]=0x%08X, Act[%d]=0x%08X\n",
+				       i, ((uint32_t *)tsk->output)[i],
+				       i, ((uint32_t *)tsk->dst1)[i]);
+			}
+
+			return -ENXIO;
+		}
+		return ACCTEST_STATUS_OK;
+	}
+
+	/* mismatch_expected */
+	if (rc) {
+		info("expected mismatch\n");
+		return ACCTEST_STATUS_OK;
+	}
+
+	return -ENXIO;
+}
test/iaa.h +3 -0
index 6303c7f..9746466 100644
@@ -13,15 +13,18 @@ int iaa_noop_multi_task_nodes(struct acctest_context *ctx);
 int iaa_crc64_multi_task_nodes(struct acctest_context *ctx);
 int iaa_zcompress16_multi_task_nodes(struct acctest_context *ctx);
 int iaa_zdecompress16_multi_task_nodes(struct acctest_context *ctx);
+int iaa_zcompress32_multi_task_nodes(struct acctest_context *ctx);
 void iaa_prep_noop(struct task *tsk);
 void iaa_prep_crc64(struct task *tsk);
 void iaa_prep_zcompress16(struct task *tsk);
 void iaa_prep_zdecompress16(struct task *tsk);
+void iaa_prep_zcompress32(struct task *tsk);
 
 int iaa_task_result_verify(struct task *tsk, int mismatch_expected);
 int iaa_task_result_verify_task_nodes(struct acctest_context *ctx, int mismatch_expected);
 int task_result_verify_crc64(struct task *tsk, int mismatch_expected);
 int task_result_verify_zcompress16(struct task *tsk, int mismatch_expected);
 int task_result_verify_zdecompress16(struct task *tsk, int mismatch_expected);
+int task_result_verify_zcompress32(struct task *tsk, int mismatch_expected);
 
 #endif
test/iaa_prep.c +11 -0
index e4f7578..7aff1e2 100644
@@ -53,3 +53,14 @@ void iaa_prep_zdecompress16(struct task *tsk)
 	tsk->desc->iax_max_dst_size = tsk->iaa_max_dst_size;
 	tsk->comp->status = 0;
 }
+
+void iaa_prep_zcompress32(struct task *tsk)
+{
+	info("preparing descriptor for zcompress32\n");
+
+	acctest_prep_desc_common(tsk->desc, tsk->opcode, (uint64_t)(tsk->dst1),
+				 (uint64_t)(tsk->src1), tsk->xfer_size, tsk->dflags);
+	tsk->desc->completion_addr = (uint64_t)(tsk->comp);
+	tsk->desc->iax_max_dst_size = tsk->iaa_max_dst_size;
+	tsk->comp->status = 0;
+}
test/iaa_test.c +11 -5
index b5fa0af..7141979 100644
@@ -184,6 +184,16 @@ static int test_zcompress(struct acctest_context *ctx, size_t buf_size,
 			if (rc != ACCTEST_STATUS_OK)
 				return rc;
 
+			/* Verification of all the nodes*/
+			rc = iaa_task_result_verify_task_nodes(ctx, 0);
+			if (rc != ACCTEST_STATUS_OK)
+				return rc;
+			break;
+		case IAX_OPCODE_ZCOMPRESS32:
+			rc = iaa_zcompress32_multi_task_nodes(ctx);
+			if (rc != ACCTEST_STATUS_OK)
+				return rc;
+
 			/* Verification of all the nodes*/
 			rc = iaa_task_result_verify_task_nodes(ctx, 0);
 			if (rc != ACCTEST_STATUS_OK)
@@ -287,12 +297,8 @@ int main(int argc, char *argv[])
 		break;
 
 	case IAX_OPCODE_ZCOMPRESS16:
-		rc = test_zcompress(iaa, buf_size, tflags, opcode, num_desc);
-		if (rc != ACCTEST_STATUS_OK)
-			goto error;
-		break;
-
 	case IAX_OPCODE_ZDECOMPRESS16:
+	case IAX_OPCODE_ZCOMPRESS32:
 		rc = test_zcompress(iaa, buf_size, tflags, opcode, num_desc);
 		if (rc != ACCTEST_STATUS_OK)
 			goto error;
Signature · 1 line
2.25.1
author
#3 lore raw

PATCH RESEND 3/14 accel-config/test: Modify script for executing Zcompress32 test

In reply to Li Zhang

Modify test script for passing parameters and executing operation Zcompress32 test.

Signed-off-by Li Zhang <li4.zhang(a)intel.com>
---
 test/iaa_user_test_runner.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
test/iaa_user_test_runner.sh +2 -2
index a8efaf5..af2f8ac 100755
@@ -117,13 +117,13 @@ unset SIZE_1
 
 flag="0x1"
 echo "Testing with 'block on fault' flag ON"
-for opcode in "0x4d" "0x49"; do
+for opcode in "0x4d" "0x49" "0x4c"; do
 	test_op $opcode $flag
 done
 
 flag="0x0"
 echo "Testing with 'block on fault' flag OFF"
-for opcode in "0x4d" "0x49"; do
+for opcode in "0x4d" "0x49" "0x4c"; do
 	test_op $opcode $flag
 done
 
Signature · 1 line
2.25.1
author
#4 lore raw

PATCH RESEND 4/14 accel-config/test: Add algorithm to do Zdecompress32

In reply to Li Zhang

Add an algorithm to implement Zdecompress32, it is used to generate a reference data for comparing with the result from IAA hardware.

Signed-off-by Li Zhang <li4.zhang(a)intel.com>
---
 test/algorithms/iaa_zcompress.c | 32 ++++++++++++++++++++++++++++++++
 test/algorithms/iaa_zcompress.h |  1 +
 2 files changed, 33 insertions(+)
test/algorithms/iaa_zcompress.c +32 -0
index 1126466..d3d47e8 100644
@@ -164,3 +164,35 @@ int iaa_do_zdecompress16(void *dst, void *src, int src_len)
 
 	return dst_len;
 }
+
+int iaa_do_zdecompress32(void *dst, void *src, int src_len)
+{
+	int i, j, dst_len = 0;
+	uint32_t tags;
+	int remainder_len = src_len;
+	uint32_t *src_ptr = (uint32_t *)src;
+	uint32_t *dst_ptr = (uint32_t *)dst;
+
+	for (i = 0; i < (src_len / 4); i++) {
+		tags = *src_ptr++;
+		remainder_len -= 4;
+
+		for (j = 0; j < 32; j++) {
+			if (tags & ((uint32_t)1 << j)) {
+				if (remainder_len <= 0)
+					break;
+				*dst_ptr++ = *src_ptr++;
+				remainder_len -= 4;
+			} else {
+				*dst_ptr++ = 0;
+			}
+
+			dst_len += 4;
+		}
+
+		if (remainder_len <= 0)
+			break;
+	}
+
+	return dst_len;
+}
test/algorithms/iaa_zcompress.h +1 -0
index a2b37e9..357b558 100644
@@ -9,5 +9,6 @@ void iaa_zcompress16_randomize_input(void *dst, uint64_t pattern, int len);
 int iaa_do_zcompress16(void *dst, void *src, int src_len);
 int iaa_do_zdecompress16(void *dst, void *src, int src_len);
 int iaa_do_zcompress32(void *dst, void *src, int src_len);
+int iaa_do_zdecompress32(void *dst, void *src, int src_len);
 
 #endif
Signature · 1 line
2.25.1
author
#5 lore raw

PATCH RESEND 5/14 accel-config/test: Add test code of operation Zdecompress32

In reply to Li Zhang

Add test code of operation Zdecompress32

Signed-off-by Li Zhang <li4.zhang(a)intel.com>
---
 test/iaa.c      | 126 ++++++++++++++++++++++++++++++++++++++++++++++++
 test/iaa.h      |   3 ++
 test/iaa_prep.c |  11 +++++
 test/iaa_test.c |  11 +++++
 4 files changed, 151 insertions(+)
test/iaa.c +126 -0
index f3d45f5..524446a 100644
@@ -121,6 +121,38 @@ static int init_zcompress32(struct task *tsk, int tflags, int opcode, unsigned l
 	return ACCTEST_STATUS_OK;
 }
 
+static int init_zdecompress32(struct task *tsk, int tflags, int opcode, unsigned long input_size)
+{
+	tsk->pattern = 0x98765432abcdef01;
+	tsk->opcode = opcode;
+	tsk->test_flags = tflags;
+
+	tsk->input = aligned_alloc(ADDR_ALIGNMENT, input_size);
+	if (!tsk->input)
+		return -ENOMEM;
+	iaa_zcompress16_randomize_input(tsk->input, tsk->pattern, input_size);
+
+	tsk->src1 = aligned_alloc(ADDR_ALIGNMENT, input_size * 2);
+	if (!tsk->src1)
+		return -ENOMEM;
+	memset_pattern(tsk->src1, 0, input_size * 2);
+	tsk->xfer_size = iaa_do_zcompress32(tsk->src1, tsk->input, input_size);
+
+	tsk->dst1 = aligned_alloc(ADDR_ALIGNMENT, input_size);
+	if (!tsk->dst1)
+		return -ENOMEM;
+	memset_pattern(tsk->dst1, 0, input_size);
+
+	tsk->output = aligned_alloc(ADDR_ALIGNMENT, input_size);
+	if (!tsk->output)
+		return -ENOMEM;
+	memset_pattern(tsk->output, 0, input_size);
+
+	tsk->iaa_max_dst_size = input_size;
+
+	return ACCTEST_STATUS_OK;
+}
+
 int init_task(struct task *tsk, int tflags, int opcode, unsigned long src1_xfer_size)
 {
 	int rc = 0;
@@ -141,6 +173,9 @@ int init_task(struct task *tsk, int tflags, int opcode, unsigned long src1_xfer_
 	case IAX_OPCODE_ZCOMPRESS32:
 		rc = init_zcompress32(tsk, tflags, opcode, src1_xfer_size);
 		break;
+	case IAX_OPCODE_ZDECOMPRESS32:
+		rc = init_zdecompress32(tsk, tflags, opcode, src1_xfer_size);
+		break;
 	}
 
 	if (rc != ACCTEST_STATUS_OK) {
@@ -386,6 +421,53 @@ int iaa_zcompress32_multi_task_nodes(struct acctest_context *ctx)
 	return ret;
 }
 
+static int iaa_wait_zdecompress32(struct acctest_context *ctx, struct task *tsk)
+{
+	struct completion_record *comp = tsk->comp;
+	int rc;
+
+	rc = acctest_wait_on_desc_timeout(comp, ctx, ms_timeout);
+	if (rc < 0) {
+		err("zdecompress32 desc timeout\n");
+		return ACCTEST_STATUS_TIMEOUT;
+	}
+
+	return ACCTEST_STATUS_OK;
+}
+
+int iaa_zdecompress32_multi_task_nodes(struct acctest_context *ctx)
+{
+	struct task_node *tsk_node = ctx->multi_task_node;
+	int ret = ACCTEST_STATUS_OK;
+
+	while (tsk_node) {
+		tsk_node->tsk->dflags |= (IDXD_OP_FLAG_CRAV | IDXD_OP_FLAG_RCR);
+		if ((tsk_node->tsk->test_flags & TEST_FLAGS_BOF) && ctx->bof)
+			tsk_node->tsk->dflags |= IDXD_OP_FLAG_BOF;
+
+		iaa_prep_zdecompress32(tsk_node->tsk);
+		tsk_node = tsk_node->next;
+	}
+
+	info("Submitted all zdecompress32 jobs\n");
+	tsk_node = ctx->multi_task_node;
+	while (tsk_node) {
+		acctest_desc_submit(ctx, tsk_node->tsk->desc);
+		tsk_node = tsk_node->next;
+	}
+
+	tsk_node = ctx->multi_task_node;
+	while (tsk_node) {
+		ret = iaa_wait_zdecompress32(ctx, tsk_node->tsk);
+		if (ret != ACCTEST_STATUS_OK)
+			info("Desc: %p failed with ret: %d\n",
+			     tsk_node->tsk->desc, tsk_node->tsk->comp->status);
+		tsk_node = tsk_node->next;
+	}
+
+	return ret;
+}
+
 /* mismatch_expected: expect mismatched buffer with success status 0x1 */
 int iaa_task_result_verify(struct task *tsk, int mismatch_expected)
 {
@@ -409,6 +491,9 @@ int iaa_task_result_verify(struct task *tsk, int mismatch_expected)
 	case IAX_OPCODE_ZCOMPRESS32:
 		ret = task_result_verify_zcompress32(tsk, mismatch_expected);
 		break;
+	case IAX_OPCODE_ZDECOMPRESS32:
+		ret = task_result_verify_zdecompress32(tsk, mismatch_expected);
+		break;
 	}
 
 	if (ret == ACCTEST_STATUS_OK)
@@ -596,3 +681,44 @@ int task_result_verify_zcompress32(struct task *tsk, int mismatch_expected)
 
 	return -ENXIO;
 }
+
+int task_result_verify_zdecompress32(struct task *tsk, int mismatch_expected)
+{
+	int i;
+	int rc;
+	int expected_len;
+
+	if (mismatch_expected)
+		warn("invalid arg mismatch_expected for %d\n", tsk->opcode);
+
+	expected_len = iaa_do_zdecompress32(tsk->output, tsk->src1, tsk->xfer_size);
+	rc = memcmp(tsk->dst1, tsk->output, expected_len);
+
+	if (!mismatch_expected) {
+		if (expected_len - tsk->comp->iax_output_size) {
+			err("zdecompress32 mismatch, exp len %d, act len %d\n",
+			    expected_len, tsk->comp->iax_output_size);
+
+			return -ENXIO;
+		}
+		if (rc) {
+			err("zdecompress32 mismatch, memcmp rc %d\n", rc);
+			for (i = 0; i < (expected_len / 4); i++) {
+				printf("Exp[%d]=0x%08X, Act[%d]=0x%08X\n",
+				       i, ((uint32_t *)tsk->output)[i],
+				       i, ((uint32_t *)tsk->dst1)[i]);
+			}
+
+			return -ENXIO;
+		}
+		return ACCTEST_STATUS_OK;
+	}
+
+	/* mismatch_expected */
+	if (rc) {
+		info("expected mismatch\n");
+		return ACCTEST_STATUS_OK;
+	}
+
+	return -ENXIO;
+}
test/iaa.h +3 -0
index 9746466..2a14781 100644
@@ -14,11 +14,13 @@ int iaa_crc64_multi_task_nodes(struct acctest_context *ctx);
 int iaa_zcompress16_multi_task_nodes(struct acctest_context *ctx);
 int iaa_zdecompress16_multi_task_nodes(struct acctest_context *ctx);
 int iaa_zcompress32_multi_task_nodes(struct acctest_context *ctx);
+int iaa_zdecompress32_multi_task_nodes(struct acctest_context *ctx);
 void iaa_prep_noop(struct task *tsk);
 void iaa_prep_crc64(struct task *tsk);
 void iaa_prep_zcompress16(struct task *tsk);
 void iaa_prep_zdecompress16(struct task *tsk);
 void iaa_prep_zcompress32(struct task *tsk);
+void iaa_prep_zdecompress32(struct task *tsk);
 
 int iaa_task_result_verify(struct task *tsk, int mismatch_expected);
 int iaa_task_result_verify_task_nodes(struct acctest_context *ctx, int mismatch_expected);
@@ -26,5 +28,6 @@ int task_result_verify_crc64(struct task *tsk, int mismatch_expected);
 int task_result_verify_zcompress16(struct task *tsk, int mismatch_expected);
 int task_result_verify_zdecompress16(struct task *tsk, int mismatch_expected);
 int task_result_verify_zcompress32(struct task *tsk, int mismatch_expected);
+int task_result_verify_zdecompress32(struct task *tsk, int mismatch_expected);
 
 #endif
test/iaa_prep.c +11 -0
index 7aff1e2..78668ac 100644
@@ -64,3 +64,14 @@ void iaa_prep_zcompress32(struct task *tsk)
 	tsk->desc->iax_max_dst_size = tsk->iaa_max_dst_size;
 	tsk->comp->status = 0;
 }
+
+void iaa_prep_zdecompress32(struct task *tsk)
+{
+	info("preparing descriptor for zdecompress32\n");
+
+	acctest_prep_desc_common(tsk->desc, tsk->opcode, (uint64_t)(tsk->dst1),
+				 (uint64_t)(tsk->src1), tsk->xfer_size, tsk->dflags);
+	tsk->desc->completion_addr = (uint64_t)(tsk->comp);
+	tsk->desc->iax_max_dst_size = tsk->iaa_max_dst_size;
+	tsk->comp->status = 0;
+}
test/iaa_test.c +11 -0
index 7141979..ba3d412 100644
@@ -194,6 +194,16 @@ static int test_zcompress(struct acctest_context *ctx, size_t buf_size,
 			if (rc != ACCTEST_STATUS_OK)
 				return rc;
 
+			/* Verification of all the nodes*/
+			rc = iaa_task_result_verify_task_nodes(ctx, 0);
+			if (rc != ACCTEST_STATUS_OK)
+				return rc;
+			break;
+		case IAX_OPCODE_ZDECOMPRESS32:
+			rc = iaa_zdecompress32_multi_task_nodes(ctx);
+			if (rc != ACCTEST_STATUS_OK)
+				return rc;
+
 			/* Verification of all the nodes*/
 			rc = iaa_task_result_verify_task_nodes(ctx, 0);
 			if (rc != ACCTEST_STATUS_OK)
@@ -299,6 +309,7 @@ int main(int argc, char *argv[])
 	case IAX_OPCODE_ZCOMPRESS16:
 	case IAX_OPCODE_ZDECOMPRESS16:
 	case IAX_OPCODE_ZCOMPRESS32:
+	case IAX_OPCODE_ZDECOMPRESS32:
 		rc = test_zcompress(iaa, buf_size, tflags, opcode, num_desc);
 		if (rc != ACCTEST_STATUS_OK)
 			goto error;
Signature · 1 line
2.25.1
author
#6 lore raw

PATCH RESEND 6/14 accel-config/test: Modify script for executing Zdecompress32 test

In reply to Li Zhang

Modify test script for passing parameters and executing operation Zdecompress32 test.

Signed-off-by Li Zhang <li4.zhang(a)intel.com>
---
 test/iaa_user_test_runner.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
test/iaa_user_test_runner.sh +2 -2
index af2f8ac..c02b719 100755
@@ -117,13 +117,13 @@ unset SIZE_1
 
 flag="0x1"
 echo "Testing with 'block on fault' flag ON"
-for opcode in "0x4d" "0x49" "0x4c"; do
+for opcode in "0x4d" "0x49" "0x4c" "0x48"; do
 	test_op $opcode $flag
 done
 
 flag="0x0"
 echo "Testing with 'block on fault' flag OFF"
-for opcode in "0x4d" "0x49" "0x4c"; do
+for opcode in "0x4d" "0x49" "0x4c" "0x48"; do
 	test_op $opcode $flag
 done
 
Signature · 1 line
2.25.1
author
#7 lore raw

PATCH RESEND 7/14 accel-config/test: Add function to do Decompress

In reply to Li Zhang

Add new file iaa_compress.c and iaa_compress.h with a function to implement Decompress, it is used to decompress the compressed result from IAA hardware. Add the new files into Makefile for compiler. Add -lz into LDFLAGS for linker.

Signed-off-by Li Zhang <li4.zhang(a)intel.com>
---
 test/Makefile.am               |   5 +-
 test/algorithms/iaa_compress.c |  58 +++++
 test/algorithms/iaa_compress.h | 410 +++++++++++++++++++++++++++++++++
 3 files changed, 472 insertions(+), 1 deletion(-)
 create mode 100644 test/algorithms/iaa_compress.c
 create mode 100644 test/algorithms/iaa_compress.h
test/Makefile.am +4 -1
index e9a7ddd..8fd503e 100644
@@ -32,11 +32,14 @@ testcore =\
 	dsa.h \
 	accfg_test.h
 
+iaa_test_LDFLAGS = -lz
+
 libaccfg_SOURCES = libaccfg.c $(testcore)
 libaccfg_LDADD = $(LIBACCFG_LIB) $(UUID_LIBS)
 
 dsa_test_SOURCES = dsa_test.c dsa.c dsa_prep.c accel_test.c
 dsa_test_LDADD = $(LIBACCFG_LIB) $(UUID_LIBS)
 
-iaa_test_SOURCES = iaa_test.c iaa.c iaa_prep.c accel_test.c algorithms/iaa_crc64.c algorithms/iaa_zcompress.c
+iaa_test_SOURCES = iaa_test.c iaa.c iaa_prep.c accel_test.c \
+		algorithms/iaa_crc64.c algorithms/iaa_zcompress.c algorithms/iaa_compress.c
 iaa_test_LDADD = $(LIBACCFG_LIB) $(UUID_LIBS)
test/algorithms/iaa_compress.c new file +58 -0

58 lines not on this page · raw message

test/algorithms/iaa_compress.h new file +410 -0

410 lines not on this page · raw message

Signature · 1 line
2.25.1
author
#8 lore raw

PATCH RESEND 8/14 accel-config/test: Add macros for IAA Compress register

In reply to Li Zhang

Add macros into idxd.h to describe necessary bits of IAA Operation flag and Compress flag.

Signed-off-by Li Zhang <li4.zhang(a)intel.com>
---
 accfg/idxd.h | 4 ++++
 1 file changed, 4 insertions(+)
accfg/idxd.h +4 -0
index 718fdad..709f219 100644
@@ -51,6 +51,10 @@ enum idxd_scmd_stat {
 
 /* IAX */
 #define IDXD_OP_FLAG_RD_SRC2_AECS	0x010000
+#define IDXD_OP_FLAG_WR_SRC2_CMPL	0x040000
+
+#define IDXD_COMPRESS_FLAG_EOB_BFINAL 0x000c
+#define IDXD_COMPRESS_FLAG_FLUSH_OUTPUT 0x0002
 
 /* Opcode */
 enum dsa_opcode {
Signature · 1 line
2.25.1
author
#9 lore raw

PATCH RESEND 9/14 accel-config/test: Add test code of operation Compress

In reply to Li Zhang

Add test code of operation Compress

Signed-off-by Li Zhang <li4.zhang(a)intel.com>
---
 test/iaa.c      | 136 ++++++++++++++++++++++++++++++++++++++++++++++++
 test/iaa.h      |   4 ++
 test/iaa_prep.c |  14 +++++
 test/iaa_test.c |  65 +++++++++++++++++++++++
 4 files changed, 219 insertions(+)
test/iaa.c +136 -0
index 524446a..0c607ee 100644
@@ -18,6 +18,7 @@
 #include "iaa.h"
 #include "algorithms/iaa_crc64.h"
 #include "algorithms/iaa_zcompress.h"
+#include "algorithms/iaa_compress.h"
 
 static int init_crc64(struct task *tsk, int tflags, int opcode, unsigned long src1_xfer_size)
 {
@@ -153,6 +154,36 @@ static int init_zdecompress32(struct task *tsk, int tflags, int opcode, unsigned
 	return ACCTEST_STATUS_OK;
 }
 
+static int init_compress(struct task *tsk, int tflags, int opcode, unsigned long src1_xfer_size)
+{
+	tsk->pattern = 0x98765432abcdef01;
+	tsk->opcode = opcode;
+	tsk->test_flags = tflags;
+	tsk->xfer_size = src1_xfer_size;
+
+	tsk->src1 = aligned_alloc(32, src1_xfer_size);
+	if (!tsk->src1)
+		return -ENOMEM;
+	memset_pattern(tsk->src1, tsk->pattern, src1_xfer_size);
+
+	tsk->src2 = aligned_alloc(32, IAA_COMPRESS_SRC2_SIZE);
+	if (!tsk->src2)
+		return -ENOMEM;
+	memset_pattern(tsk->src2, 0, IAA_COMPRESS_SRC2_SIZE);
+
+	tsk->dst1 = aligned_alloc(32, IAA_COMPRESS_MAX_DEST_SIZE);
+	if (!tsk->dst1)
+		return -ENOMEM;
+	memset_pattern(tsk->dst1, 0, IAA_COMPRESS_MAX_DEST_SIZE);
+
+	tsk->output = aligned_alloc(32, IAA_COMPRESS_MAX_DEST_SIZE);
+	if (!tsk->output)
+		return -ENOMEM;
+	memset_pattern(tsk->output, 0, IAA_COMPRESS_MAX_DEST_SIZE);
+
+	return ACCTEST_STATUS_OK;
+}
+
 int init_task(struct task *tsk, int tflags, int opcode, unsigned long src1_xfer_size)
 {
 	int rc = 0;
@@ -176,6 +207,9 @@ int init_task(struct task *tsk, int tflags, int opcode, unsigned long src1_xfer_
 	case IAX_OPCODE_ZDECOMPRESS32:
 		rc = init_zdecompress32(tsk, tflags, opcode, src1_xfer_size);
 		break;
+	case IAX_OPCODE_COMPRESS:
+		rc = init_compress(tsk, tflags, opcode, src1_xfer_size);
+		break;
 	}
 
 	if (rc != ACCTEST_STATUS_OK) {
@@ -468,6 +502,62 @@ int iaa_zdecompress32_multi_task_nodes(struct acctest_context *ctx)
 	return ret;
 }
 
+static int iaa_wait_compress(struct acctest_context *ctx, struct task *tsk)
+{
+	struct completion_record *comp = tsk->comp;
+	int rc;
+
+	rc = acctest_wait_on_desc_timeout(comp, ctx, ms_timeout);
+	if (rc < 0) {
+		err("compress desc timeout\n");
+		return ACCTEST_STATUS_TIMEOUT;
+	}
+
+	return ACCTEST_STATUS_OK;
+}
+
+int iaa_compress_multi_task_nodes(struct acctest_context *ctx)
+{
+	struct task_node *tsk_node = ctx->multi_task_node;
+	int ret = ACCTEST_STATUS_OK;
+
+	while (tsk_node) {
+		tsk_node->tsk->dflags |= (IDXD_OP_FLAG_CRAV | IDXD_OP_FLAG_RCR);
+		if ((tsk_node->tsk->test_flags & TEST_FLAGS_BOF) && ctx->bof)
+			tsk_node->tsk->dflags |= IDXD_OP_FLAG_BOF;
+
+		tsk_node->tsk->dflags |= (IDXD_OP_FLAG_WR_SRC2_CMPL | IDXD_OP_FLAG_RD_SRC2_AECS);
+		tsk_node->tsk->iaa_src2_xfer_size = IAA_COMPRESS_AECS_SIZE;
+
+		memcpy(tsk_node->tsk->src2, (void *)iaa_compress_aecs, IAA_COMPRESS_AECS_SIZE);
+
+		tsk_node->tsk->iaa_compr_flags = (IDXD_COMPRESS_FLAG_EOB_BFINAL |
+						  IDXD_COMPRESS_FLAG_FLUSH_OUTPUT);
+		tsk_node->tsk->iaa_max_dst_size = IAA_COMPRESS_MAX_DEST_SIZE;
+
+		iaa_prep_compress(tsk_node->tsk);
+		tsk_node = tsk_node->next;
+	}
+
+	info("Submitted all compress jobs\n");
+	tsk_node = ctx->multi_task_node;
+	while (tsk_node) {
+		acctest_desc_submit(ctx, tsk_node->tsk->desc);
+		tsk_node = tsk_node->next;
+	}
+
+	tsk_node = ctx->multi_task_node;
+	while (tsk_node) {
+		ret = iaa_wait_compress(ctx, tsk_node->tsk);
+		if (ret != ACCTEST_STATUS_OK)
+			info("Desc: %p failed with ret: %d\n",
+			     tsk_node->tsk->desc, tsk_node->tsk->comp->status);
+		tsk_node = tsk_node->next;
+	}
+
+	return ret;
+}
+
 /* mismatch_expected: expect mismatched buffer with success status 0x1 */
 int iaa_task_result_verify(struct task *tsk, int mismatch_expected)
 {
@@ -494,6 +584,9 @@ int iaa_task_result_verify(struct task *tsk, int mismatch_expected)
 	case IAX_OPCODE_ZDECOMPRESS32:
 		ret = task_result_verify_zdecompress32(tsk, mismatch_expected);
 		break;
+	case IAX_OPCODE_COMPRESS:
+		ret = task_result_verify_compress(tsk, mismatch_expected);
+		break;
 	}
 
 	if (ret == ACCTEST_STATUS_OK)
@@ -722,3 +815,46 @@ int task_result_verify_zdecompress32(struct task *tsk, int mismatch_expected)
 
 	return -ENXIO;
 }
+
+int task_result_verify_compress(struct task *tsk, int mismatch_expected)
+{
+	int i = 0;
+	int rc;
+	int expected_len;
+
+	if (mismatch_expected)
+		warn("invalid arg mismatch_expected for %d\n", tsk->opcode);
+
+	rc = iaa_do_decompress(tsk->output, tsk->dst1, tsk->comp->iax_output_size, &expected_len);
+	if (rc)
+		return -ENXIO;
+	rc = memcmp(tsk->src1, tsk->output, expected_len);
+
+	if (!mismatch_expected) {
+		if (expected_len - tsk->xfer_size) {
+			err("Compress mismatch, exp len %d, act len %d\n",
+			    expected_len, tsk->xfer_size);
+
+			return -ENXIO;
+		}
+		if (rc) {
+			err("Compress mismatch, memcmp rc %d\n", rc);
+			for (i = 0; i < (expected_len / 4); i++) {
+				printf("Exp[%d]=0x%04X, Act[%d]=0x%04X\n",
+				       i, ((uint32_t *)tsk->output)[i],
+				       i, ((uint32_t *)tsk->src1)[i]);
+			}
+
+			return -ENXIO;
+		}
+		return ACCTEST_STATUS_OK;
+	}
+
+	/* mismatch_expected */
+	if (rc) {
+		info("expected mismatch\n");
+		return ACCTEST_STATUS_OK;
+	}
+
+	return -ENXIO;
+}
test/iaa.h +4 -0
index 2a14781..1e6010f 100644
@@ -15,12 +15,15 @@ int iaa_zcompress16_multi_task_nodes(struct acctest_context *ctx);
 int iaa_zdecompress16_multi_task_nodes(struct acctest_context *ctx);
 int iaa_zcompress32_multi_task_nodes(struct acctest_context *ctx);
 int iaa_zdecompress32_multi_task_nodes(struct acctest_context *ctx);
+int iaa_compress_multi_task_nodes(struct acctest_context *ctx);
+
 void iaa_prep_noop(struct task *tsk);
 void iaa_prep_crc64(struct task *tsk);
 void iaa_prep_zcompress16(struct task *tsk);
 void iaa_prep_zdecompress16(struct task *tsk);
 void iaa_prep_zcompress32(struct task *tsk);
 void iaa_prep_zdecompress32(struct task *tsk);
+void iaa_prep_compress(struct task *tsk);
 
 int iaa_task_result_verify(struct task *tsk, int mismatch_expected);
 int iaa_task_result_verify_task_nodes(struct acctest_context *ctx, int mismatch_expected);
@@ -29,5 +32,6 @@ int task_result_verify_zcompress16(struct task *tsk, int mismatch_expected);
 int task_result_verify_zdecompress16(struct task *tsk, int mismatch_expected);
 int task_result_verify_zcompress32(struct task *tsk, int mismatch_expected);
 int task_result_verify_zdecompress32(struct task *tsk, int mismatch_expected);
+int task_result_verify_compress(struct task *tsk, int mismatch_expected);
 
 #endif
test/iaa_prep.c +14 -0
index 78668ac..0d454ff 100644
@@ -75,3 +75,17 @@ void iaa_prep_zdecompress32(struct task *tsk)
 	tsk->desc->iax_max_dst_size = tsk->iaa_max_dst_size;
 	tsk->comp->status = 0;
 }
+
+void iaa_prep_compress(struct task *tsk)
+{
+	info("preparing descriptor for compress\n");
+
+	acctest_prep_desc_common(tsk->desc, tsk->opcode, (uint64_t)(tsk->dst1),
+				 (uint64_t)(tsk->src1), tsk->xfer_size, tsk->dflags);
+	tsk->desc->completion_addr = (uint64_t)(tsk->comp);
+	tsk->desc->iax_compr_flags = tsk->iaa_compr_flags;
+	tsk->desc->iax_src2_addr = (uint64_t)(tsk->src2);
+	tsk->desc->iax_src2_xfer_size = tsk->iaa_src2_xfer_size;
+	tsk->desc->iax_max_dst_size = tsk->iaa_max_dst_size;
+	tsk->comp->status = 0;
+}
test/iaa_test.c +65 -0

77 lines not on this page · raw message

Signature · 1 line
2.25.1
author
#10 lore raw

PATCH RESEND 10/14 accel-config/test: Modify script for executing Compress test

In reply to Li Zhang

Modify test script for passing parameters and executing operation Compress test.

Signed-off-by Li Zhang <li4.zhang(a)intel.com>
---
 test/iaa_user_test_runner.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
test/iaa_user_test_runner.sh +2 -2
index c02b719..2180584 100755
@@ -117,13 +117,13 @@ unset SIZE_1
 
 flag="0x1"
 echo "Testing with 'block on fault' flag ON"
-for opcode in "0x4d" "0x49" "0x4c" "0x48"; do
+for opcode in "0x4d" "0x49" "0x4c" "0x48" "0x43"; do
 	test_op $opcode $flag
 done
 
 flag="0x0"
 echo "Testing with 'block on fault' flag OFF"
-for opcode in "0x4d" "0x49" "0x4c" "0x48"; do
+for opcode in "0x4d" "0x49" "0x4c" "0x48" "0x43"; do
 	test_op $opcode $flag
 done
 
Signature · 1 line
2.25.1
author
#11 lore raw

PATCH RESEND 11/14 accel-config/test: Add macros for IAA Decompress register

In reply to Li Zhang

Add macros into idxd.h to describe necessary bits of IAA Decompress flag.

Signed-off-by Li Zhang <li4.zhang(a)intel.com>
---
 accfg/idxd.h | 6 ++++++
 1 file changed, 6 insertions(+)
accfg/idxd.h +6 -0
index 709f219..b460aa3 100644
@@ -56,6 +56,12 @@ enum idxd_scmd_stat {
 #define IDXD_COMPRESS_FLAG_EOB_BFINAL 0x000c
 #define IDXD_COMPRESS_FLAG_FLUSH_OUTPUT 0x0002
 
+#define IDXD_DECOMPRESS_FLAG_SELECT_EOB_BFINAL 0x0010
+#define IDXD_DECOMPRESS_FLAG_CHECK_EOB 0x0008
+#define IDXD_DECOMPRESS_FLAG_STOP_ON_EOB 0x0004
+#define IDXD_DECOMPRESS_FLAG_FLUSH_OUTPUT 0x0002
+#define IDXD_DECOMPRESS_FLAG_EN_DECOMPRESS 0x0001
+
 /* Opcode */
 enum dsa_opcode {
 	DSA_OPCODE_NOOP = 0,
Signature · 1 line
2.25.1
author
#12 lore raw

PATCH RESEND 12/14 accel-config/test: Add element input_size to struct task

In reply to Li Zhang

Add a new element input_size to struct task for Decompress

Signed-off-by Li Zhang <li4.zhang(a)intel.com>
---
 test/accel_test.h | 1 +
 1 file changed, 1 insertion(+)
test/accel_test.h +1 -0
index 55ca043..9ea16ec 100644
@@ -55,6 +55,7 @@ struct task {
 	void *delta1;
 	void *input;
 	void *output;
+	int input_size;
 	uint64_t pattern;
 	uint64_t pattern2;
 	uint64_t xfer_size;
Signature · 1 line
2.25.1
author
#13 lore raw

PATCH RESEND 13/14 accel-config/test: Add test code of operation Decompress

In reply to Li Zhang

Add test code of operation Decompress

Signed-off-by Li Zhang <li4.zhang(a)intel.com>
---
 test/algorithms/iaa_compress.h |   3 +
 test/iaa.c                     | 182 +++++++++++++++++++++++++++++++++
 test/iaa.h                     |   3 +
 test/iaa_prep.c                |  14 +++
 test/iaa_test.c                |  11 ++
 5 files changed, 213 insertions(+)
test/algorithms/iaa_compress.h +3 -0
index 8023ef9..e3cdb6d 100644
@@ -9,6 +9,9 @@
 #define IAA_COMPRESS_AECS_SIZE (1568)
 #define IAA_COMPRESS_SRC2_SIZE (IAA_COMPRESS_AECS_SIZE * 2)
 #define IAA_COMPRESS_MAX_DEST_SIZE (2097152 * 2)
+#define IAA_DECOMPRESS_AECS_SIZE (5376)
+#define IAA_DECOMPRESS_SRC2_SIZE (IAA_DECOMPRESS_AECS_SIZE * 2)
+#define IAA_DECOMPRESS_MAX_DEST_SIZE (2097152 * 2)
 
 static const uint32_t iaa_compress_aecs[IAA_COMPRESS_AECS_SIZE / 4] = {
 0x12345678, // crc
test/iaa.c +182 -0

203 lines not on this page · raw message

test/iaa.h +3 -0
index 1e6010f..8166571 100644
@@ -16,6 +16,7 @@ int iaa_zdecompress16_multi_task_nodes(struct acctest_context *ctx);
 int iaa_zcompress32_multi_task_nodes(struct acctest_context *ctx);
 int iaa_zdecompress32_multi_task_nodes(struct acctest_context *ctx);
 int iaa_compress_multi_task_nodes(struct acctest_context *ctx);
+int iaa_decompress_multi_task_nodes(struct acctest_context *ctx);
 
 void iaa_prep_noop(struct task *tsk);
 void iaa_prep_crc64(struct task *tsk);
@@ -24,6 +25,7 @@ void iaa_prep_zdecompress16(struct task *tsk);
 void iaa_prep_zcompress32(struct task *tsk);
 void iaa_prep_zdecompress32(struct task *tsk);
 void iaa_prep_compress(struct task *tsk);
+void iaa_prep_decompress(struct task *tsk);
 
 int iaa_task_result_verify(struct task *tsk, int mismatch_expected);
 int iaa_task_result_verify_task_nodes(struct acctest_context *ctx, int mismatch_expected);
@@ -33,5 +35,6 @@ int task_result_verify_zdecompress16(struct task *tsk, int mismatch_expected);
 int task_result_verify_zcompress32(struct task *tsk, int mismatch_expected);
 int task_result_verify_zdecompress32(struct task *tsk, int mismatch_expected);
 int task_result_verify_compress(struct task *tsk, int mismatch_expected);
+int task_result_verify_decompress(struct task *tsk, int mismatch_expected);
 
 #endif
test/iaa_prep.c +14 -0
index 0d454ff..948bd23 100644
@@ -89,3 +89,17 @@ void iaa_prep_compress(struct task *tsk)
 	tsk->desc->iax_max_dst_size = tsk->iaa_max_dst_size;
 	tsk->comp->status = 0;
 }
+
+void iaa_prep_decompress(struct task *tsk)
+{
+	info("preparing descriptor for decompress\n");
+
+	acctest_prep_desc_common(tsk->desc, tsk->opcode, (uint64_t)(tsk->dst1),
+				 (uint64_t)(tsk->src1), tsk->xfer_size, tsk->dflags);
+	tsk->desc->completion_addr = (uint64_t)(tsk->comp);
+	tsk->desc->iax_decompr_flags = tsk->iaa_decompr_flags;
+	tsk->desc->iax_src2_addr = (uint64_t)(tsk->src2);
+	tsk->desc->iax_src2_xfer_size = tsk->iaa_src2_xfer_size;
+	tsk->desc->iax_max_dst_size = tsk->iaa_max_dst_size;
+	tsk->comp->status = 0;
+}
test/iaa_test.c +11 -0
index 16bf363..5939a4b 100644
@@ -263,6 +263,16 @@ static int test_compress(struct acctest_context *ctx, size_t buf_size, int tflag
 			if (rc != ACCTEST_STATUS_OK)
 				return rc;
 
+			/* Verification of all the nodes*/
+			rc = iaa_task_result_verify_task_nodes(ctx, 0);
+			if (rc != ACCTEST_STATUS_OK)
+				return rc;
+			break;
+		case IAX_OPCODE_DECOMPRESS:
+			rc = iaa_decompress_multi_task_nodes(ctx);
+			if (rc != ACCTEST_STATUS_OK)
+				return rc;
+
 			/* Verification of all the nodes*/
 			rc = iaa_task_result_verify_task_nodes(ctx, 0);
 			if (rc != ACCTEST_STATUS_OK)
@@ -375,6 +385,7 @@ int main(int argc, char *argv[])
 		break;
 
 	case IAX_OPCODE_COMPRESS:
+	case IAX_OPCODE_DECOMPRESS:
 		rc = test_compress(iaa, buf_size, tflags, extra_flags, opcode, num_desc);
 		if (rc != ACCTEST_STATUS_OK)
 			goto error;
Signature · 1 line
2.25.1
author
#14 lore raw

PATCH RESEND 14/14 accel-config/test: Modify script for executing Decompress test

In reply to Li Zhang

Modify test script for passing parameters and executing operation Decompress test.

Signed-off-by Li Zhang <li4.zhang(a)intel.com>
---
 test/iaa_user_test_runner.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
test/iaa_user_test_runner.sh +2 -2
index 2180584..fc245fc 100755
@@ -117,13 +117,13 @@ unset SIZE_1
 
 flag="0x1"
 echo "Testing with 'block on fault' flag ON"
-for opcode in "0x4d" "0x49" "0x4c" "0x48" "0x43"; do
+for opcode in "0x4d" "0x49" "0x4c" "0x48" "0x43" "0x42"; do
 	test_op $opcode $flag
 done
 
 flag="0x0"
 echo "Testing with 'block on fault' flag OFF"
-for opcode in "0x4d" "0x49" "0x4c" "0x48" "0x43"; do
+for opcode in "0x4d" "0x49" "0x4c" "0x48" "0x43" "0x42"; do
 	test_op $opcode $flag
 done
 
Signature · 1 line
2.25.1