forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/nvme/host/fabrics.h
....@@ -1,15 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
23 * NVMe over Fabrics common host code.
34 * 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.
135 */
146 #ifndef _NVME_FABRICS_H
157 #define _NVME_FABRICS_H 1
....@@ -58,6 +50,12 @@
5850 NVMF_OPT_CTRL_LOSS_TMO = 1 << 11,
5951 NVMF_OPT_HOST_ID = 1 << 12,
6052 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,
6159 };
6260
6361 /**
....@@ -85,6 +83,12 @@
8583 * @max_reconnects: maximum number of allowed reconnect attempts before removing
8684 * the controller, (-1) means reconnect forever, zero means remove
8785 * 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
8892 */
8993 struct nvmf_ctrl_options {
9094 unsigned mask;
....@@ -101,6 +105,12 @@
101105 unsigned int kato;
102106 struct nvmf_host *host;
103107 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;
104114 };
105115
106116 /*
....@@ -143,6 +153,7 @@
143153 struct nvmf_ctrl_options *opts)
144154 {
145155 if (ctrl->state == NVME_CTRL_DELETING ||
156
+ ctrl->state == NVME_CTRL_DELETING_NOIO ||
146157 ctrl->state == NVME_CTRL_DEAD ||
147158 strcmp(opts->subsysnqn, ctrl->opts->subsysnqn) ||
148159 strcmp(opts->host->nqn, ctrl->opts->host->nqn) ||
....@@ -156,7 +167,7 @@
156167 int nvmf_reg_read64(struct nvme_ctrl *ctrl, u32 off, u64 *val);
157168 int nvmf_reg_write32(struct nvme_ctrl *ctrl, u32 off, u32 val);
158169 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);
160171 int nvmf_register_transport(struct nvmf_transport_ops *ops);
161172 void nvmf_unregister_transport(struct nvmf_transport_ops *ops);
162173 void nvmf_free_options(struct nvmf_ctrl_options *opts);
....@@ -166,12 +177,14 @@
166177 struct request *rq);
167178 bool __nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
168179 bool queue_live);
180
+bool nvmf_ip_options_match(struct nvme_ctrl *ctrl,
181
+ struct nvmf_ctrl_options *opts);
169182
170183 static inline bool nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
171184 bool queue_live)
172185 {
173186 if (likely(ctrl->state == NVME_CTRL_LIVE ||
174
- ctrl->state == NVME_CTRL_ADMIN_ONLY))
187
+ ctrl->state == NVME_CTRL_DELETING))
175188 return true;
176189 return __nvmf_check_ready(ctrl, rq, queue_live);
177190 }