Page MenuHomeFreeBSD

D59294.id185526.diff
No OneTemporary

D59294.id185526.diff

diff --git a/sys/net/iflib.c b/sys/net/iflib.c
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -5706,9 +5706,8 @@
STATE_LOCK(ctx);
ctx->ifc_flags |= IFC_IN_DETACH;
STATE_UNLOCK(ctx);
- /* Tasks may need either lock; ether_ifdetach() takes ifnet_detach_sx. */
+ /* Tasks may need the context lock; ether_ifdetach() may sleep. */
CTX_UNLOCK(ctx);
- IFNET_WUNLOCK();
taskqueue_drain_all(ctx->ifc_tq);
#ifdef PCI_IOV
/*
@@ -5725,7 +5724,6 @@
}
#endif
ether_ifdetach(ctx->ifc_ifp);
- IFNET_WLOCK();
CTX_LOCK(ctx);
goto fail_cleanup_detaching;
@@ -5746,14 +5744,12 @@
if (ctx->ifc_tq != NULL) {
/*
- * Drain without holding the ifnet or context locks so configuration
- * tasks can run to completion. On fail_detach a second drain also
- * catches tasks queued during the first drain.
+ * Drain without holding the context lock so configuration tasks can
+ * run to completion. On fail_detach a second drain also catches
+ * tasks queued during the first drain.
*/
CTX_UNLOCK(ctx);
- IFNET_WUNLOCK();
taskqueue_drain_all(ctx->ifc_tq);
- IFNET_WLOCK();
CTX_LOCK(ctx);
}
@@ -5766,18 +5762,12 @@
/*
* A successful IFDI_ATTACH_PRE must be matched by IFDI_DETACH, even
* when registration fails before queue allocation. Match
- * iflib_device_deregister by detaching before taskqueue_free, and avoid
- * holding IFNET_WLOCK across driver detach (LinuxKPI workqueue drain).
+ * iflib_device_deregister by detaching before taskqueue_free.
*/
if (attach_pre_succeeded) {
- IFNET_WUNLOCK();
IFDI_DETACH(ctx);
if (queues_allocated)
IFDI_QUEUES_FREE(ctx);
- /* Reacquire the global lock before the context lock. */
- CTX_UNLOCK(ctx);
- IFNET_WLOCK();
- CTX_LOCK(ctx);
}
if (ctx->ifc_tq != NULL) {
taskqueue_free(ctx->ifc_tq);

File Metadata

Mime Type
text/plain
Expires
Wed, Sep 9, 3:10 AM (19 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37863220
Default Alt Text
D59294.id185526.diff (1 KB)

Event Timeline