nvmf: change the function signature of spdk_nvmf_tgt_create
This is necessary to allow the spdk_nvmf_tgt structure to evolve over time without having to further change the target API. Change-Id: Ib0f0f9b1f190913feff0229c96df4e84b1bf35f7 Signed-off-by: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465363 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
parent
0ac5050624
commit
7d6d95db3c
@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
## v19.10: (Upcoming Release)
|
## v19.10: (Upcoming Release)
|
||||||
|
|
||||||
|
### nvmf
|
||||||
|
|
||||||
|
The `spdk_nvmf_tgt_create` function now accepts an object of type `spdk_nvmf_target_opts`
|
||||||
|
as its only parameter. This new structure contains the max_subsystems parameter previously
|
||||||
|
passed into that function.
|
||||||
|
|
||||||
### nvme
|
### nvme
|
||||||
|
|
||||||
Added `no_shn_notification` to NVMe controller initialization options, users can enable
|
Added `no_shn_notification` to NVMe controller initialization options, users can enable
|
||||||
|
@ -114,11 +114,11 @@ struct spdk_nvmf_transport_poll_group_stat {
|
|||||||
/**
|
/**
|
||||||
* Construct an NVMe-oF target.
|
* Construct an NVMe-oF target.
|
||||||
*
|
*
|
||||||
* \param max_subsystems the maximum number of subsystems allowed by the target.
|
* \param opts a pointer to an spdk_nvmf_target_opts structure.
|
||||||
*
|
*
|
||||||
* \return a pointer to a NVMe-oF target on success, or NULL on failure.
|
* \return a pointer to a NVMe-oF target on success, or NULL on failure.
|
||||||
*/
|
*/
|
||||||
struct spdk_nvmf_tgt *spdk_nvmf_tgt_create(uint32_t max_subsystems);
|
struct spdk_nvmf_tgt *spdk_nvmf_tgt_create(struct spdk_nvmf_target_opts *opts);
|
||||||
|
|
||||||
typedef void (spdk_nvmf_tgt_destroy_done_fn)(void *ctx, int status);
|
typedef void (spdk_nvmf_tgt_destroy_done_fn)(void *ctx, int status);
|
||||||
|
|
||||||
|
@ -186,6 +186,7 @@ spdk_nvmf_parse_nvmf_tgt(void)
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
int using_deprecated_options;
|
int using_deprecated_options;
|
||||||
|
struct spdk_nvmf_target_opts opts = { 0 };
|
||||||
|
|
||||||
if (!g_spdk_nvmf_tgt_max_subsystems) {
|
if (!g_spdk_nvmf_tgt_max_subsystems) {
|
||||||
using_deprecated_options = spdk_nvmf_parse_tgt_max_subsystems();
|
using_deprecated_options = spdk_nvmf_parse_tgt_max_subsystems();
|
||||||
@ -207,7 +208,8 @@ spdk_nvmf_parse_nvmf_tgt(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_spdk_nvmf_tgt = spdk_nvmf_tgt_create(g_spdk_nvmf_tgt_max_subsystems);
|
opts.max_subsystems = g_spdk_nvmf_tgt_max_subsystems;
|
||||||
|
g_spdk_nvmf_tgt = spdk_nvmf_tgt_create(&opts);
|
||||||
|
|
||||||
g_spdk_nvmf_tgt_max_subsystems = 0;
|
g_spdk_nvmf_tgt_max_subsystems = 0;
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ spdk_nvmf_tgt_destroy_poll_group_qpairs(struct spdk_nvmf_poll_group *group)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct spdk_nvmf_tgt *
|
struct spdk_nvmf_tgt *
|
||||||
spdk_nvmf_tgt_create(uint32_t max_subsystems)
|
spdk_nvmf_tgt_create(struct spdk_nvmf_target_opts *opts)
|
||||||
{
|
{
|
||||||
struct spdk_nvmf_tgt *tgt;
|
struct spdk_nvmf_tgt *tgt;
|
||||||
|
|
||||||
@ -228,10 +228,10 @@ spdk_nvmf_tgt_create(uint32_t max_subsystems)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!max_subsystems) {
|
if (!opts || !opts->max_subsystems) {
|
||||||
tgt->max_subsystems = SPDK_NVMF_DEFAULT_MAX_SUBSYSTEMS;
|
tgt->max_subsystems = SPDK_NVMF_DEFAULT_MAX_SUBSYSTEMS;
|
||||||
} else {
|
} else {
|
||||||
tgt->max_subsystems = max_subsystems;
|
tgt->max_subsystems = opts->max_subsystems;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgt->discovery_genctr = 0;
|
tgt->discovery_genctr = 0;
|
||||||
|
@ -264,12 +264,13 @@ static void
|
|||||||
create_transport_test(void)
|
create_transport_test(void)
|
||||||
{
|
{
|
||||||
const struct spdk_nvmf_transport_ops *ops = NULL;
|
const struct spdk_nvmf_transport_ops *ops = NULL;
|
||||||
|
struct spdk_nvmf_target_opts tgt_opts = { 0 };
|
||||||
struct spdk_nvmf_transport_opts opts = { 0 };
|
struct spdk_nvmf_transport_opts opts = { 0 };
|
||||||
|
|
||||||
allocate_threads(8);
|
allocate_threads(8);
|
||||||
set_thread(0);
|
set_thread(0);
|
||||||
|
|
||||||
g_nvmf_tgt = spdk_nvmf_tgt_create(2);
|
g_nvmf_tgt = spdk_nvmf_tgt_create(&tgt_opts);
|
||||||
SPDK_CU_ASSERT_FATAL(g_nvmf_tgt != NULL);
|
SPDK_CU_ASSERT_FATAL(g_nvmf_tgt != NULL);
|
||||||
|
|
||||||
ops = spdk_nvmf_get_transport_ops((enum spdk_nvme_transport_type) SPDK_NVMF_TRTYPE_FC);
|
ops = spdk_nvmf_get_transport_ops((enum spdk_nvme_transport_type) SPDK_NVMF_TRTYPE_FC);
|
||||||
|
Loading…
Reference in New Issue
Block a user