summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/ib/mgt/ibmf/ibmf_kstat.h
blob: 643f7d477db5d8f3615a74f30f8efc25a37ba7c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef _SYS_IB_MGT_IBMF_IBMF_KSTAT_H
#define	_SYS_IB_MGT_IBMF_IBMF_KSTAT_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

/*
 * This file contains the IBMF kstat structures and defines.
 */

#ifdef __cplusplus
extern "C" {
#endif

/* Kstat structure definitions */
typedef struct ibmf_port_kstat_s {
	kstat_named_t	clients_registered; /* # clients registered on HCA */
	kstat_named_t	client_regs_failed; /* client registration failures */
	kstat_named_t	send_wqes_alloced; /* # currently allocated send WQEs */
	kstat_named_t	recv_wqes_alloced; /* # currently allocated recv WQEs */
	kstat_named_t	swqe_allocs_failed; /* send WQE allocations failed */
	kstat_named_t	rwqe_allocs_failed; /* recv WQE allocations failed */
} ibmf_port_kstat_t;

typedef struct ibmf_kstat_s {
	kstat_named_t	msgs_alloced;	  /* # currently allocated messages */
	kstat_named_t	msgs_active;	  /* # currently active messages */
	kstat_named_t	msgs_sent;	  /* # total msgs sent per port */
	kstat_named_t	msgs_received;	  /* # total msgs recv per port */
	kstat_named_t	sends_active;    /* # currently active send messages */
	kstat_named_t	recvs_active;    /* # currently active recv messages */
	kstat_named_t	ud_dests_alloced;  /* # currently allocated UD Dests */
	kstat_named_t	alt_qps_alloced;  /* # currently allocated alt. QPs */
	kstat_named_t	send_cb_active;	  /* # active send callbacks */
	kstat_named_t	recv_cb_active;	  /* # active send callbacks */
	kstat_named_t	recv_bufs_alloced; /* # receive buffers allocated */
	kstat_named_t	msg_allocs_failed; /* message allocations failed */
	kstat_named_t	uddest_allocs_failed; /* UD dest allocations failed */
	kstat_named_t	alt_qp_allocs_failed; /* alt. QP allocations failed */
	kstat_named_t	send_pkt_failed; /* send packet failures */
	kstat_named_t	rmpp_errors;	/* count of rmpp errors */
} ibmf_kstat_t;

#define	IBMF_ADD32_KSTATS(clientp, xx, val)				\
	if ((clientp != NULL) && (clientp->ic_kstatp != NULL)) {	\
		ibmf_kstat_t	*kp;					\
		kp = (ibmf_kstat_t *)clientp->ic_kstatp->ks_data;	\
		kp->xx.value.ui32 += val;				\
	}

#define	IBMF_SUB32_KSTATS(clientp, xx, val)				\
	if ((clientp != NULL) && (clientp->ic_kstatp != NULL)) {	\
		ibmf_kstat_t	*kp;					\
		kp = (ibmf_kstat_t *)clientp->ic_kstatp->ks_data;	\
		kp->xx.value.ui32 -= val;				\
	}

#define	IBMF_ADD32_PORT_KSTATS(cip, xx, val)				\
	if ((cip != NULL) && (cip->ci_port_kstatp != NULL)) {		\
		ibmf_port_kstat_t	*kp;				\
		kp = (ibmf_port_kstat_t *)cip->ci_port_kstatp->ks_data;	\
		kp->xx.value.ui32 += val;				\
	}

#define	IBMF_SUB32_PORT_KSTATS(cip, xx, val)				\
	if ((cip != NULL) && (cip->ci_port_kstatp != NULL)) {		\
		ibmf_port_kstat_t	*kp;				\
		kp = (ibmf_port_kstat_t *)cip->ci_port_kstatp->ks_data;	\
		kp->xx.value.ui32 -= val;				\
	}

#ifdef __cplusplus
}
#endif

#endif /* _SYS_IB_MGT_IBMF_IBMF_KSTAT_H */