ioat/verify: cleanup 8-byte alignment code
Change-Id: I5ec70e895541ff63c369b85243fff9eeec9112d2 Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/416657 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
b3d12ada2b
commit
d4b876045b
@ -37,6 +37,7 @@
|
|||||||
#include "spdk/env.h"
|
#include "spdk/env.h"
|
||||||
#include "spdk/queue.h"
|
#include "spdk/queue.h"
|
||||||
#include "spdk/string.h"
|
#include "spdk/string.h"
|
||||||
|
#include "spdk/util.h"
|
||||||
|
|
||||||
#define SRC_BUFFER_SIZE (512*1024)
|
#define SRC_BUFFER_SIZE (512*1024)
|
||||||
|
|
||||||
@ -127,7 +128,6 @@ static void prepare_ioat_task(struct thread_entry *thread_entry, struct ioat_tas
|
|||||||
int len;
|
int len;
|
||||||
uintptr_t src_offset;
|
uintptr_t src_offset;
|
||||||
uintptr_t dst_offset;
|
uintptr_t dst_offset;
|
||||||
int num_ddwords;
|
|
||||||
uint64_t fill_pattern;
|
uint64_t fill_pattern;
|
||||||
|
|
||||||
if (ioat_task->type == IOAT_FILL_TYPE) {
|
if (ioat_task->type == IOAT_FILL_TYPE) {
|
||||||
@ -135,11 +135,7 @@ static void prepare_ioat_task(struct thread_entry *thread_entry, struct ioat_tas
|
|||||||
fill_pattern = fill_pattern << 32 | rand_r(&seed);
|
fill_pattern = fill_pattern << 32 | rand_r(&seed);
|
||||||
|
|
||||||
/* ensure that the length of memset block is 8 Bytes aligned */
|
/* ensure that the length of memset block is 8 Bytes aligned */
|
||||||
num_ddwords = (rand_r(&seed) % SRC_BUFFER_SIZE) / 8;
|
len = 8 + ((rand_r(&seed) % (SRC_BUFFER_SIZE - 8)) & ~0x7);
|
||||||
len = num_ddwords * 8;
|
|
||||||
if (len < 8) {
|
|
||||||
len = 8;
|
|
||||||
}
|
|
||||||
dst_offset = rand_r(&seed) % (SRC_BUFFER_SIZE - len);
|
dst_offset = rand_r(&seed) % (SRC_BUFFER_SIZE - len);
|
||||||
ioat_task->fill_pattern = fill_pattern;
|
ioat_task->fill_pattern = fill_pattern;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user