1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* 23*0Sstevel@tonic-gate * Copyright 2003 Sun Microsystems, Inc. All rights reserved. 24*0Sstevel@tonic-gate * Use is subject to license terms. 25*0Sstevel@tonic-gate */ 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate #ifndef _SYS_IB_MGT_IBMF_IBMF_KSTAT_H 28*0Sstevel@tonic-gate #define _SYS_IB_MGT_IBMF_IBMF_KSTAT_H 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*0Sstevel@tonic-gate 32*0Sstevel@tonic-gate /* 33*0Sstevel@tonic-gate * This file contains the IBMF kstat structures and defines. 34*0Sstevel@tonic-gate */ 35*0Sstevel@tonic-gate 36*0Sstevel@tonic-gate #ifdef __cplusplus 37*0Sstevel@tonic-gate extern "C" { 38*0Sstevel@tonic-gate #endif 39*0Sstevel@tonic-gate 40*0Sstevel@tonic-gate /* Kstat structure definitions */ 41*0Sstevel@tonic-gate typedef struct ibmf_port_kstat_s { 42*0Sstevel@tonic-gate kstat_named_t clients_registered; /* # clients registered on HCA */ 43*0Sstevel@tonic-gate kstat_named_t client_regs_failed; /* client registration failures */ 44*0Sstevel@tonic-gate kstat_named_t send_wqes_alloced; /* # currently allocated send WQEs */ 45*0Sstevel@tonic-gate kstat_named_t recv_wqes_alloced; /* # currently allocated recv WQEs */ 46*0Sstevel@tonic-gate kstat_named_t swqe_allocs_failed; /* send WQE allocations failed */ 47*0Sstevel@tonic-gate kstat_named_t rwqe_allocs_failed; /* recv WQE allocations failed */ 48*0Sstevel@tonic-gate } ibmf_port_kstat_t; 49*0Sstevel@tonic-gate 50*0Sstevel@tonic-gate typedef struct ibmf_kstat_s { 51*0Sstevel@tonic-gate kstat_named_t msgs_alloced; /* # currently allocated messages */ 52*0Sstevel@tonic-gate kstat_named_t msgs_active; /* # currently active messages */ 53*0Sstevel@tonic-gate kstat_named_t msgs_sent; /* # total msgs sent per port */ 54*0Sstevel@tonic-gate kstat_named_t msgs_received; /* # total msgs recv per port */ 55*0Sstevel@tonic-gate kstat_named_t sends_active; /* # currently active send messages */ 56*0Sstevel@tonic-gate kstat_named_t recvs_active; /* # currently active recv messages */ 57*0Sstevel@tonic-gate kstat_named_t ud_dests_alloced; /* # currently allocated UD Dests */ 58*0Sstevel@tonic-gate kstat_named_t alt_qps_alloced; /* # currently allocated alt. QPs */ 59*0Sstevel@tonic-gate kstat_named_t send_cb_active; /* # active send callbacks */ 60*0Sstevel@tonic-gate kstat_named_t recv_cb_active; /* # active send callbacks */ 61*0Sstevel@tonic-gate kstat_named_t recv_bufs_alloced; /* # receive buffers allocated */ 62*0Sstevel@tonic-gate kstat_named_t msg_allocs_failed; /* message allocations failed */ 63*0Sstevel@tonic-gate kstat_named_t uddest_allocs_failed; /* UD dest allocations failed */ 64*0Sstevel@tonic-gate kstat_named_t alt_qp_allocs_failed; /* alt. QP allocations failed */ 65*0Sstevel@tonic-gate kstat_named_t send_pkt_failed; /* send packet failures */ 66*0Sstevel@tonic-gate kstat_named_t rmpp_errors; /* count of rmpp errors */ 67*0Sstevel@tonic-gate } ibmf_kstat_t; 68*0Sstevel@tonic-gate 69*0Sstevel@tonic-gate #define IBMF_ADD32_KSTATS(clientp, xx, val) \ 70*0Sstevel@tonic-gate if ((clientp != NULL) && (clientp->ic_kstatp != NULL)) { \ 71*0Sstevel@tonic-gate ibmf_kstat_t *kp; \ 72*0Sstevel@tonic-gate kp = (ibmf_kstat_t *)clientp->ic_kstatp->ks_data; \ 73*0Sstevel@tonic-gate kp->xx.value.ui32 += val; \ 74*0Sstevel@tonic-gate } 75*0Sstevel@tonic-gate 76*0Sstevel@tonic-gate #define IBMF_SUB32_KSTATS(clientp, xx, val) \ 77*0Sstevel@tonic-gate if ((clientp != NULL) && (clientp->ic_kstatp != NULL)) { \ 78*0Sstevel@tonic-gate ibmf_kstat_t *kp; \ 79*0Sstevel@tonic-gate kp = (ibmf_kstat_t *)clientp->ic_kstatp->ks_data; \ 80*0Sstevel@tonic-gate kp->xx.value.ui32 -= val; \ 81*0Sstevel@tonic-gate } 82*0Sstevel@tonic-gate 83*0Sstevel@tonic-gate #define IBMF_ADD32_PORT_KSTATS(cip, xx, val) \ 84*0Sstevel@tonic-gate if ((cip != NULL) && (cip->ci_port_kstatp != NULL)) { \ 85*0Sstevel@tonic-gate ibmf_port_kstat_t *kp; \ 86*0Sstevel@tonic-gate kp = (ibmf_port_kstat_t *)cip->ci_port_kstatp->ks_data; \ 87*0Sstevel@tonic-gate kp->xx.value.ui32 += val; \ 88*0Sstevel@tonic-gate } 89*0Sstevel@tonic-gate 90*0Sstevel@tonic-gate #define IBMF_SUB32_PORT_KSTATS(cip, xx, val) \ 91*0Sstevel@tonic-gate if ((cip != NULL) && (cip->ci_port_kstatp != NULL)) { \ 92*0Sstevel@tonic-gate ibmf_port_kstat_t *kp; \ 93*0Sstevel@tonic-gate kp = (ibmf_port_kstat_t *)cip->ci_port_kstatp->ks_data; \ 94*0Sstevel@tonic-gate kp->xx.value.ui32 -= val; \ 95*0Sstevel@tonic-gate } 96*0Sstevel@tonic-gate 97*0Sstevel@tonic-gate #ifdef __cplusplus 98*0Sstevel@tonic-gate } 99*0Sstevel@tonic-gate #endif 100*0Sstevel@tonic-gate 101*0Sstevel@tonic-gate #endif /* _SYS_IB_MGT_IBMF_IBMF_KSTAT_H */ 102