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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _RDS_KSTAT_H
#define _RDS_KSTAT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/types.h>
#include <sys/kstat.h>
struct rds_kstat_s {
kstat_named_t rds_nports;
kstat_named_t rds_nsessions;
kstat_named_t rds_tx_bytes;
kstat_named_t rds_tx_pkts;
kstat_named_t rds_tx_errors;
kstat_named_t rds_rx_bytes;
kstat_named_t rds_rx_pkts;
kstat_named_t rds_rx_pkts_pending;
kstat_named_t rds_rx_errors;
kstat_named_t rds_tx_acks;
kstat_named_t rds_post_recv_buf_called;
kstat_named_t rds_stalls_triggered;
kstat_named_t rds_stalls_sent;
kstat_named_t rds_unstalls_triggered;
kstat_named_t rds_unstalls_sent;
kstat_named_t rds_stalls_recvd;
kstat_named_t rds_unstalls_recvd;
kstat_named_t rds_stalls_ignored;
kstat_named_t rds_enobufs;
kstat_named_t rds_ewouldblocks;
kstat_named_t rds_failovers;
kstat_named_t rds_port_quota;
kstat_named_t rds_port_quota_adjusted;
};
extern void rds_increment_kstat(kstat_named_t *, boolean_t, uint_t);
extern void rds_decrement_kstat(kstat_named_t *, boolean_t, uint_t);
extern void rds_set_kstat(kstat_named_t *, boolean_t, ulong_t);
extern ulong_t rds_get_kstat(kstat_named_t *, boolean_t);
extern struct rds_kstat_s rds_kstat;
#define RDS_SET_NPORT(num) \
rds_set_kstat(&rds_kstat.rds_nports, B_TRUE, num)
#define RDS_INCR_NPORT() \
rds_increment_kstat(&rds_kstat.rds_nports, B_TRUE, 1)
#define RDS_DECR_NPORT() \
rds_decrement_kstat(&rds_kstat.rds_nports, B_TRUE, 1)
#define RDS_GET_NPORT() \
rds_get_kstat(&rds_kstat.rds_nports, B_TRUE)
#define RDS_INCR_SESS() \
rds_increment_kstat(&rds_kstat.rds_nsessions, B_FALSE, 1)
#define RDS_DECR_SESS() \
rds_decrement_kstat(&rds_kstat.rds_nsessions, B_FALSE, 1)
#define RDS_INCR_TXBYTES(num) \
rds_increment_kstat(&rds_kstat.rds_tx_bytes, B_FALSE, num)
#define RDS_INCR_TXPKTS(num) \
rds_increment_kstat(&rds_kstat.rds_tx_pkts, B_FALSE, num)
#define RDS_INCR_TXERRS() \
rds_increment_kstat(&rds_kstat.rds_tx_errors, B_FALSE, 1)
#define RDS_INCR_RXBYTES(num) \
rds_increment_kstat(&rds_kstat.rds_rx_bytes, B_FALSE, num)
#define RDS_INCR_RXPKTS(num) \
rds_increment_kstat(&rds_kstat.rds_rx_pkts, B_FALSE, num)
#define RDS_INCR_RXPKTS_PEND(num) \
rds_increment_kstat(&rds_kstat.rds_rx_pkts_pending, B_TRUE, num)
#define RDS_DECR_RXPKTS_PEND(num) \
rds_decrement_kstat(&rds_kstat.rds_rx_pkts_pending, B_TRUE, num)
#define RDS_GET_RXPKTS_PEND() \
rds_get_kstat(&rds_kstat.rds_rx_pkts_pending, B_TRUE)
#define RDS_INCR_RXERRS() \
rds_increment_kstat(&rds_kstat.rds_rx_errors, B_FALSE, 1)
#define RDS_INCR_TXACKS() \
rds_increment_kstat(&rds_kstat.rds_tx_acks, B_FALSE, 1)
#define RDS_INCR_POST_RCV_BUF_CALLS() \
rds_increment_kstat(&rds_kstat.rds_post_recv_buf_called, B_FALSE, 1)
#define RDS_INCR_STALLS_TRIGGERED() \
rds_increment_kstat(&rds_kstat.rds_stalls_triggered, B_FALSE, 1)
#define RDS_INCR_STALLS_SENT() \
rds_increment_kstat(&rds_kstat.rds_stalls_sent, B_FALSE, 1)
#define RDS_INCR_UNSTALLS_TRIGGERED() \
rds_increment_kstat(&rds_kstat.rds_unstalls_triggered, B_FALSE, 1)
#define RDS_INCR_UNSTALLS_SENT() \
rds_increment_kstat(&rds_kstat.rds_unstalls_sent, B_FALSE, 1)
#define RDS_INCR_STALLS_RCVD() \
rds_increment_kstat(&rds_kstat.rds_stalls_recvd, B_FALSE, 1)
#define RDS_INCR_UNSTALLS_RCVD() \
rds_increment_kstat(&rds_kstat.rds_unstalls_recvd, B_FALSE, 1)
#define RDS_INCR_STALLS_IGNORED() \
rds_increment_kstat(&rds_kstat.rds_stalls_ignored, B_FALSE, 1)
#define RDS_INCR_ENOBUFS() \
rds_increment_kstat(&rds_kstat.rds_enobufs, B_FALSE, 1)
#define RDS_INCR_EWOULDBLOCK() \
rds_increment_kstat(&rds_kstat.rds_ewouldblocks, B_FALSE, 1)
#define RDS_INCR_FAILOVERS() \
rds_increment_kstat(&rds_kstat.rds_failovers, B_FALSE, 1)
#define RDS_SET_PORT_QUOTA(num) \
rds_set_kstat(&rds_kstat.rds_port_quota, B_TRUE, num)
#define RDS_GET_PORT_QUOTA() \
rds_get_kstat(&rds_kstat.rds_port_quota, B_TRUE)
#define RDS_INCR_PORT_QUOTA_ADJUSTED() \
rds_increment_kstat(&rds_kstat.rds_port_quota_adjusted, B_FALSE, 1)
#ifdef __cplusplus
}
#endif
#endif /* _RDS_KSTAT_H */
|