xref: /linux/include/linux/nvme-rdma.h (revision 931a6de4d734de6142142c82555e3f017adcb9f0)
1*931a6de4SSagi Grimberg /*
2*931a6de4SSagi Grimberg  * Copyright (c) 2015 Mellanox Technologies. All rights reserved.
3*931a6de4SSagi Grimberg  *
4*931a6de4SSagi Grimberg  * This program is free software; you can redistribute it and/or modify it
5*931a6de4SSagi Grimberg  * under the terms and conditions of the GNU General Public License,
6*931a6de4SSagi Grimberg  * version 2, as published by the Free Software Foundation.
7*931a6de4SSagi Grimberg  *
8*931a6de4SSagi Grimberg  * This program is distributed in the hope it will be useful, but WITHOUT
9*931a6de4SSagi Grimberg  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10*931a6de4SSagi Grimberg  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
11*931a6de4SSagi Grimberg  * more details.
12*931a6de4SSagi Grimberg  */
13*931a6de4SSagi Grimberg 
14*931a6de4SSagi Grimberg #ifndef _LINUX_NVME_RDMA_H
15*931a6de4SSagi Grimberg #define _LINUX_NVME_RDMA_H
16*931a6de4SSagi Grimberg 
17*931a6de4SSagi Grimberg enum nvme_rdma_cm_fmt {
18*931a6de4SSagi Grimberg 	NVME_RDMA_CM_FMT_1_0 = 0x0,
19*931a6de4SSagi Grimberg };
20*931a6de4SSagi Grimberg 
21*931a6de4SSagi Grimberg enum nvme_rdma_cm_status {
22*931a6de4SSagi Grimberg 	NVME_RDMA_CM_INVALID_LEN	= 0x01,
23*931a6de4SSagi Grimberg 	NVME_RDMA_CM_INVALID_RECFMT	= 0x02,
24*931a6de4SSagi Grimberg 	NVME_RDMA_CM_INVALID_QID	= 0x03,
25*931a6de4SSagi Grimberg 	NVME_RDMA_CM_INVALID_HSQSIZE	= 0x04,
26*931a6de4SSagi Grimberg 	NVME_RDMA_CM_INVALID_HRQSIZE	= 0x05,
27*931a6de4SSagi Grimberg 	NVME_RDMA_CM_NO_RSC		= 0x06,
28*931a6de4SSagi Grimberg 	NVME_RDMA_CM_INVALID_IRD	= 0x07,
29*931a6de4SSagi Grimberg 	NVME_RDMA_CM_INVALID_ORD	= 0x08,
30*931a6de4SSagi Grimberg };
31*931a6de4SSagi Grimberg 
32*931a6de4SSagi Grimberg /**
33*931a6de4SSagi Grimberg  * struct nvme_rdma_cm_req - rdma connect request
34*931a6de4SSagi Grimberg  *
35*931a6de4SSagi Grimberg  * @recfmt:        format of the RDMA Private Data
36*931a6de4SSagi Grimberg  * @qid:           queue Identifier for the Admin or I/O Queue
37*931a6de4SSagi Grimberg  * @hrqsize:       host receive queue size to be created
38*931a6de4SSagi Grimberg  * @hsqsize:       host send queue size to be created
39*931a6de4SSagi Grimberg  */
40*931a6de4SSagi Grimberg struct nvme_rdma_cm_req {
41*931a6de4SSagi Grimberg 	__le16		recfmt;
42*931a6de4SSagi Grimberg 	__le16		qid;
43*931a6de4SSagi Grimberg 	__le16		hrqsize;
44*931a6de4SSagi Grimberg 	__le16		hsqsize;
45*931a6de4SSagi Grimberg 	u8		rsvd[24];
46*931a6de4SSagi Grimberg };
47*931a6de4SSagi Grimberg 
48*931a6de4SSagi Grimberg /**
49*931a6de4SSagi Grimberg  * struct nvme_rdma_cm_rep - rdma connect reply
50*931a6de4SSagi Grimberg  *
51*931a6de4SSagi Grimberg  * @recfmt:        format of the RDMA Private Data
52*931a6de4SSagi Grimberg  * @crqsize:       controller receive queue size
53*931a6de4SSagi Grimberg  */
54*931a6de4SSagi Grimberg struct nvme_rdma_cm_rep {
55*931a6de4SSagi Grimberg 	__le16		recfmt;
56*931a6de4SSagi Grimberg 	__le16		crqsize;
57*931a6de4SSagi Grimberg 	u8		rsvd[28];
58*931a6de4SSagi Grimberg };
59*931a6de4SSagi Grimberg 
60*931a6de4SSagi Grimberg /**
61*931a6de4SSagi Grimberg  * struct nvme_rdma_cm_rej - rdma connect reject
62*931a6de4SSagi Grimberg  *
63*931a6de4SSagi Grimberg  * @recfmt:        format of the RDMA Private Data
64*931a6de4SSagi Grimberg  * @fsts:          error status for the associated connect request
65*931a6de4SSagi Grimberg  */
66*931a6de4SSagi Grimberg struct nvme_rdma_cm_rej {
67*931a6de4SSagi Grimberg 	__le16		recfmt;
68*931a6de4SSagi Grimberg 	__le16		sts;
69*931a6de4SSagi Grimberg };
70*931a6de4SSagi Grimberg 
71*931a6de4SSagi Grimberg #endif /* _LINUX_NVME_RDMA_H */
72