xref: /illumos-gate/usr/src/uts/common/io/qede/579xx/drivers/ecore/hsi_repository/rdma_common.h (revision 14b24e2b79293068c8e016a69ef1d872fb5e2fd5)
1 /*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, v.1,  (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://opensource.org/licenses/CDDL-1.0.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 
22 /*
23 * Copyright 2014-2017 Cavium, Inc.
24 * The contents of this file are subject to the terms of the Common Development
25 * and Distribution License, v.1,  (the "License").
26 
27 * You may not use this file except in compliance with the License.
28 
29 * You can obtain a copy of the License at available
30 * at http://opensource.org/licenses/CDDL-1.0
31 
32 * See the License for the specific language governing permissions and
33 * limitations under the License.
34 */
35 
36 #ifndef __RDMA_COMMON__
37 #define __RDMA_COMMON__
38 /************************/
39 /* RDMA FW CONSTANTS */
40 /************************/
41 
42 #define RDMA_RESERVED_LKEY			(0)			//Reserved lkey
43 #define RDMA_RING_PAGE_SIZE			(0x1000)	//4KB pages
44 
45 #define	RDMA_MAX_SGE_PER_SQ_WQE		(4)		//max number of SGEs in a single request
46 #define	RDMA_MAX_SGE_PER_RQ_WQE		(4)		//max number of SGEs in a single request
47 
48 #define RDMA_MAX_DATA_SIZE_IN_WQE	(0x80000000)	//max size of data in single request
49 
50 #define RDMA_REQ_RD_ATOMIC_ELM_SIZE		(0x50)
51 #define RDMA_RESP_RD_ATOMIC_ELM_SIZE	(0x20)
52 
53 #define RDMA_MAX_CQS				(64*1024)
54 #define RDMA_MAX_TIDS				(128*1024-1)
55 #define RDMA_MAX_PDS				(64*1024)
56 
57 #define RDMA_NUM_STATISTIC_COUNTERS			MAX_NUM_VPORTS
58 #define RDMA_NUM_STATISTIC_COUNTERS_K2			MAX_NUM_VPORTS_K2
59 #define RDMA_NUM_STATISTIC_COUNTERS_BB			MAX_NUM_VPORTS_BB
60 
61 #define RDMA_TASK_TYPE (PROTOCOLID_ROCE)
62 
63 
64 struct rdma_srq_id
65 {
66 	__le16 srq_idx /* SRQ index */;
67 	__le16 opaque_fid;
68 };
69 
70 
71 struct rdma_srq_producers
72 {
73 	__le32 sge_prod /* Current produced sge in SRQ */;
74 	__le32 wqe_prod /* Current produced WQE to SRQ */;
75 };
76 
77 #endif /* __RDMA_COMMON__ */
78