xref: /titanic_50/usr/src/lib/udapl/udapl_tavor/common/dapl_evd_cq_async_error_callb.c (revision 9e39c5ba00a55fa05777cc94b148296af305e135)
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 (c) 2002-2003, Network Appliance, Inc. All rights reserved.
24  */
25 
26 /*
27  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
28  * Use is subject to license terms.
29  */
30 
31 /*
32  *
33  * MODULE: dapl_evd_cq_async_error_callback.c
34  *
35  * PURPOSE: implements CQ async_callbacks from verbs
36  *
37  * $Id: dapl_evd_cq_async_error_callb.c,v 1.8 2003/07/31 13:55:18 hobie16 Exp $
38  */
39 
40 #include "dapl.h"
41 #include "dapl_evd_util.h"
42 
43 /*
44  * dapl_evd_cq_async_error_callback
45  *
46  * The callback function registered with verbs for cq async errors
47  *
48  * Input:
49  * 	ib_cm_handle,
50  * 	ib_cm_event
51  * 	cause_ptr
52  * 	context (evd)
53  *
54  * Output:
55  * 	None
56  *
57  */
58 
59 void
dapl_evd_cq_async_error_callback(IN ib_hca_handle_t ib_hca_handle,IN ib_cq_handle_t ib_cq_handle,IN ib_error_record_t * cause_ptr,IN void * context)60 dapl_evd_cq_async_error_callback(
61 	IN	ib_hca_handle_t		ib_hca_handle,
62 	IN	ib_cq_handle_t		ib_cq_handle,
63 	IN	ib_error_record_t	*cause_ptr,
64 	IN	void			*context)
65 {
66 	DAPL_EVD		*async_evd;
67 	DAPL_EVD		*evd;
68 	DAT_RETURN		dat_status;
69 
70 	dapl_dbg_log(DAPL_DBG_TYPE_CALLBACK | DAPL_DBG_TYPE_EXCEPTION,
71 	    "dapl_evd_cq_async_error_callback (%p, %p, %p, %p)\n",
72 	    ib_hca_handle,
73 	    ib_cq_handle,
74 	    cause_ptr,
75 	    context);
76 
77 	if (NULL == context) {
78 		dapl_os_assert(!"NULL == context\n");
79 		return;
80 	}
81 
82 	evd = (DAPL_EVD *) context;
83 	async_evd = evd->header.owner_ia->async_error_evd;
84 
85 	dat_status = dapls_evd_post_async_error_event(
86 	    async_evd,
87 	    DAT_ASYNC_ERROR_EVD_OVERFLOW,
88 	    (DAT_IA_HANDLE) async_evd->header.owner_ia);
89 
90 
91 	if (dat_status != DAT_SUCCESS) {
92 		dapl_os_assert(!"async EVD overflow\n");
93 	}
94 
95 	dapl_dbg_log(DAPL_DBG_TYPE_CALLBACK | DAPL_DBG_TYPE_EXCEPTION,
96 	    "dapl_evd_cq_async_error_callback () returns\n");
97 }
98