nvme: Rename 'delay_pcie_doorbell' to 'delay_cmd_submit'

'delay_pcie_doorbel' parameter in 'spdk_nvme_io_qpair_opts' structure
was renamed to 'delay_cmd_submit' to make it suitable for every
transport. Old name is also kept for backward compatibility.

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I09ef8028133c4a3d4a5bbc5329ced1f065bcaa46
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475305
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
This commit is contained in:
Evgeniy Kochetov 2019-10-09 06:40:31 +00:00 committed by Tomasz Zawadzki
parent 5170ac8d83
commit ffc7c4a9a9
7 changed files with 41 additions and 28 deletions

View File

@ -25,6 +25,11 @@ Added `blobfs_set_cache_size` RPC method to set cache size for blobstore filesys
`spdk_pipe`, a new utility for buffering data from sockets or files for parsing
has been added. The public API is available at `include/spdk/pipe.h`.
### nvme
`delayed_pcie_doorbell` parameter in `spdk_nvme_io_qpair_opts` was renamed to `delay_cmd_submit`
to allow reuse in other transports.
## v19.10:
### rpc

View File

@ -1,8 +1,8 @@
/*-
* BSD LICENSE
*
* Copyright (c) Intel Corporation.
* All rights reserved.
* Copyright (c) Intel Corporation. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -313,7 +313,7 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
}
spdk_nvme_ctrlr_get_default_io_qpair_opts(fio_ctrlr->ctrlr, &qpopts, sizeof(qpopts));
qpopts.delay_pcie_doorbell = true;
qpopts.delay_cmd_submit = true;
fio_qpair->qpair = spdk_nvme_ctrlr_alloc_io_qpair(fio_ctrlr->ctrlr, &qpopts, sizeof(qpopts));
if (!fio_qpair->qpair) {

View File

@ -597,7 +597,7 @@ nvme_init_ns_worker_ctx(struct ns_worker_ctx *ns_ctx)
if (opts.io_queue_requests < entry->num_io_requests) {
opts.io_queue_requests = entry->num_io_requests;
}
opts.delay_pcie_doorbell = true;
opts.delay_cmd_submit = true;
for (i = 0; i < ns_ctx->u.nvme.num_qpairs; i++) {
ns_ctx->u.nvme.qpair[i] = spdk_nvme_ctrlr_alloc_io_qpair(entry->u.nvme.ctrlr, &opts,

View File

@ -1,8 +1,8 @@
/*-
* BSD LICENSE
*
* Copyright (c) Intel Corporation.
* All rights reserved.
* Copyright (c) Intel Corporation. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -1032,14 +1032,22 @@ struct spdk_nvme_io_qpair_opts {
/**
* When submitting I/O via spdk_nvme_ns_read/write and similar functions,
* don't immediately write the submission queue doorbell. Instead, write
* to the doorbell as necessary inside spdk_nvme_qpair_process_completions().
* don't immediately submit it to hardware. Instead, queue up new commands
* and submit them to the hardware inside spdk_nvme_qpair_process_completions().
*
* This results in better batching of I/O submission and consequently fewer
* MMIO writes to the doorbell, which may increase performance.
* This results in better batching of I/O commands. Often, it is more efficient
* to submit batches of commands to the underlying hardware than each command
* individually.
*
* This only applies to local PCIe devices. */
bool delay_pcie_doorbell;
* This only applies to PCIe and RDMA transports.
*
* The flag was originally named delay_pcie_doorbell. To allow backward compatibility
* both names are kept in unnamed union.
*/
union {
bool delay_cmd_submit;
bool delay_pcie_doorbell;
};
/**
* These fields allow specifying the memory buffers for the submission and/or

View File

@ -1,8 +1,8 @@
/*-
* BSD LICENSE
*
* Copyright (c) Intel Corporation.
* All rights reserved.
* Copyright (c) Intel Corporation. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -253,8 +253,8 @@ spdk_nvme_ctrlr_get_default_io_qpair_opts(struct spdk_nvme_ctrlr *ctrlr,
opts->io_queue_requests = ctrlr->opts.io_queue_requests;
}
if (FIELD_OK(delay_pcie_doorbell)) {
opts->delay_pcie_doorbell = false;
if (FIELD_OK(delay_cmd_submit)) {
opts->delay_cmd_submit = false;
}
if (FIELD_OK(sq.vaddr)) {

View File

@ -1,9 +1,9 @@
/*-
* BSD LICENSE
*
* Copyright (c) Intel Corporation.
* Copyright (c) 2017, IBM Corporation.
* All rights reserved.
* Copyright (c) Intel Corporation. All rights reserved.
* Copyright (c) 2017, IBM Corporation. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -165,7 +165,7 @@ struct nvme_pcie_qpair {
struct {
uint8_t phase : 1;
uint8_t delay_pcie_doorbell : 1;
uint8_t delay_cmd_submit : 1;
uint8_t has_shadow_doorbell : 1;
} flags;
@ -702,7 +702,7 @@ nvme_pcie_ctrlr_construct_admin_qpair(struct spdk_nvme_ctrlr *ctrlr)
}
pqpair->num_entries = NVME_ADMIN_ENTRIES;
pqpair->flags.delay_pcie_doorbell = 0;
pqpair->flags.delay_cmd_submit = 0;
ctrlr->adminq = &pqpair->qpair;
@ -1300,7 +1300,7 @@ nvme_pcie_qpair_submit_tracker(struct spdk_nvme_qpair *qpair, struct nvme_tracke
SPDK_ERRLOG("sq_tail is passing sq_head!\n");
}
if (!pqpair->flags.delay_pcie_doorbell) {
if (!pqpair->flags.delay_cmd_submit) {
nvme_pcie_qpair_ring_sq_doorbell(qpair);
}
}
@ -1613,7 +1613,7 @@ nvme_pcie_ctrlr_create_io_qpair(struct spdk_nvme_ctrlr *ctrlr, uint16_t qid,
}
pqpair->num_entries = opts->io_queue_size;
pqpair->flags.delay_pcie_doorbell = opts->delay_pcie_doorbell;
pqpair->flags.delay_cmd_submit = opts->delay_cmd_submit;
qpair = &pqpair->qpair;
@ -2143,7 +2143,7 @@ nvme_pcie_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_
nvme_pcie_qpair_ring_cq_doorbell(qpair);
}
if (pqpair->flags.delay_pcie_doorbell) {
if (pqpair->flags.delay_cmd_submit) {
if (pqpair->last_sq_tail != pqpair->sq_tail) {
nvme_pcie_qpair_ring_sq_doorbell(qpair);
pqpair->last_sq_tail = pqpair->sq_tail;

View File

@ -1,8 +1,8 @@
/*-
* BSD LICENSE
*
* Copyright (c) Intel Corporation.
* All rights reserved.
* Copyright (c) Intel Corporation. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -326,7 +326,7 @@ _bdev_nvme_reset_create_qpair(struct spdk_io_channel_iter *i)
struct spdk_nvme_io_qpair_opts opts;
spdk_nvme_ctrlr_get_default_io_qpair_opts(nvme_bdev_ctrlr->ctrlr, &opts, sizeof(opts));
opts.delay_pcie_doorbell = true;
opts.delay_cmd_submit = true;
nvme_ch->qpair = spdk_nvme_ctrlr_alloc_io_qpair(nvme_bdev_ctrlr->ctrlr, &opts, sizeof(opts));
if (!nvme_ch->qpair) {
@ -608,7 +608,7 @@ bdev_nvme_create_cb(void *io_device, void *ctx_buf)
#endif
spdk_nvme_ctrlr_get_default_io_qpair_opts(nvme_bdev_ctrlr->ctrlr, &opts, sizeof(opts));
opts.delay_pcie_doorbell = true;
opts.delay_cmd_submit = true;
opts.io_queue_requests = spdk_max(g_opts.io_queue_requests, opts.io_queue_requests);
g_opts.io_queue_requests = opts.io_queue_requests;