aboutsummaryrefslogtreecommitdiff
path: root/sys/net/iflib.c
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2020-03-30 14:22:52 +0000
committerMark Johnston <markj@FreeBSD.org>2020-03-30 14:22:52 +0000
commit59d50fe5ef5e670a3b4a7565e2fccde0098da160 (patch)
treedddf33e5f08173f217dc01b9b456b26dadecfd8e /sys/net/iflib.c
parent9338f1896514ed02f9f8c857390cb65daae0f4a7 (diff)
downloadsrc-59d50fe5ef5e670a3b4a7565e2fccde0098da160.tar.gz
src-59d50fe5ef5e670a3b4a7565e2fccde0098da160.zip
Simplify taskqgroup inititialization.
taskqgroup initialization was broken into two steps: 1. allocate the taskqgroup structure, at SI_SUB_TASKQ; 2. initialize taskqueues, start taskqueue threads, enqueue "binder" tasks to bind threads to specific CPUs, at SI_SUB_SMP. Step 2 tries to handle the case where tasks have already been attached to a queue, by migrating them to their intended queue. In particular, tasks can't be enqueued before step 2 has completed. This breaks NFS mountroot on systems using an iflib-based driver when EARLY_AP_STARTUP is not defined, since mountroot happens before SI_SUB_SMP in this case. Simplify initialization: do all initialization except for CPU binding at SI_SUB_TASKQ. This means that until CPU binding is completed, group tasks may be executed on a CPU other than that to which they were bound, but this should not be a problem for existing users of the taskqgroup KPIs. Reported by: sbruno Tested by: bdragon, sbruno MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24188
Notes
Notes: svn path=/head/; revision=359436
Diffstat (limited to 'sys/net/iflib.c')
-rw-r--r--sys/net/iflib.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index d6494eb89ee6..41f5a97eeeae 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -1410,29 +1410,6 @@ iflib_dma_free_multi(iflib_dma_info_t *dmalist, int count)
iflib_dma_free(*dmaiter);
}
-#ifdef EARLY_AP_STARTUP
-static const int iflib_started = 1;
-#else
-/*
- * We used to abuse the smp_started flag to decide if the queues have been
- * fully initialized (by late taskqgroup_adjust() calls in a SYSINIT()).
- * That gave bad races, since the SYSINIT() runs strictly after smp_started
- * is set. Run a SYSINIT() strictly after that to just set a usable
- * completion flag.
- */
-
-static int iflib_started;
-
-static void
-iflib_record_started(void *arg)
-{
- iflib_started = 1;
-}
-
-SYSINIT(iflib_record_started, SI_SUB_SMP + 1, SI_ORDER_FIRST,
- iflib_record_started, NULL);
-#endif
-
static int
iflib_fast_intr(void *arg)
{
@@ -1440,9 +1417,6 @@ iflib_fast_intr(void *arg)
struct grouptask *gtask = info->ifi_task;
int result;
- if (!iflib_started)
- return (FILTER_STRAY);
-
DBG_COUNTER_INC(fast_intrs);
if (info->ifi_filter != NULL) {
result = info->ifi_filter(info->ifi_filter_arg);
@@ -1467,9 +1441,6 @@ iflib_fast_intr_rxtx(void *arg)
qidx_t txqid;
bool intr_enable, intr_legacy;
- if (!iflib_started)
- return (FILTER_STRAY);
-
DBG_COUNTER_INC(fast_intrs);
if (info->ifi_filter != NULL) {
result = info->ifi_filter(info->ifi_filter_arg);
@@ -1522,9 +1493,6 @@ iflib_fast_intr_ctx(void *arg)
struct grouptask *gtask = info->ifi_task;
int result;
- if (!iflib_started)
- return (FILTER_STRAY);
-
DBG_COUNTER_INC(fast_intrs);
if (info->ifi_filter != NULL) {
result = info->ifi_filter(info->ifi_filter_arg);
@@ -4746,18 +4714,6 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct
*/
ctx->ifc_sysctl_core_offset = get_ctx_core_offset(ctx);
- /*
- * Group taskqueues aren't properly set up until SMP is started,
- * so we disable interrupts until we can handle them post
- * SI_SUB_SMP.
- *
- * XXX: disabling interrupts doesn't actually work, at least for
- * the non-MSI case. When they occur before SI_SUB_SMP completes,
- * we do null handling and depend on this not causing too large an
- * interrupt storm.
- */
- IFDI_INTR_DISABLE(ctx);
-
if (msix > 1) {
/*
* When using MSI-X, ensure that ifdi_{r,t}x_queue_intr_enable