Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/jme/if_jme.c
Show All 12 Lines | |||||
struct jme_hw_stats *stats; | struct jme_hw_stats *stats; | ||||
int error; | int error; | ||||
stats = &sc->jme_stats; | stats = &sc->jme_stats; | ||||
ctx = device_get_sysctl_ctx(sc->jme_dev); | ctx = device_get_sysctl_ctx(sc->jme_dev); | ||||
child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)); | child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)); | ||||
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_coal_to", | SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_coal_to", | ||||
CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_to, 0, | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->jme_tx_coal_to, | ||||
sysctl_hw_jme_tx_coal_to, "I", "jme tx coalescing timeout"); | 0, sysctl_hw_jme_tx_coal_to, "I", "jme tx coalescing timeout"); | ||||
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_coal_pkt", | SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_coal_pkt", | ||||
CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_pkt, 0, | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->jme_tx_coal_pkt, | ||||
sysctl_hw_jme_tx_coal_pkt, "I", "jme tx coalescing packet"); | 0, sysctl_hw_jme_tx_coal_pkt, "I", "jme tx coalescing packet"); | ||||
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_coal_to", | SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_coal_to", | ||||
CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_to, 0, | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->jme_rx_coal_to, | ||||
sysctl_hw_jme_rx_coal_to, "I", "jme rx coalescing timeout"); | 0, sysctl_hw_jme_rx_coal_to, "I", "jme rx coalescing timeout"); | ||||
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_coal_pkt", | SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_coal_pkt", | ||||
CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_pkt, 0, | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->jme_rx_coal_pkt, | ||||
sysctl_hw_jme_rx_coal_pkt, "I", "jme rx coalescing packet"); | 0, sysctl_hw_jme_rx_coal_pkt, "I", "jme rx coalescing packet"); | ||||
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit", | SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit", | ||||
CTLTYPE_INT | CTLFLAG_RW, &sc->jme_process_limit, 0, | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | ||||
sysctl_hw_jme_proc_limit, "I", | &sc->jme_process_limit, 0, sysctl_hw_jme_proc_limit, "I", | ||||
"max number of Rx events to process"); | "max number of Rx events to process"); | ||||
/* Pull in device tunables. */ | /* Pull in device tunables. */ | ||||
sc->jme_process_limit = JME_PROC_DEFAULT; | sc->jme_process_limit = JME_PROC_DEFAULT; | ||||
error = resource_int_value(device_get_name(sc->jme_dev), | error = resource_int_value(device_get_name(sc->jme_dev), | ||||
device_get_unit(sc->jme_dev), "process_limit", | device_get_unit(sc->jme_dev), "process_limit", | ||||
&sc->jme_process_limit); | &sc->jme_process_limit); | ||||
if (error == 0) { | if (error == 0) { | ||||
Show All 24 Lines | |||||
"using default: %d\n", PCCRX_COAL_PKT_DEFAULT); | "using default: %d\n", PCCRX_COAL_PKT_DEFAULT); | ||||
sc->jme_rx_coal_pkt = PCCRX_COAL_PKT_DEFAULT; | sc->jme_rx_coal_pkt = PCCRX_COAL_PKT_DEFAULT; | ||||
} | } | ||||
} | } | ||||
if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) | if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) | ||||
return; | return; | ||||
tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, | tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", | ||||
NULL, "JME statistics"); | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "JME statistics"); | ||||
parent = SYSCTL_CHILDREN(tree); | parent = SYSCTL_CHILDREN(tree); | ||||
/* 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"); | ||||
child = SYSCTL_CHILDREN(tree); | child = SYSCTL_CHILDREN(tree); | ||||
JME_SYSCTL_STAT_ADD32(ctx, child, "good_frames", | JME_SYSCTL_STAT_ADD32(ctx, child, "good_frames", | ||||
&stats->rx_good_frames, "Good frames"); | &stats->rx_good_frames, "Good frames"); | ||||
JME_SYSCTL_STAT_ADD32(ctx, child, "crc_errs", | JME_SYSCTL_STAT_ADD32(ctx, child, "crc_errs", | ||||
&stats->rx_crc_errs, "CRC errors"); | &stats->rx_crc_errs, "CRC errors"); | ||||
JME_SYSCTL_STAT_ADD32(ctx, child, "mii_errs", | JME_SYSCTL_STAT_ADD32(ctx, child, "mii_errs", | ||||
&stats->rx_mii_errs, "MII errors"); | &stats->rx_mii_errs, "MII errors"); | ||||
JME_SYSCTL_STAT_ADD32(ctx, child, "fifo_oflows", | JME_SYSCTL_STAT_ADD32(ctx, child, "fifo_oflows", | ||||
&stats->rx_fifo_oflows, "FIFO overflows"); | &stats->rx_fifo_oflows, "FIFO overflows"); | ||||
JME_SYSCTL_STAT_ADD32(ctx, child, "desc_empty", | JME_SYSCTL_STAT_ADD32(ctx, child, "desc_empty", | ||||
&stats->rx_desc_empty, "Descriptor empty"); | &stats->rx_desc_empty, "Descriptor empty"); | ||||
JME_SYSCTL_STAT_ADD32(ctx, child, "bad_frames", | JME_SYSCTL_STAT_ADD32(ctx, child, "bad_frames", | ||||
&stats->rx_bad_frames, "Bad frames"); | &stats->rx_bad_frames, "Bad 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"); | ||||
child = SYSCTL_CHILDREN(tree); | child = SYSCTL_CHILDREN(tree); | ||||
JME_SYSCTL_STAT_ADD32(ctx, child, "good_frames", | JME_SYSCTL_STAT_ADD32(ctx, child, "good_frames", | ||||
&stats->tx_good_frames, "Good frames"); | &stats->tx_good_frames, "Good frames"); | ||||
JME_SYSCTL_STAT_ADD32(ctx, child, "bad_frames", | JME_SYSCTL_STAT_ADD32(ctx, child, "bad_frames", | ||||
&stats->tx_bad_frames, "Bad frames"); | &stats->tx_bad_frames, "Bad frames"); | ||||
} | } | ||||
#undef JME_SYSCTL_STAT_ADD32 | #undef JME_SYSCTL_STAT_ADD32 | ||||
Show All 12 Lines |