All of lore.kernel.org
 help / color / mirror / Atom feed
* [Accel-config] [PATCH v2 1/7] accel-config/test: add pattern2 to fill destination buffers
@ 2022-02-16 12:26 Tony Zhu
  0 siblings, 0 replies; only message in thread
From: Tony Zhu @ 2022-02-16 12:26 UTC (permalink / raw)
  To: accel-config

[-- Attachment #1: Type: text/plain, Size: 1674 bytes --]

Use pattern to fill source buffers, use pattern2 to fill destination
buffers. This will help to track/debug issue insteading of filling 0.

Signed-off-by: Tony Zhu <tony.zhu(a)intel.com>
---
 test/dsa.c | 7 +++----
 test/dsa.h | 1 +
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/dsa.c b/test/dsa.c
index 29aee41..1608b08 100644
--- a/test/dsa.c
+++ b/test/dsa.c
@@ -287,6 +287,7 @@ int init_task(struct task *tsk, int tflags, int opcode,
 	dbg("initilizing single task %#lx\n", tsk);
 
 	tsk->pattern = 0x0123456789abcdef;
+	tsk->pattern2 = 0xfedcba9876543210;
 	tsk->opcode = opcode;
 	tsk->test_flags = tflags;
 	tsk->xfer_size = xfer_size;
@@ -321,8 +322,7 @@ int init_task(struct task *tsk, int tflags, int opcode,
 		tsk->dst1 = aligned_alloc(1 << 12, xfer_size);
 		if (!tsk->dst1)
 			return -ENOMEM;
-		if (tflags & TEST_FLAGS_PREF)
-			memset(tsk->dst1, 0, xfer_size);
+		memset_pattern(tsk->dst1, tsk->pattern2, xfer_size);
 	}
 
 	/* allocate memory: dst2*/
@@ -332,8 +332,7 @@ int init_task(struct task *tsk, int tflags, int opcode,
 		tsk->dst2 = aligned_alloc(1 << 12, xfer_size);
 		if (!tsk->dst2)
 			return -ENOMEM;
-		if (tflags & TEST_FLAGS_PREF)
-			memset(tsk->dst2, 0, xfer_size);
+		memset_pattern(tsk->dst2, tsk->pattern2, xfer_size);
 	}
 
 	dbg("Mem allocated: s1 %#lx s2 %#lx d1 %#lx d2 %#lx\n",
diff --git a/test/dsa.h b/test/dsa.h
index 382fc66..249e8cd 100644
--- a/test/dsa.h
+++ b/test/dsa.h
@@ -57,6 +57,7 @@ struct task {
 	void *dst1;
 	void *dst2;
 	uint64_t pattern;
+	uint64_t pattern2;
 	uint64_t xfer_size;
 	uint32_t dflags;
 	int test_flags;
-- 
2.27.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-16 12:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16 12:26 [Accel-config] [PATCH v2 1/7] accel-config/test: add pattern2 to fill destination buffers Tony Zhu

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.