Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/et/if_et.c
Show All 12 Lines | |||||
struct sysctl_oid_list *children, *parent; | struct sysctl_oid_list *children, *parent; | ||||
struct sysctl_oid *tree; | struct sysctl_oid *tree; | ||||
struct et_hw_stats *stats; | struct et_hw_stats *stats; | ||||
ctx = device_get_sysctl_ctx(sc->dev); | ctx = device_get_sysctl_ctx(sc->dev); | ||||
children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)); | children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)); | ||||
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_intr_npkts", | SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_intr_npkts", | ||||
CTLTYPE_INT | CTLFLAG_RW, sc, 0, et_sysctl_rx_intr_npkts, "I", | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, | ||||
"RX IM, # packets per RX interrupt"); | et_sysctl_rx_intr_npkts, "I", "RX IM, # packets per RX interrupt"); | ||||
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_intr_delay", | SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_intr_delay", | ||||
CTLTYPE_INT | CTLFLAG_RW, sc, 0, et_sysctl_rx_intr_delay, "I", | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, | ||||
et_sysctl_rx_intr_delay, "I", | |||||
"RX IM, RX interrupt delay (x10 usec)"); | "RX IM, RX interrupt delay (x10 usec)"); | ||||
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_intr_nsegs", | SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_intr_nsegs", | ||||
CTLFLAG_RW, &sc->sc_tx_intr_nsegs, 0, | CTLFLAG_RW, &sc->sc_tx_intr_nsegs, 0, | ||||
"TX IM, # segments per TX interrupt"); | "TX IM, # segments per TX interrupt"); | ||||
SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "timer", | SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "timer", | ||||
CTLFLAG_RW, &sc->sc_timer, 0, "TX timer"); | CTLFLAG_RW, &sc->sc_timer, 0, "TX timer"); | ||||
tree = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", CTLFLAG_RD, | tree = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", | ||||
NULL, "ET statistics"); | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "ET statistics"); | ||||
parent = SYSCTL_CHILDREN(tree); | parent = SYSCTL_CHILDREN(tree); | ||||
/* TX/RX statistics. */ | /* TX/RX statistics. */ | ||||
stats = &sc->sc_stats; | stats = &sc->sc_stats; | ||||
ET_SYSCTL_STAT_ADD64(ctx, parent, "frames_64", &stats->pkts_64, | ET_SYSCTL_STAT_ADD64(ctx, parent, "frames_64", &stats->pkts_64, | ||||
"0 to 64 bytes frames"); | "0 to 64 bytes frames"); | ||||
ET_SYSCTL_STAT_ADD64(ctx, parent, "frames_65_127", &stats->pkts_65, | ET_SYSCTL_STAT_ADD64(ctx, parent, "frames_65_127", &stats->pkts_65, | ||||
"65 to 127 bytes frames"); | "65 to 127 bytes frames"); | ||||
ET_SYSCTL_STAT_ADD64(ctx, parent, "frames_128_255", &stats->pkts_128, | ET_SYSCTL_STAT_ADD64(ctx, parent, "frames_128_255", &stats->pkts_128, | ||||
"128 to 255 bytes frames"); | "128 to 255 bytes frames"); | ||||
ET_SYSCTL_STAT_ADD64(ctx, parent, "frames_256_511", &stats->pkts_256, | ET_SYSCTL_STAT_ADD64(ctx, parent, "frames_256_511", &stats->pkts_256, | ||||
"256 to 511 bytes frames"); | "256 to 511 bytes frames"); | ||||
ET_SYSCTL_STAT_ADD64(ctx, parent, "frames_512_1023", &stats->pkts_512, | ET_SYSCTL_STAT_ADD64(ctx, parent, "frames_512_1023", &stats->pkts_512, | ||||
"512 to 1023 bytes frames"); | "512 to 1023 bytes frames"); | ||||
ET_SYSCTL_STAT_ADD64(ctx, parent, "frames_1024_1518", &stats->pkts_1024, | ET_SYSCTL_STAT_ADD64(ctx, parent, "frames_1024_1518", &stats->pkts_1024, | ||||
"1024 to 1518 bytes frames"); | "1024 to 1518 bytes frames"); | ||||
ET_SYSCTL_STAT_ADD64(ctx, parent, "frames_1519_1522", &stats->pkts_1519, | ET_SYSCTL_STAT_ADD64(ctx, parent, "frames_1519_1522", &stats->pkts_1519, | ||||
"1519 to 1522 bytes frames"); | "1519 to 1522 bytes frames"); | ||||
/* RX statistics. */ | /* RX statistics. */ | ||||
tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, | tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", | ||||
NULL, "RX MAC statistics"); | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "RX MAC statistics"); | ||||
children = SYSCTL_CHILDREN(tree); | children = SYSCTL_CHILDREN(tree); | ||||
ET_SYSCTL_STAT_ADD64(ctx, children, "bytes", | ET_SYSCTL_STAT_ADD64(ctx, children, "bytes", | ||||
&stats->rx_bytes, "Good bytes"); | &stats->rx_bytes, "Good bytes"); | ||||
ET_SYSCTL_STAT_ADD64(ctx, children, "frames", | ET_SYSCTL_STAT_ADD64(ctx, children, "frames", | ||||
&stats->rx_frames, "Good frames"); | &stats->rx_frames, "Good frames"); | ||||
ET_SYSCTL_STAT_ADD32(ctx, children, "crc_errs", | ET_SYSCTL_STAT_ADD32(ctx, children, "crc_errs", | ||||
&stats->rx_crcerrs, "CRC errors"); | &stats->rx_crcerrs, "CRC errors"); | ||||
ET_SYSCTL_STAT_ADD64(ctx, children, "mcast_frames", | ET_SYSCTL_STAT_ADD64(ctx, children, "mcast_frames", | ||||
Show All 21 Lines | |||||
ET_SYSCTL_STAT_ADD32(ctx, children, "fragments", | ET_SYSCTL_STAT_ADD32(ctx, children, "fragments", | ||||
&stats->rx_fragments, "Fragmented frames"); | &stats->rx_fragments, "Fragmented frames"); | ||||
ET_SYSCTL_STAT_ADD32(ctx, children, "jabbers", | ET_SYSCTL_STAT_ADD32(ctx, children, "jabbers", | ||||
&stats->rx_jabbers, "Frames with jabber error"); | &stats->rx_jabbers, "Frames with jabber error"); | ||||
ET_SYSCTL_STAT_ADD32(ctx, children, "drop", | ET_SYSCTL_STAT_ADD32(ctx, children, "drop", | ||||
&stats->rx_drop, "Dropped frames"); | &stats->rx_drop, "Dropped frames"); | ||||
/* TX statistics. */ | /* TX statistics. */ | ||||
tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, | tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", | ||||
NULL, "TX MAC statistics"); | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "TX MAC statistics"); | ||||
children = SYSCTL_CHILDREN(tree); | children = SYSCTL_CHILDREN(tree); | ||||
ET_SYSCTL_STAT_ADD64(ctx, children, "bytes", | ET_SYSCTL_STAT_ADD64(ctx, children, "bytes", | ||||
&stats->tx_bytes, "Good bytes"); | &stats->tx_bytes, "Good bytes"); | ||||
ET_SYSCTL_STAT_ADD64(ctx, children, "frames", | ET_SYSCTL_STAT_ADD64(ctx, children, "frames", | ||||
&stats->tx_frames, "Good frames"); | &stats->tx_frames, "Good frames"); | ||||
ET_SYSCTL_STAT_ADD64(ctx, children, "mcast_frames", | ET_SYSCTL_STAT_ADD64(ctx, children, "mcast_frames", | ||||
&stats->tx_mcast, "Multicast frames"); | &stats->tx_mcast, "Multicast frames"); | ||||
ET_SYSCTL_STAT_ADD64(ctx, children, "bcast_frames", | ET_SYSCTL_STAT_ADD64(ctx, children, "bcast_frames", | ||||
Show All 12 Lines |