mac_stat.c revision 0dc2366f7b9f9f36e10909b1e95edbf2a261c2ac
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
#define MAC_NKSTAT \
#define MAC_MOD_NKSTAT \
#define MAC_MOD_KSTAT_OFFSET 0
#define MAC_RX_RING_NKSTAT \
#define MAC_TX_RING_NKSTAT \
#define MAC_TX_SWLANE_NKSTAT \
#define MAC_RX_SWLANE_NKSTAT \
#define MAC_RX_HWLANE_NKSTAT \
#define MAC_SUMMARY_NKSTAT \
#define MAC_TX_HWLANE_NKSTAT \
#define MAC_RX_FANOUT_NKSTAT \
} stat_info_t;
#define RX_SRS_STAT_SIZE \
#define TX_SOFTRING_STAT_SIZE \
for (i = 0; i < size; i++) {
uint_t i;
return (EACCES);
if (i == MAC_MOD_KSTAT_OFFSET) {
msi_index = 0;
} else if (i == MAC_KSTAT_OFFSET) {
msi_index = 0;
} else if (i == MAC_TYPE_KSTAT_OFFSET) {
msi_index = 0;
case KSTAT_DATA_UINT64:
case KSTAT_DATA_UINT32:
knp++;
for (i = 0; i < count; i++) {
knp++;
uint_t i;
return (EACCES);
for (i = 0; i < count; i++) {
case KSTAT_DATA_UINT64:
case KSTAT_DATA_UINT32:
knp++;
static kstat_t *
return (NULL);
return (ksp);
return (val);
const char *statname)
return (val);
const char *statname)
static uint64_t
switch (stat) {
case MAC_STAT_OBYTES:
case MAC_STAT_OPACKETS:
case MAC_STAT_OERRORS:
case MAC_STAT_BLOCK:
case MAC_STAT_UNBLOCK:
case MAC_STAT_TXSDROPS:
const char *statname)
static uint64_t
switch (stat) {
case MAC_STAT_IPACKETS:
case MAC_STAT_RBYTES:
case MAC_STAT_LCL:
case MAC_STAT_LCLBYTES:
case MAC_STAT_INTRS:
case MAC_STAT_INTRBYTES:
case MAC_STAT_RXSDROPS:
const char *statname)
static uint64_t
switch (stat) {
case MAC_STAT_IPACKETS:
case MAC_STAT_RBYTES:
case MAC_STAT_INTRS:
case MAC_STAT_INTRBYTES:
case MAC_STAT_POLLS:
case MAC_STAT_POLLBYTES:
case MAC_STAT_RXSDROPS:
case MAC_STAT_CHU10:
case MAC_STAT_CH10T50:
case MAC_STAT_CHO50:
const char *statname)
static uint64_t
switch (stat) {
case MAC_STAT_MULTIRCV:
case MAC_STAT_BRDCSTRCV:
case MAC_STAT_MULTIXMT:
case MAC_STAT_BRDCSTXMT:
case MAC_STAT_MULTIRCVBYTES:
case MAC_STAT_BRDCSTRCVBYTES:
case MAC_STAT_MULTIXMTBYTES:
case MAC_STAT_BRDCSTXMTBYTES:
case MAC_STAT_TX_ERRORS:
case MAC_STAT_MACSPOOFED:
case MAC_STAT_IPSPOOFED:
case MAC_STAT_DHCPSPOOFED:
case MAC_STAT_RESTRICTED:
case MAC_STAT_DHCPDROPPED:
case MAC_STAT_IPACKETS:
case MAC_STAT_RBYTES:
case MAC_STAT_LCL:
case MAC_STAT_LCLBYTES:
case MAC_STAT_INTRS:
case MAC_STAT_INTRBYTES:
case MAC_STAT_POLLS:
case MAC_STAT_POLLBYTES:
case MAC_STAT_RXSDROPS:
case MAC_STAT_CHU10:
case MAC_STAT_CH10T50:
case MAC_STAT_CHO50:
case MAC_STAT_OBYTES:
case MAC_STAT_OPACKETS:
case MAC_STAT_OERRORS:
case MAC_STAT_BLOCK:
case MAC_STAT_UNBLOCK:
case MAC_STAT_TXSDROPS:
const char *statname)
static uint64_t
switch (stat) {
case MAC_STAT_OBYTES:
case MAC_STAT_OPACKETS:
case MAC_STAT_OERRORS:
case MAC_STAT_BLOCK:
case MAC_STAT_UNBLOCK:
case MAC_STAT_TXSDROPS:
const char *statname)
static uint64_t
int index;
switch (stat) {
case MAC_STAT_RBYTES:
case MAC_STAT_IPACKETS:
val = 0;
return (val);
const char *statname)
case MAC_RING_TYPE_RX:
case MAC_RING_TYPE_TX:
if (is_tx_srs) {
statname);
statname);
int index;
statname);
if (!is_tx_srs) {
if (is_tx_srs) {
if (add_stats) {