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 (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://www.opensolaris.org/os/licensing.
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 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 *
29 * MODULE: dapl_ep_create_with_srq.c
30 *
31 * PURPOSE: EP creates with SRQ
32 * Description: Interfaces in this file are completely described in
33 * the DAPL 1.2 API, Chapter 6, section 6
34 *
35 */
36
37 #include "dapl.h"
38 #include "dapl_ep_util.h"
39
40 /*
41 * dapl_ep_create_with_srq
42 *
43 * uDAPL: User Direct Access Program Library Version 1.2, 6.7.4.1
44 *
45 * creates an instance of an Endpoint that is using SRQ for Recv buffers
46 * is provided to the Consumer as ep_handle. Endpoint is created in
47 * Unconnected state.
48 *
49 * Input:
50 * ia_handle
51 * pz_handle
52 * recv_evd_handle
53 * request_evd_handle
54 * connect_evd_handle
55 * srq_handle
56 * ep_attributes
57 *
58 * Output:
59 * ep_handle
60 *
61 * Returns:
62 * DAT_SUCCESS
63 * DAT_INVALID_HANDLE
64 * DAT_INVALID_PARAMETER
65 * DAT_MODEL_NOT_SUPPORTED
66 */
67
68 /* ARGSUSED */
69 DAT_RETURN
dapl_ep_create_with_srq(IN DAT_IA_HANDLE ia_handle,IN DAT_PZ_HANDLE pz_handle,IN DAT_EVD_HANDLE recv_evd_handle,IN DAT_EVD_HANDLE request_evd_handle,IN DAT_EVD_HANDLE connect_evd_handle,IN DAT_SRQ_HANDLE srq_handle,IN const DAT_EP_ATTR * ep_attributes,OUT DAT_EP_HANDLE * ep_handle)70 dapl_ep_create_with_srq(
71 IN DAT_IA_HANDLE ia_handle,
72 IN DAT_PZ_HANDLE pz_handle,
73 IN DAT_EVD_HANDLE recv_evd_handle,
74 IN DAT_EVD_HANDLE request_evd_handle,
75 IN DAT_EVD_HANDLE connect_evd_handle,
76 IN DAT_SRQ_HANDLE srq_handle,
77 IN const DAT_EP_ATTR *ep_attributes,
78 OUT DAT_EP_HANDLE *ep_handle)
79 {
80 return (dapl_ep_create_common(ia_handle, pz_handle, recv_evd_handle,
81 request_evd_handle, connect_evd_handle, srq_handle, ep_attributes,
82 ep_handle));
83 }
84
85 /*
86 * dapl_ep_recv_query
87 *
88 * uDAPL: User Direct Access Program Library Version 1.2, 6.6.10
89 *
90 * provides to the Consumer a snapshot for Recv buffers on EP. The values
91 * for nbufs_allocated and bufs_alloc_span are not defined when DAT_RETURN
92 * is not DAT_SUCCESS.
93 *
94 * Input:
95 * ep_handle
96 *
97 * Output:
98 * nbufs_allocated
99 * bufs_alloc_span
100 *
101 * Returns:
102 * DAT_SUCCESS
103 * DAT_INVALID_HANDLE
104 * DAT_INVALID_PARAMETER
105 * DAT_MODEL_NOT_SUPPORTED
106 */
107
108 /* ARGSUSED */
109 DAT_RETURN
dapl_ep_recv_query(IN DAT_EP_HANDLE ep_handle,OUT DAT_COUNT * nbufs_allocated,OUT DAT_COUNT * bufs_alloc_span)110 dapl_ep_recv_query(
111 IN DAT_EP_HANDLE ep_handle,
112 OUT DAT_COUNT *nbufs_allocated,
113 OUT DAT_COUNT *bufs_alloc_span)
114 {
115 return (DAT_MODEL_NOT_SUPPORTED);
116 }
117
118 /*
119 * dapl_ep_set_watermark
120 *
121 * uDAPL: User Direct Access Program Library Version 1.2, 6.6.12
122 *
123 * sets the soft and hard high watermark values for EP and arms EP
124 * for generating asynchronous events for high watermarks. An asynchronous
125 * event will be generated for IA async_evd when the number of Recv buffers
126 * at EP is above the soft high watermark for the first time. An connection
127 * broken event will be generated for EP connect_evd when the number of Recv
128 * buffers at EP is above the hard high watermark. These may happen during
129 * this call or when EP takes a buffer from the SRQ or EP RQ. The soft and
130 * hard high watermark asynchronous event generation and setting are
131 * independent from each other.
132 *
133 * Input:
134 * ep_handle
135 * soft_high_watermark
136 * hard_high_watermark
137 *
138 * Output:
139 * none
140 *
141 * Returns:
142 * DAT_SUCCESS
143 * DAT_INSUFFICIENT_RESOURCES
144 * DAT_INVALID_HANDLE
145 * DAT_INVALID_PARAMETER
146 * DAT_MODEL_NOT_SUPPORTED
147 */
148
149 /* ARGSUSED */
150 DAT_RETURN
dapl_ep_set_watermark(IN DAT_EP_HANDLE ep_handle,IN DAT_COUNT soft_high_watermark,IN DAT_COUNT hard_high_watermark)151 dapl_ep_set_watermark(
152 IN DAT_EP_HANDLE ep_handle,
153 IN DAT_COUNT soft_high_watermark,
154 IN DAT_COUNT hard_high_watermark)
155 {
156 return (DAT_MODEL_NOT_SUPPORTED);
157 }
158