hxge_kstats.c revision fd9489cef0e9b7d8a708339e560d453f230af2cf
/*
* 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
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <hxge_impl.h>
#define RDC_NAME_FORMAT1 "RDC_"
#define TDC_NAME_FORMAT1 "TDC_"
#define CH_NAME_FORMAT "%d"
void
{
stats_size = sizeof (hxge_stats_t);
}
typedef struct {
char *name;
typedef enum {
RDC_STAT_PACKETS = 0,
};
typedef enum {
};
typedef enum {
TDC_STAT_PACKETS = 0,
"tdc_count_hdr_size_err"},
};
typedef enum {
REORD_TBL_PAR_ERR = 0,
};
typedef enum {
VMAC_STAT_TX_FRAME_CNT, /* vmac_tx_frame_cnt_t */
VMAC_STAT_TX_BYTE_CNT, /* vmac_tx_byte_cnt_t */
VMAC_STAT_RX_FRAME_CNT, /* vmac_rx_frame_cnt_t */
VMAC_STAT_RX_BYTE_CNT, /* vmac_rx_byte_cnt_t */
VMAC_STAT_RX_DROP_FRAME_CNT, /* vmac_rx_drop_fr_cnt_t */
VMAC_STAT_RX_DROP_BYTE_CNT, /* vmac_rx_drop_byte_cnt_t */
VMAC_STAT_RX_CRC_CNT, /* vmac_rx_crc_cnt_t */
VMAC_STAT_RX_PAUSE_CNT, /* vmac_rx_pause_cnt_t */
VMAC_STAT_RX_BCAST_FR_CNT, /* vmac_rx_bcast_fr_cnt_t */
VMAC_STAT_RX_MCAST_FR_CNT, /* vmac_rx_mcast_fr_cnt_t */
"vmac_rx_drop_frame_cnt"},
"vmac_rx_drop_byte_cnt"},
};
typedef enum {
" pfc_pkt_drop_class_code"},
};
typedef enum {
};
typedef enum {
SPC_ACC_ERR = 0,
};
/* ARGSUSED */
int
{
int channel;
return (-1);
"hxge_tdc_stat_update data $%p statsp $%p channel %d",
return (0);
}
/* ARGSUSED */
int
{
return (-1);
return (0);
}
/* ARGSUSED */
int
{
int channel;
return (-1);
"hxge_rdc_stat_update $%p statsp $%p channel %d",
return (0);
}
/* ARGSUSED */
int
{
return (-1);
return (0);
}
/* ARGSUSED */
int
{
return (-1);
return (0);
}
/* ARGSUSED */
int
{
return (-1);
return (0);
}
static uint64_t
{
int i;
for (i = ETHERADDRL - 1; i >= 0; i--) {
addr64 <<= 8;
}
return (addr64);
}
/* ARGSUSED */
int
{
return (-1);
return (0);
}
/* ARGSUSED */
int
{
return (-1);
return (0);
}
static kstat_t *
{
int i;
KSTAT_TYPE_NAMED, count, 0);
return (NULL);
}
return (ksp);
}
void
{
char stat_name[64];
char mmac_name[64];
int i;
/* Setup RDC statistics */
RDC_NAME_FORMAT1, i);
"kstat_create failed for rdc channel %d", i);
}
/* Setup RDC System statistics */
/* Setup TDC statistics */
TDC_NAME_FORMAT1, i);
"kstat_create failed for tdc channel %d", i);
}
/* Setup TDC System statistics */
/* Setup PFC statistics */
/* Setup VMAC statistics */
/* Setup MMAC statistics */
/* Setup PEU System statistics */
/* Port stats */
hxge_kstat_sz = sizeof (hxge_port_kstat_t);
return;
}
/*
* Link partner capabilities.
*/
/*
* Shared link setup.
*/
/*
* Loopback statistics.
*/
/* General MAC statistics */
}
void
{
int channel;
return;
}
}
}
}
}
/* ARGSUSED */
int
{
return (-1);
else
/*
* transceiver state informations.
*/
/*
* Link partner capabilities.
*/
/*
* Physical link statistics.
*/
else
/*
* Loopback statistics.
*/
return (0);
}
int
{
int channel;
switch (stat) {
case MAC_STAT_IFSPEED:
break;
case MAC_STAT_MULTIRCV:
val = 0;
break;
case MAC_STAT_BRDCSTRCV:
val = 0;
break;
case MAC_STAT_MULTIXMT:
val = 0;
break;
case MAC_STAT_BRDCSTXMT:
val = 0;
break;
case MAC_STAT_NORCVBUF:
val = 0;
break;
case MAC_STAT_IERRORS:
case ETHER_STAT_MACRCV_ERRORS:
val = 0;
}
break;
case MAC_STAT_NOXMTBUF:
val = 0;
break;
case MAC_STAT_OERRORS:
}
break;
case MAC_STAT_COLLISIONS:
val = 0;
break;
case MAC_STAT_RBYTES:
}
break;
case MAC_STAT_IPACKETS:
}
break;
case MAC_STAT_OBYTES:
}
break;
case MAC_STAT_OPACKETS:
}
break;
case MAC_STAT_UNKNOWNS:
val = 0;
break;
case MAC_STAT_UNDERFLOWS:
val = 0;
break;
case MAC_STAT_OVERFLOWS:
val = 0;
break;
case MAC_STAT_LINK_STATE:
break;
case MAC_STAT_LINK_UP:
break;
case MAC_STAT_PROMISC:
break;
case ETHER_STAT_SQE_ERRORS:
val = 0;
break;
case ETHER_STAT_ALIGN_ERRORS:
/*
* No similar error in Hydra receive channels
*/
val = 0;
break;
case ETHER_STAT_FCS_ERRORS:
/*
* No similar error in Hydra receive channels
*/
val = 0;
break;
val = 0;
break;
val = 0;
break;
val = 0;
break;
case ETHER_STAT_EX_COLLISIONS:
val = 0;
break;
case ETHER_STAT_DEFER_XMTS:
val = 0;
break;
case ETHER_STAT_MACXMT_ERRORS:
/*
* A count of frames for which transmission on a
* particular interface fails due to an internal
* MAC sublayer transmit error
*/
}
break;
/*
* The number of times that the carrier sense
* condition was lost or never asserted when
* attempting to transmit a frame on a particular interface
*/
}
break;
/*
* A count of frames received on a particular
* interface that exceed the maximum permitted frame size
*/
}
break;
case ETHER_STAT_XCVR_ADDR:
val = 0;
break;
case ETHER_STAT_XCVR_ID:
val = 0;
break;
case ETHER_STAT_XCVR_INUSE:
val = 0;
break;
case ETHER_STAT_CAP_1000FDX:
val = 0;
break;
case ETHER_STAT_CAP_1000HDX:
val = 0;
break;
case ETHER_STAT_CAP_100FDX:
val = 0;
break;
case ETHER_STAT_CAP_100HDX:
val = 0;
break;
case ETHER_STAT_CAP_10FDX:
val = 0;
break;
case ETHER_STAT_CAP_10HDX:
val = 0;
break;
case ETHER_STAT_CAP_ASMPAUSE:
val = 0;
break;
case ETHER_STAT_CAP_PAUSE:
val = 0;
break;
case ETHER_STAT_CAP_AUTONEG:
val = 0;
break;
val = 0;
break;
val = 0;
break;
val = 0;
break;
val = 0;
break;
case ETHER_STAT_ADV_CAP_10FDX:
val = 0;
break;
case ETHER_STAT_ADV_CAP_10HDX:
val = 0;
break;
val = 0;
break;
case ETHER_STAT_ADV_CAP_PAUSE:
val = 0;
break;
val = 0;
break;
val = 0;
break;
val = 0;
break;
case ETHER_STAT_LP_CAP_100FDX:
val = 0;
break;
case ETHER_STAT_LP_CAP_100HDX:
val = 0;
break;
case ETHER_STAT_LP_CAP_10FDX:
val = 0;
break;
case ETHER_STAT_LP_CAP_10HDX:
val = 0;
break;
val = 0;
break;
case ETHER_STAT_LP_CAP_PAUSE:
val = 0;
break;
val = 0;
break;
case ETHER_STAT_LINK_ASMPAUSE:
val = 0;
break;
case ETHER_STAT_LINK_PAUSE:
val = 0;
break;
case ETHER_STAT_LINK_AUTONEG:
val = 0;
break;
case ETHER_STAT_LINK_DUPLEX:
break;
val = 0;
break;
case ETHER_STAT_CAP_REMFAULT:
val = 0;
break;
case ETHER_STAT_ADV_REMFAULT:
val = 0;
break;
case ETHER_STAT_LP_REMFAULT:
val = 0;
break;
case ETHER_STAT_JABBER_ERRORS:
val = 0;
break;
case ETHER_STAT_CAP_100T4:
val = 0;
break;
case ETHER_STAT_ADV_CAP_100T4:
val = 0;
break;
case ETHER_STAT_LP_CAP_100T4:
val = 0;
break;
default:
/*
* Shouldn't reach here...
*/
"hxge_m_stat: unrecognized parameter value = 0x%x", stat);
return (ENOTSUP);
}
return (0);
}