Page MenuHomeFreeBSD

D59294.diff
No OneTemporary

D59294.diff

diff --git a/sys/net/iflib.c b/sys/net/iflib.c
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -5311,7 +5311,6 @@
#endif
}
iflib_reset_qvalues(ctx);
- IFNET_WLOCK();
CTX_LOCK(ctx);
IFLIB_REGISTER_FAIL_POINT(dev, register_before_attach_pre, err,
fail_cleanup);
@@ -5544,7 +5543,6 @@
iflib_add_pfil(ctx);
ctx->ifc_flags |= IFC_INIT_DONE;
CTX_UNLOCK(ctx);
- IFNET_WUNLOCK();
/* Create led(4) devices if the driver defined the method */
kobj_desc = &ifdi_led_func_desc;
@@ -5559,9 +5557,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
/*
@@ -5578,7 +5575,6 @@
}
#endif
ether_ifdetach(ctx->ifc_ifp);
- IFNET_WLOCK();
CTX_LOCK(ctx);
goto fail_cleanup_detaching;
@@ -5599,14 +5595,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);
}
@@ -5619,18 +5613,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);
@@ -5640,7 +5628,6 @@
iflib_free_intr_mem(ctx);
CTX_UNLOCK(ctx);
- IFNET_WUNLOCK();
iflib_deregister(ctx);
device_set_softc(ctx->ifc_dev, NULL);
if (ctx->ifc_flags & IFC_SC_ALLOCATED)

File Metadata

Mime Type
text/plain
Expires
Tue, Sep 8, 7:55 PM (11 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38149719
Default Alt Text
D59294.diff (2 KB)

Event Timeline