.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
---|
1 | 2 | /* |
---|
2 | 3 | * NVMe over Fabrics common host code. |
---|
3 | 4 | * Copyright (c) 2015-2016 HGST, a Western Digital Company. |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify it |
---|
6 | | - * under the terms and conditions of the GNU General Public License, |
---|
7 | | - * version 2, as published by the Free Software Foundation. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
---|
10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
12 | | - * more details. |
---|
13 | 5 | */ |
---|
14 | 6 | #ifndef _NVME_FABRICS_H |
---|
15 | 7 | #define _NVME_FABRICS_H 1 |
---|
.. | .. |
---|
58 | 50 | NVMF_OPT_CTRL_LOSS_TMO = 1 << 11, |
---|
59 | 51 | NVMF_OPT_HOST_ID = 1 << 12, |
---|
60 | 52 | NVMF_OPT_DUP_CONNECT = 1 << 13, |
---|
| 53 | + NVMF_OPT_DISABLE_SQFLOW = 1 << 14, |
---|
| 54 | + NVMF_OPT_HDR_DIGEST = 1 << 15, |
---|
| 55 | + NVMF_OPT_DATA_DIGEST = 1 << 16, |
---|
| 56 | + NVMF_OPT_NR_WRITE_QUEUES = 1 << 17, |
---|
| 57 | + NVMF_OPT_NR_POLL_QUEUES = 1 << 18, |
---|
| 58 | + NVMF_OPT_TOS = 1 << 19, |
---|
61 | 59 | }; |
---|
62 | 60 | |
---|
63 | 61 | /** |
---|
.. | .. |
---|
85 | 83 | * @max_reconnects: maximum number of allowed reconnect attempts before removing |
---|
86 | 84 | * the controller, (-1) means reconnect forever, zero means remove |
---|
87 | 85 | * immediately; |
---|
| 86 | + * @disable_sqflow: disable controller sq flow control |
---|
| 87 | + * @hdr_digest: generate/verify header digest (TCP) |
---|
| 88 | + * @data_digest: generate/verify data digest (TCP) |
---|
| 89 | + * @nr_write_queues: number of queues for write I/O |
---|
| 90 | + * @nr_poll_queues: number of queues for polling I/O |
---|
| 91 | + * @tos: type of service |
---|
88 | 92 | */ |
---|
89 | 93 | struct nvmf_ctrl_options { |
---|
90 | 94 | unsigned mask; |
---|
.. | .. |
---|
101 | 105 | unsigned int kato; |
---|
102 | 106 | struct nvmf_host *host; |
---|
103 | 107 | int max_reconnects; |
---|
| 108 | + bool disable_sqflow; |
---|
| 109 | + bool hdr_digest; |
---|
| 110 | + bool data_digest; |
---|
| 111 | + unsigned int nr_write_queues; |
---|
| 112 | + unsigned int nr_poll_queues; |
---|
| 113 | + int tos; |
---|
104 | 114 | }; |
---|
105 | 115 | |
---|
106 | 116 | /* |
---|
.. | .. |
---|
143 | 153 | struct nvmf_ctrl_options *opts) |
---|
144 | 154 | { |
---|
145 | 155 | if (ctrl->state == NVME_CTRL_DELETING || |
---|
| 156 | + ctrl->state == NVME_CTRL_DELETING_NOIO || |
---|
146 | 157 | ctrl->state == NVME_CTRL_DEAD || |
---|
147 | 158 | strcmp(opts->subsysnqn, ctrl->opts->subsysnqn) || |
---|
148 | 159 | strcmp(opts->host->nqn, ctrl->opts->host->nqn) || |
---|
.. | .. |
---|
156 | 167 | int nvmf_reg_read64(struct nvme_ctrl *ctrl, u32 off, u64 *val); |
---|
157 | 168 | int nvmf_reg_write32(struct nvme_ctrl *ctrl, u32 off, u32 val); |
---|
158 | 169 | int nvmf_connect_admin_queue(struct nvme_ctrl *ctrl); |
---|
159 | | -int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid); |
---|
| 170 | +int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid, bool poll); |
---|
160 | 171 | int nvmf_register_transport(struct nvmf_transport_ops *ops); |
---|
161 | 172 | void nvmf_unregister_transport(struct nvmf_transport_ops *ops); |
---|
162 | 173 | void nvmf_free_options(struct nvmf_ctrl_options *opts); |
---|
.. | .. |
---|
166 | 177 | struct request *rq); |
---|
167 | 178 | bool __nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq, |
---|
168 | 179 | bool queue_live); |
---|
| 180 | +bool nvmf_ip_options_match(struct nvme_ctrl *ctrl, |
---|
| 181 | + struct nvmf_ctrl_options *opts); |
---|
169 | 182 | |
---|
170 | 183 | static inline bool nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq, |
---|
171 | 184 | bool queue_live) |
---|
172 | 185 | { |
---|
173 | 186 | if (likely(ctrl->state == NVME_CTRL_LIVE || |
---|
174 | | - ctrl->state == NVME_CTRL_ADMIN_ONLY)) |
---|
| 187 | + ctrl->state == NVME_CTRL_DELETING)) |
---|
175 | 188 | return true; |
---|
176 | 189 | return __nvmf_check_ready(ctrl, rq, queue_live); |
---|
177 | 190 | } |
---|