Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F164995865
D9153.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D9153.diff
View Options
Index: head/share/man/man4/sfxge.4
===================================================================
--- head/share/man/man4/sfxge.4
+++ head/share/man/man4/sfxge.4
@@ -166,6 +166,8 @@
SFN5xxx and SFN6xxx series adapters.
SFN7xxx series adapters and SFN8xxx series with earlier firmware use a
fixed 1000 milliseconds statistics update period.
+The period may also be changed after the driver is loaded using the sysctl
+.Va dev.sfxge.%d.stats_update_period_ms .
.El
.Sh SUPPORT
For general information and support,
Index: head/sys/dev/sfxge/sfxge_port.c
===================================================================
--- head/sys/dev/sfxge/sfxge_port.c
+++ head/sys/dev/sfxge/sfxge_port.c
@@ -702,6 +702,48 @@
return period_ms;
}
+static int
+sfxge_port_stats_update_period_ms_handler(SYSCTL_HANDLER_ARGS)
+{
+ struct sfxge_softc *sc;
+ struct sfxge_port *port;
+ unsigned int period_ms;
+ int error;
+
+ sc = arg1;
+ port = &sc->port;
+
+ if (req->newptr != NULL) {
+ error = SYSCTL_IN(req, &period_ms, sizeof(period_ms));
+ if (error != 0)
+ return (error);
+
+ if (period_ms > UINT16_MAX)
+ return (EINVAL);
+
+ SFXGE_PORT_LOCK(port);
+
+ if (port->stats_update_period_ms != period_ms) {
+ if (port->init_state == SFXGE_PORT_STARTED)
+ error = efx_mac_stats_periodic(sc->enp,
+ &port->mac_stats.dma_buf,
+ period_ms, B_FALSE);
+ if (error == 0)
+ port->stats_update_period_ms = period_ms;
+ }
+
+ SFXGE_PORT_UNLOCK(port);
+ } else {
+ SFXGE_PORT_LOCK(port);
+ period_ms = port->stats_update_period_ms;
+ SFXGE_PORT_UNLOCK(port);
+
+ error = SYSCTL_OUT(req, &period_ms, sizeof(period_ms));
+ }
+
+ return (error);
+}
+
int
sfxge_port_init(struct sfxge_softc *sc)
{
@@ -753,6 +795,11 @@
port->stats_update_period_ms = sfxge_port_stats_update_period_ms(sc);
sfxge_mac_stat_init(sc);
+ SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "stats_update_period_ms", CTLTYPE_UINT|CTLFLAG_RW, sc, 0,
+ sfxge_port_stats_update_period_ms_handler, "IU",
+ "interface statistics refresh period");
+
port->init_state = SFXGE_PORT_INITIALIZED;
DBGPRINT(sc->dev, "success");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 6, 6:40 AM (14 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36090142
Default Alt Text
D9153.diff (2 KB)
Attached To
Mode
D9153: sfxge(4): add sysctl to change MAC stats update period
Attached
Detach File
Event Timeline
Log In to Comment