Page MenuHomeFreeBSD

D54096.id167628.diff
No OneTemporary

D54096.id167628.diff

diff --git a/sys/net/iflib.c b/sys/net/iflib.c
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -2588,9 +2588,23 @@
iflib_media_status(if_t ifp, struct ifmediareq *ifmr)
{
if_ctx_t ctx = if_getsoftc(ifp);
+ bool oactive, running;
+
+ STATE_LOCK(ctx);
+ running = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING);
+ oactive = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE);
+ STATE_UNLOCK(ctx);
CTX_LOCK(ctx);
- IFDI_UPDATE_ADMIN_STATUS(ctx);
+ /*
+ * There is no need to update the admin status when it is done regularly by
+ * _task_fn_admin(), so only do it if that's not running. That can be quite
+ * expensive on some drivers.
+ */
+ if ((!running && !oactive) &&
+ !(ctx->ifc_sctx->isc_flags & IFLIB_ADMIN_ALWAYS_RUN)) {
+ IFDI_UPDATE_ADMIN_STATUS(ctx);
+ }
IFDI_MEDIA_STATUS(ctx, ifmr);
CTX_UNLOCK(ctx);
}

File Metadata

Mime Type
text/plain
Expires
Sun, Apr 19, 10:18 PM (11 h, 18 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31770072
Default Alt Text
D54096.id167628.diff (836 B)

Event Timeline