]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/app/nvmf_tgt/nvmf_tgt.h
bump version to 12.2.12-pve1
[ceph.git] / ceph / src / spdk / app / nvmf_tgt / nvmf_tgt.h
1 /*-
2 * BSD LICENSE
3 *
4 * Copyright (c) Intel Corporation.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
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
16 * distribution.
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.
20 *
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.
32 */
33
34 #ifndef NVMF_TGT_H
35 #define NVMF_TGT_H
36
37 #include <stdint.h>
38
39 #include "spdk/nvmf.h"
40 #include "spdk/queue.h"
41 #include "spdk/event.h"
42
43 struct rpc_listen_address {
44 char *transport;
45 char *traddr;
46 char *trsvcid;
47 };
48
49 struct spdk_nvmf_tgt_conf {
50 uint32_t acceptor_lcore;
51 uint32_t acceptor_poll_rate;
52 };
53
54 struct nvmf_tgt_subsystem {
55 struct spdk_nvmf_subsystem *subsystem;
56 struct spdk_poller *poller;
57
58 TAILQ_ENTRY(nvmf_tgt_subsystem) tailq;
59
60 uint32_t lcore;
61 };
62
63 extern struct spdk_nvmf_tgt_conf g_spdk_nvmf_tgt_conf;
64
65 struct nvmf_tgt_subsystem *
66 nvmf_tgt_subsystem_first(void);
67
68 struct nvmf_tgt_subsystem *
69 nvmf_tgt_subsystem_next(struct nvmf_tgt_subsystem *subsystem);
70
71 int spdk_nvmf_parse_conf(void);
72
73 void nvmf_tgt_start_subsystem(struct nvmf_tgt_subsystem *subsystem);
74
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,
78 uint32_t lcore);
79
80 int
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[]);
86
87 int
88 nvmf_tgt_shutdown_subsystem_by_nqn(const char *nqn);
89
90 int spdk_nvmf_tgt_start(struct spdk_app_opts *opts);
91
92 #endif