ocssd: add chunk info list as mptr of vector reset
This is verified on QEMU NVMe which merged the related patch. Change-Id: I7c62d7a91350e0a877d1c3651796c38b55122f98 Signed-off-by: Young Tack Jin <youngtack.jin@circuitblvd.com> Reviewed-on: https://review.gerrithub.io/417077 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Matias Bjørling <m@bjorling.me> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
09e3f4e3db
commit
6d05186697
@ -82,6 +82,7 @@ int spdk_nvme_ocssd_ctrlr_cmd_geometry(struct spdk_nvme_ctrlr *ctrlr, uint32_t n
|
||||
* LBAs must correspond to the start of chunks to reset.
|
||||
* Must be allocated through spdk_dma_malloc() or its variants
|
||||
* \param num_lbas number of LBAs stored in lba_list
|
||||
* \param chunk_info an array of chunk info on DMA-able memory
|
||||
* \param cb_fn callback function to invoke when the I/O is completed
|
||||
* \param cb_arg argument to pass to the callback function
|
||||
*
|
||||
@ -91,6 +92,7 @@ int spdk_nvme_ocssd_ctrlr_cmd_geometry(struct spdk_nvme_ctrlr *ctrlr, uint32_t n
|
||||
int spdk_nvme_ocssd_ns_cmd_vector_reset(struct spdk_nvme_ns *ns,
|
||||
struct spdk_nvme_qpair *qpair,
|
||||
uint64_t *lba_list, uint32_t num_lbas,
|
||||
struct spdk_ocssd_chunk_information *chunk_info,
|
||||
spdk_nvme_cmd_cb cb_fn, void *cb_arg);
|
||||
|
||||
/**
|
||||
|
@ -38,6 +38,7 @@ int
|
||||
spdk_nvme_ocssd_ns_cmd_vector_reset(struct spdk_nvme_ns *ns,
|
||||
struct spdk_nvme_qpair *qpair,
|
||||
uint64_t *lba_list, uint32_t num_lbas,
|
||||
struct spdk_ocssd_chunk_information *chunk_info,
|
||||
spdk_nvme_cmd_cb cb_fn, void *cb_arg)
|
||||
{
|
||||
struct nvme_request *req;
|
||||
@ -57,6 +58,10 @@ spdk_nvme_ocssd_ns_cmd_vector_reset(struct spdk_nvme_ns *ns,
|
||||
cmd->opc = SPDK_OCSSD_OPC_VECTOR_RESET;
|
||||
cmd->nsid = ns->id;
|
||||
|
||||
if (chunk_info != NULL) {
|
||||
cmd->mptr = spdk_vtophys(chunk_info);
|
||||
}
|
||||
|
||||
/*
|
||||
* Dword 10 and 11 store a pointer to the list of logical block addresses.
|
||||
* If there is a single entry in the LBA list, the logical block
|
||||
|
@ -187,7 +187,7 @@ test_nvme_ocssd_ns_cmd_vector_reset_single_entry(void)
|
||||
prepare_for_test(&ns, &ctrlr, &qpair, sector_size, 0, max_xfer_size, 0, false);
|
||||
uint64_t lba_list = 0x12345678;
|
||||
spdk_nvme_ocssd_ns_cmd_vector_reset(&ns, &qpair, &lba_list, 1,
|
||||
NULL, NULL);
|
||||
NULL, NULL, NULL);
|
||||
|
||||
SPDK_CU_ASSERT_FATAL(rc == 0);
|
||||
SPDK_CU_ASSERT_FATAL(g_request != NULL);
|
||||
@ -218,7 +218,7 @@ test_nvme_ocssd_ns_cmd_vector_reset(void)
|
||||
prepare_for_test(&ns, &ctrlr, &qpair, sector_size, 0, max_xfer_size, 0, false);
|
||||
uint64_t lba_list[vector_size];
|
||||
spdk_nvme_ocssd_ns_cmd_vector_reset(&ns, &qpair, lba_list, vector_size,
|
||||
NULL, NULL);
|
||||
NULL, NULL, NULL);
|
||||
|
||||
SPDK_CU_ASSERT_FATAL(rc == 0);
|
||||
SPDK_CU_ASSERT_FATAL(g_request != NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user