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 (master)
Reviewed-on: https://review.gerrithub.io/437054
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
36a9358315
commit
8c3856bb6b
@ -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);
|
||||
@ -176,7 +178,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;
|
||||
@ -206,7 +208,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;
|
||||
@ -236,7 +238,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;
|
||||
@ -261,7 +263,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);
|
||||
@ -279,7 +281,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;
|
||||
|
||||
@ -323,7 +325,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;
|
||||
@ -344,7 +346,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);
|
||||
@ -360,7 +362,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;
|
||||
@ -397,7 +399,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;
|
||||
@ -422,7 +424,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);
|
||||
@ -441,7 +443,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;
|
||||
|
||||
@ -485,7 +487,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;
|
||||
@ -506,7 +508,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);
|
||||
@ -523,7 +525,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;
|
||||
@ -562,7 +564,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;
|
||||
@ -594,7 +596,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;
|
||||
|
Loading…
Reference in New Issue
Block a user