4 * Copyright (c) Intel Corporation.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 #include "spdk/nvmf.h"
40 #include "spdk/queue.h"
41 #include "spdk/event.h"
43 struct rpc_listen_address
{
49 struct spdk_nvmf_tgt_conf
{
50 uint32_t acceptor_lcore
;
51 uint32_t acceptor_poll_rate
;
54 struct nvmf_tgt_subsystem
{
55 struct spdk_nvmf_subsystem
*subsystem
;
56 struct spdk_poller
*poller
;
58 TAILQ_ENTRY(nvmf_tgt_subsystem
) tailq
;
63 extern struct spdk_nvmf_tgt_conf g_spdk_nvmf_tgt_conf
;
65 struct nvmf_tgt_subsystem
*
66 nvmf_tgt_subsystem_first(void);
68 struct nvmf_tgt_subsystem
*
69 nvmf_tgt_subsystem_next(struct nvmf_tgt_subsystem
*subsystem
);
71 int spdk_nvmf_parse_conf(void);
73 void nvmf_tgt_start_subsystem(struct nvmf_tgt_subsystem
*subsystem
);
75 struct nvmf_tgt_subsystem
*nvmf_tgt_create_subsystem(const char *name
,
76 enum spdk_nvmf_subtype subtype
,
77 enum spdk_nvmf_subsystem_mode mode
,
81 spdk_nvmf_construct_subsystem(const char *name
,
82 const char *mode
, int32_t lcore
,
83 int num_listen_addresses
, struct rpc_listen_address
*addresses
,
84 int num_hosts
, char *hosts
[], const char *bdf
,
85 const char *sn
, int num_devs
, char *dev_list
[]);
88 nvmf_tgt_shutdown_subsystem_by_nqn(const char *nqn
);
90 int spdk_nvmf_tgt_start(struct spdk_app_opts
*opts
);