test/nvme: replace PAGE_SIZE with OCSSD_SECTOR_SIZE

Same as 29be88f (test/blob: always use SPDK_BS_PAGE_SIZE instead of
PAGE_SIZE), ARM system could not find defination of PAGE_SIZE when
building nvme_ns_ocssd_cmd_ut.c., we use OCSSD_SECTOR_SIZE instead of
Page_SIZE here, also use OCSSD_SECTOR_SIZE instead of "0x1000" for const
uint32_t sector_size.

Change-Id: Ib3062232e44b0be26ade7c64340918f2f23ada03
Signed-off-by: Liang Yan <lyan@suse.com>
Reviewed-on: https://review.gerrithub.io/430802
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Liang Yan 2018-10-25 10:27:29 -04:00 committed by Jim Harris
parent 1589653b5d
commit d1b38b92d2

View File

@ -39,6 +39,8 @@
#include "common/lib/test_env.c"
#define OCSSD_SECTOR_SIZE 0x1000
DEFINE_STUB(spdk_nvme_qpair_process_completions, int32_t,
(struct spdk_nvme_qpair *qpair,
uint32_t max_completions), 0);
@ -178,7 +180,7 @@ static void
test_nvme_ocssd_ns_cmd_vector_reset_single_entry(void)
{
const uint32_t max_xfer_size = 0x10000;
const uint32_t sector_size = 0x1000;
const uint32_t sector_size = OCSSD_SECTOR_SIZE;
struct spdk_nvme_ns ns;
struct spdk_nvme_ctrlr ctrlr;
@ -208,7 +210,7 @@ static void
test_nvme_ocssd_ns_cmd_vector_reset(void)
{
const uint32_t max_xfer_size = 0x10000;
const uint32_t sector_size = 0x1000;
const uint32_t sector_size = OCSSD_SECTOR_SIZE;
const uint32_t vector_size = 0x10;
struct spdk_nvme_ns ns;
@ -238,7 +240,7 @@ static void
test_nvme_ocssd_ns_cmd_vector_read_with_md_single_entry(void)
{
const uint32_t max_xfer_size = 0x10000;
const uint32_t sector_size = 0x1000;
const uint32_t sector_size = OCSSD_SECTOR_SIZE;
const uint32_t md_size = 0x80;
struct spdk_nvme_ns ns;
@ -263,7 +265,7 @@ test_nvme_ocssd_ns_cmd_vector_read_with_md_single_entry(void)
SPDK_CU_ASSERT_FATAL(g_request->num_children == 0);
CU_ASSERT(g_request->payload.md == metadata);
CU_ASSERT(g_request->payload_size == PAGE_SIZE);
CU_ASSERT(g_request->payload_size == OCSSD_SECTOR_SIZE);
CU_ASSERT(g_request->payload.contig_or_cb_arg == buffer);
CU_ASSERT(g_request->cmd.opc == SPDK_OCSSD_OPC_VECTOR_READ);
CU_ASSERT(g_request->cmd.nsid == ns.id);
@ -281,7 +283,7 @@ static void
test_nvme_ocssd_ns_cmd_vector_read_with_md(void)
{
const uint32_t max_xfer_size = 0x10000;
const uint32_t sector_size = 0x1000;
const uint32_t sector_size = OCSSD_SECTOR_SIZE;
const uint32_t md_size = 0x80;
const uint32_t vector_size = 0x10;
@ -325,7 +327,7 @@ static void
test_nvme_ocssd_ns_cmd_vector_read_single_entry(void)
{
const uint32_t max_xfer_size = 0x10000;
const uint32_t sector_size = 0x1000;
const uint32_t sector_size = OCSSD_SECTOR_SIZE;
struct spdk_nvme_ns ns;
struct spdk_nvme_ctrlr ctrlr;
@ -346,7 +348,7 @@ test_nvme_ocssd_ns_cmd_vector_read_single_entry(void)
SPDK_CU_ASSERT_FATAL(g_request != NULL);
SPDK_CU_ASSERT_FATAL(g_request->num_children == 0);
CU_ASSERT(g_request->payload_size == PAGE_SIZE);
CU_ASSERT(g_request->payload_size == OCSSD_SECTOR_SIZE);
CU_ASSERT(g_request->payload.contig_or_cb_arg == buffer);
CU_ASSERT(g_request->cmd.opc == SPDK_OCSSD_OPC_VECTOR_READ);
CU_ASSERT(g_request->cmd.nsid == ns.id);
@ -362,7 +364,7 @@ static void
test_nvme_ocssd_ns_cmd_vector_read(void)
{
const uint32_t max_xfer_size = 0x10000;
const uint32_t sector_size = 0x1000;
const uint32_t sector_size = OCSSD_SECTOR_SIZE;
const uint32_t vector_size = 0x10;
struct spdk_nvme_ns ns;
@ -399,7 +401,7 @@ static void
test_nvme_ocssd_ns_cmd_vector_write_with_md_single_entry(void)
{
const uint32_t max_xfer_size = 0x10000;
const uint32_t sector_size = 0x1000;
const uint32_t sector_size = OCSSD_SECTOR_SIZE;
const uint32_t md_size = 0x80;
struct spdk_nvme_ns ns;
@ -424,7 +426,7 @@ test_nvme_ocssd_ns_cmd_vector_write_with_md_single_entry(void)
SPDK_CU_ASSERT_FATAL(g_request->num_children == 0);
CU_ASSERT(g_request->payload.md == metadata);
CU_ASSERT(g_request->payload_size == PAGE_SIZE);
CU_ASSERT(g_request->payload_size == OCSSD_SECTOR_SIZE);
CU_ASSERT(g_request->payload.contig_or_cb_arg == buffer);
CU_ASSERT(g_request->cmd.opc == SPDK_OCSSD_OPC_VECTOR_WRITE);
CU_ASSERT(g_request->cmd.nsid == ns.id);
@ -443,7 +445,7 @@ static void
test_nvme_ocssd_ns_cmd_vector_write_with_md(void)
{
const uint32_t max_xfer_size = 0x10000;
const uint32_t sector_size = 0x1000;
const uint32_t sector_size = OCSSD_SECTOR_SIZE;
const uint32_t md_size = 0x80;
const uint32_t vector_size = 0x10;
@ -487,7 +489,7 @@ static void
test_nvme_ocssd_ns_cmd_vector_write_single_entry(void)
{
const uint32_t max_xfer_size = 0x10000;
const uint32_t sector_size = 0x1000;
const uint32_t sector_size = OCSSD_SECTOR_SIZE;
struct spdk_nvme_ns ns;
struct spdk_nvme_ctrlr ctrlr;
@ -508,7 +510,7 @@ test_nvme_ocssd_ns_cmd_vector_write_single_entry(void)
SPDK_CU_ASSERT_FATAL(g_request != NULL);
SPDK_CU_ASSERT_FATAL(g_request->num_children == 0);
CU_ASSERT(g_request->payload_size == PAGE_SIZE);
CU_ASSERT(g_request->payload_size == OCSSD_SECTOR_SIZE);
CU_ASSERT(g_request->payload.contig_or_cb_arg == buffer);
CU_ASSERT(g_request->cmd.opc == SPDK_OCSSD_OPC_VECTOR_WRITE);
CU_ASSERT(g_request->cmd.nsid == ns.id);
@ -525,7 +527,7 @@ static void
test_nvme_ocssd_ns_cmd_vector_write(void)
{
const uint32_t max_xfer_size = 0x10000;
const uint32_t sector_size = 0x1000;
const uint32_t sector_size = OCSSD_SECTOR_SIZE;
const uint32_t vector_size = 0x10;
struct spdk_nvme_ns ns;
@ -564,7 +566,7 @@ static void
test_nvme_ocssd_ns_cmd_vector_copy_single_entry(void)
{
const uint32_t max_xfer_size = 0x10000;
const uint32_t sector_size = 0x1000;
const uint32_t sector_size = OCSSD_SECTOR_SIZE;
struct spdk_nvme_ns ns;
struct spdk_nvme_ctrlr ctrlr;
@ -596,7 +598,7 @@ static void
test_nvme_ocssd_ns_cmd_vector_copy(void)
{
const uint32_t max_xfer_size = 0x10000;
const uint32_t sector_size = 0x1000;
const uint32_t sector_size = OCSSD_SECTOR_SIZE;
const uint32_t vector_size = 0x10;
struct spdk_nvme_ns ns;