Linux Audio

Check our new training course

Loading...
v5.9
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/*
 3 * Copyright (c) 2015 Mellanox Technologies. All rights reserved.
 
 
 
 
 
 
 
 
 
 4 */
 5
 6#ifndef _LINUX_NVME_RDMA_H
 7#define _LINUX_NVME_RDMA_H
 8
 9enum nvme_rdma_cm_fmt {
10	NVME_RDMA_CM_FMT_1_0 = 0x0,
11};
12
13enum nvme_rdma_cm_status {
14	NVME_RDMA_CM_INVALID_LEN	= 0x01,
15	NVME_RDMA_CM_INVALID_RECFMT	= 0x02,
16	NVME_RDMA_CM_INVALID_QID	= 0x03,
17	NVME_RDMA_CM_INVALID_HSQSIZE	= 0x04,
18	NVME_RDMA_CM_INVALID_HRQSIZE	= 0x05,
19	NVME_RDMA_CM_NO_RSC		= 0x06,
20	NVME_RDMA_CM_INVALID_IRD	= 0x07,
21	NVME_RDMA_CM_INVALID_ORD	= 0x08,
22};
23
24static inline const char *nvme_rdma_cm_msg(enum nvme_rdma_cm_status status)
25{
26	switch (status) {
27	case NVME_RDMA_CM_INVALID_LEN:
28		return "invalid length";
29	case NVME_RDMA_CM_INVALID_RECFMT:
30		return "invalid record format";
31	case NVME_RDMA_CM_INVALID_QID:
32		return "invalid queue ID";
33	case NVME_RDMA_CM_INVALID_HSQSIZE:
34		return "invalid host SQ size";
35	case NVME_RDMA_CM_INVALID_HRQSIZE:
36		return "invalid host RQ size";
37	case NVME_RDMA_CM_NO_RSC:
38		return "resource not found";
39	case NVME_RDMA_CM_INVALID_IRD:
40		return "invalid IRD";
41	case NVME_RDMA_CM_INVALID_ORD:
42		return "Invalid ORD";
43	default:
44		return "unrecognized reason";
45	}
46}
47
48/**
49 * struct nvme_rdma_cm_req - rdma connect request
50 *
51 * @recfmt:        format of the RDMA Private Data
52 * @qid:           queue Identifier for the Admin or I/O Queue
53 * @hrqsize:       host receive queue size to be created
54 * @hsqsize:       host send queue size to be created
55 */
56struct nvme_rdma_cm_req {
57	__le16		recfmt;
58	__le16		qid;
59	__le16		hrqsize;
60	__le16		hsqsize;
61	u8		rsvd[24];
62};
63
64/**
65 * struct nvme_rdma_cm_rep - rdma connect reply
66 *
67 * @recfmt:        format of the RDMA Private Data
68 * @crqsize:       controller receive queue size
69 */
70struct nvme_rdma_cm_rep {
71	__le16		recfmt;
72	__le16		crqsize;
73	u8		rsvd[28];
74};
75
76/**
77 * struct nvme_rdma_cm_rej - rdma connect reject
78 *
79 * @recfmt:        format of the RDMA Private Data
80 * @sts:           error status for the associated connect request
81 */
82struct nvme_rdma_cm_rej {
83	__le16		recfmt;
84	__le16		sts;
85};
86
87#endif /* _LINUX_NVME_RDMA_H */
v4.10.11
 
 1/*
 2 * Copyright (c) 2015 Mellanox Technologies. All rights reserved.
 3 *
 4 * This program is free software; you can redistribute it and/or modify it
 5 * under the terms and conditions of the GNU General Public License,
 6 * version 2, as published by the Free Software Foundation.
 7 *
 8 * This program is distributed in the hope it will be useful, but WITHOUT
 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
11 * more details.
12 */
13
14#ifndef _LINUX_NVME_RDMA_H
15#define _LINUX_NVME_RDMA_H
16
17enum nvme_rdma_cm_fmt {
18	NVME_RDMA_CM_FMT_1_0 = 0x0,
19};
20
21enum nvme_rdma_cm_status {
22	NVME_RDMA_CM_INVALID_LEN	= 0x01,
23	NVME_RDMA_CM_INVALID_RECFMT	= 0x02,
24	NVME_RDMA_CM_INVALID_QID	= 0x03,
25	NVME_RDMA_CM_INVALID_HSQSIZE	= 0x04,
26	NVME_RDMA_CM_INVALID_HRQSIZE	= 0x05,
27	NVME_RDMA_CM_NO_RSC		= 0x06,
28	NVME_RDMA_CM_INVALID_IRD	= 0x07,
29	NVME_RDMA_CM_INVALID_ORD	= 0x08,
30};
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32/**
33 * struct nvme_rdma_cm_req - rdma connect request
34 *
35 * @recfmt:        format of the RDMA Private Data
36 * @qid:           queue Identifier for the Admin or I/O Queue
37 * @hrqsize:       host receive queue size to be created
38 * @hsqsize:       host send queue size to be created
39 */
40struct nvme_rdma_cm_req {
41	__le16		recfmt;
42	__le16		qid;
43	__le16		hrqsize;
44	__le16		hsqsize;
45	u8		rsvd[24];
46};
47
48/**
49 * struct nvme_rdma_cm_rep - rdma connect reply
50 *
51 * @recfmt:        format of the RDMA Private Data
52 * @crqsize:       controller receive queue size
53 */
54struct nvme_rdma_cm_rep {
55	__le16		recfmt;
56	__le16		crqsize;
57	u8		rsvd[28];
58};
59
60/**
61 * struct nvme_rdma_cm_rej - rdma connect reject
62 *
63 * @recfmt:        format of the RDMA Private Data
64 * @fsts:          error status for the associated connect request
65 */
66struct nvme_rdma_cm_rej {
67	__le16		recfmt;
68	__le16		sts;
69};
70
71#endif /* _LINUX_NVME_RDMA_H */